Mercurial > projects > ddmd
comparison dmd/TypeReturn.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 | e3afd1303184 |
comparison
equal
deleted
inserted
replaced
129:010eb8f0e18d | 130:60bb0fe4563e |
---|---|
51 { | 51 { |
52 error(loc, "typeof(return) must be inside function"); | 52 error(loc, "typeof(return) must be inside function"); |
53 goto Lerr; | 53 goto Lerr; |
54 } | 54 } |
55 t = sc.func.type.nextOf(); | 55 t = sc.func.type.nextOf(); |
56 if (!t) | |
57 { | |
58 error(loc, "cannot use typeof(return) inside function %s with inferred return type", sc.func.toChars()); | |
59 goto Lerr; | |
60 } | |
56 t = t.addMod(mod); | 61 t = t.addMod(mod); |
57 | 62 |
58 if (idents.dim) | 63 if (idents.dim) |
59 { | 64 { |
60 Dsymbol s = t.toDsymbol(sc); | 65 Dsymbol s = t.toDsymbol(sc); |