Don't have suspend state if we don't suspend.

This commit is contained in:
Nigel Tao committed 2017-08-26 17:27:01 +10:00
1 parent a8423cee70
commit 018d8d1893
4 files changed
+18 -127

No files matched your search

+3
View File
@@ -558,6 +558,9 @@ func (g *gen) writeStruct(b *buffer, n *a.Struct) error {
if o.Receiver() != n.Name() || !o.Suspendible() {
continue
}
if k := g.funks[o.QID()]; k.coroSuspPoint == 0 {
continue
}
// TODO: allow max depth > 1 for recursive coroutines.
const maxDepth = 1
b.writes("struct {\n")