Change func out-type from struct to bare type

This commit is contained in:
Nigel Tao committed 2018-07-29 10:02:06 +10:00
1 parent af7b15bc17
commit 9919d78245
19 files changed
+236 -239

No files matched your search

+1 -1
View File
@@ -358,7 +358,7 @@ func (g *gen) writeStatementRet(b *buffer, n *a.Ret, depth uint32) error {
}
b.writes("return ")
if len(g.currFunk.astFunc.Out().Fields()) == 0 {
if g.currFunk.astFunc.Out() == nil {
if retExpr != nil {
return fmt.Errorf("return expression %q incompatible with empty return type", retExpr.Str(g.tm))
}