Mercurial > projects > ddmd
comparison dmd/ThrowStatement.d @ 130:60bb0fe4563e
dmdfe 2.037 first main iteration
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Thu, 09 Sep 2010 22:51:44 +0100 |
parents | e28b18c23469 |
children | af724d3510d7 |
comparison
equal
deleted
inserted
replaced
129:010eb8f0e18d | 130:60bb0fe4563e |
---|---|
41 //printf("ThrowStatement::semantic()\n"); | 41 //printf("ThrowStatement::semantic()\n"); |
42 | 42 |
43 FuncDeclaration fd = sc.parent.isFuncDeclaration(); | 43 FuncDeclaration fd = sc.parent.isFuncDeclaration(); |
44 fd.hasReturnExp |= 2; | 44 fd.hasReturnExp |= 2; |
45 | 45 |
46 version(DMDV1) { | |
47 // See bugzilla 3388. Should this be or not? | |
46 if (sc.incontract) | 48 if (sc.incontract) |
47 error("Throw statements cannot be in contracts"); | 49 error("Throw statements cannot be in contracts"); |
50 } | |
48 exp = exp.semantic(sc); | 51 exp = exp.semantic(sc); |
49 exp = resolveProperties(sc, exp); | 52 exp = resolveProperties(sc, exp); |
50 if (!exp.type.toBasetype().isClassHandle()) | 53 if (!exp.type.toBasetype().isClassHandle()) |
51 error("can only throw class objects, not type %s", exp.type.toChars()); | 54 error("can only throw class objects, not type %s", exp.type.toChars()); |
52 return this; | 55 return this; |