comparison dmd/BinExp.d @ 90:39648eb578f6

more Expressions work
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Mon, 30 Aug 2010 20:27:56 +0100
parents be2ab491772e
children 5c859d5fbe27
comparison
equal deleted inserted replaced
88:23280d154c5b 90:39648eb578f6
1139 error("array index %d is out of bounds %s[0..%d]", elemi, 1139 error("array index %d is out of bounds %s[0..%d]", elemi,
1140 v.toChars(), ae.elements.dim); 1140 v.toChars(), ae.elements.dim);
1141 return EXP_CANT_INTERPRET; 1141 return EXP_CANT_INTERPRET;
1142 } 1142 }
1143 // Get old element 1143 // Get old element
1144 Expression vie = cast(Expression)(ae.elements.data[elemi]); 1144 auto vie = ae.elements[elemi];
1145 if (vie.op != TOKstructliteral) 1145 if (vie.op != TOKstructliteral)
1146 return EXP_CANT_INTERPRET; 1146 return EXP_CANT_INTERPRET;
1147 1147
1148 // Work out which field needs to be changed 1148 // Work out which field needs to be changed
1149 StructLiteralExp se = cast(StructLiteralExp)vie; 1149 auto se = cast(StructLiteralExp)vie;
1150 VarDeclaration vf = (cast(DotVarExp)e1).var.isVarDeclaration(); 1150 auto vf = (cast(DotVarExp)e1).var.isVarDeclaration();
1151 if (!vf) 1151 if (!vf)
1152 return EXP_CANT_INTERPRET; 1152 return EXP_CANT_INTERPRET;
1153 1153
1154 int fieldi = se.getFieldIndex(type, vf.offset); 1154 int fieldi = se.getFieldIndex(type, vf.offset);
1155 if (fieldi == -1) 1155 if (fieldi == -1)