Add a nothing built-in literal

This commit is contained in:
Nigel Tao committed 2019-02-03 14:01:19 +11:00
1 parent 49627b46f2
commit d1f1340d47
4 files changed
+12 -5

No files matched your search

+1 -1
View File
@@ -308,7 +308,7 @@ func (q *checker) bcheckStatement(n *a.Node) error {
if q.astFunc.Effect().Coroutine() {
lTyp = typeExprStatus
} else if lTyp == nil {
return fmt.Errorf("TODO: allow returning nothing")
lTyp = typeExprEmptyStruct
}
if _, err := q.bcheckAssignment1(nil, lTyp, t.IDEq, n.Value()); err != nil {
return err