Make the return value mandatory; add ok

This commit is contained in:
Nigel Tao committed 2018-11-24 15:09:28 +11:00
1 parent 24ace1c144
commit 762b320b5e
11 files changed
+45 -50

No files matched your search

+2 -4
View File
@@ -298,10 +298,8 @@ func (q *checker) bcheckStatement(n *a.Node) error {
} else if lTyp == nil {
return fmt.Errorf("TODO: allow returning nothing")
}
if v := n.Value(); v != nil {
if err := q.bcheckAssignment1(nil, lTyp, t.IDEq, v); err != nil {
return err
}
if err := q.bcheckAssignment1(nil, lTyp, t.IDEq, n.Value()); err != nil {
return err
}
case a.KVar: