summaryrefslogtreecommitdiff
path: root/limbo/typecheck.c
diff options
context:
space:
mode:
authorCharles Forsyth <charles.forsyth@gmail.com>2015-10-31 11:06:38 +0000
committerCharles Forsyth <charles.forsyth@gmail.com>2015-10-31 11:06:38 +0000
commitc417e38a68a434502922501799bcf86a15a42221 (patch)
tree18d6f2443808b803c8d1466082da3507d85b3b29 /limbo/typecheck.c
parenta3b48c04d0cbf55ffa78314786dacbb437db10ab (diff)
suppress cyclic errors by default; -y to enable them
Diffstat (limited to 'limbo/typecheck.c')
-rw-r--r--limbo/typecheck.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/limbo/typecheck.c b/limbo/typecheck.c
index 8f1e2bb3..52e0295d 100644
--- a/limbo/typecheck.c
+++ b/limbo/typecheck.c
@@ -2155,13 +2155,15 @@ circlval(Node *n, Node *lval)
case Oname:
break;
case Odot:
- if(n->right->decl->cycle && !n->right->decl->cyc){
+ if(oldcycles && n->right->decl->cycle && !n->right->decl->cyc){
nerror(lval, "cannot assign to %V because field '%s' of %V could complete a cycle to %V",
lval, n->right->decl->sym->name, n->left, n->left);
return -1;
}
return 1;
case Oind:
+ if(!oldcycles)
+ return 1;
for(id = n->ty->ids; id != nil; id = id->next){
if(id->cycle && !id->cyc){
nerror(lval, "cannot assign to %V because field '%s' of %V could complete a cycle to %V",