Mercurial > projects > ddmd
comparison dmd/TypeTypeof.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 |
---|---|
130 exp = resolveProperties(sc, exp); | 130 exp = resolveProperties(sc, exp); |
131 sc.intypeof--; | 131 sc.intypeof--; |
132 if (exp.op == TOK.TOKtype) | 132 if (exp.op == TOK.TOKtype) |
133 { | 133 { |
134 error(loc, "argument %s to typeof is not an expression", exp.toChars()); | 134 error(loc, "argument %s to typeof is not an expression", exp.toChars()); |
135 goto Lerr; | |
135 } | 136 } |
136 t = exp.type; | 137 t = exp.type; |
137 if (!t) | 138 if (!t) |
138 { | 139 { |
139 error(loc, "expression (%s) has no type", exp.toChars()); | 140 error(loc, "expression (%s) has no type", exp.toChars()); |
140 goto Lerr; | 141 goto Lerr; |
141 } | 142 } |
142 if (t.ty == TY.Ttypeof) | 143 if (t.ty == TY.Ttypeof) |
144 { | |
143 error(loc, "forward reference to %s", toChars()); | 145 error(loc, "forward reference to %s", toChars()); |
146 goto Lerr; | |
147 } | |
144 | 148 |
145 /* typeof should reflect the true type, | 149 /* typeof should reflect the true type, |
146 * not what 'auto' would have gotten us. | 150 * not what 'auto' would have gotten us. |
147 */ | 151 */ |
148 //t = t.toHeadMutable(); | 152 //t = t.toHeadMutable(); |