Permalink
Browse files

supplemental fix for issue 9008

  • Loading branch information...
WalterBright committed Nov 14, 2012
1 parent bd24747 commit 64a2aa2a901633ac246a391a0a6ec46b2db2a096
Showing with 16 additions and 7 deletions.
  1. +11 −2 src/expression.c
  2. +5 −5 test/fail_compilation/ice9013.d
View
@@ -3029,7 +3029,9 @@ Expression *DsymbolExp::semantic(Scope *sc)
error("forward reference to %s", toChars());
return new ErrorExp();
}
- return new VarExp(loc, s->isFuncDeclaration(), hasOverloads);
+ FuncDeclaration *fd = s->isFuncDeclaration();
+ fd->type = f->type;
+ return new VarExp(loc, fd, hasOverloads);
}
o = s->isOverloadSet();
if (o)
@@ -8596,7 +8598,14 @@ Expression *AddrExp::semantic(Scope *sc)
* otherwise the 'pure' is missing from the type assigned to x.
*/
- error("forward reference to %s", e1->toChars());
+ if (e1->op == TOKvar)
+ {
+ VarExp *ve = (VarExp *)e1;
+ Declaration *d = ve->var;
+ error("forward reference to %s %s", d->kind(), d->toChars());
+ }
+ else
+ error("forward reference to %s", e1->toChars());
return new ErrorExp();
}
@@ -1,5 +1,5 @@
-void main()
-{
- foreach (i; 0 .. missing)
- int[] foo = cast(int[])[i];
-}
+void main()
+{
+ foreach (i; 0 .. missing)
+ int[] foo = cast(int[])[i];
+}

0 comments on commit 64a2aa2

Please sign in to comment.