comparison sema/TypeCheck.d @ 160:6cb2f4201e2a

Improved static arrays Here is a list of some stuff that works char[3] s = "hey" char[3] s2 = s; s2[1] = 98 // no support for chars, but 98 = 'b' :) int[2] i; i[0] = 2; Still can't pass static arrays to functions
author Anders Halager <halager@gmail.com>
date Tue, 22 Jul 2008 13:29:20 +0200
parents 57b0b4464a0b
children ba94fd563548
comparison
equal deleted inserted replaced
159:a2d9121d6dff 160:6cb2f4201e2a
256 { 256 {
257 super.visitVarDecl(decl); 257 super.visitVarDecl(decl);
258 258
259 if(decl.init) 259 if(decl.init)
260 { 260 {
261 auto varType = decl.type; 261 auto varType = decl.identifier.type;
262 auto expType = decl.init.type; 262 auto expType = decl.init.type;
263 if(varType.byteSize != expType.byteSize) 263 if(varType.byteSize != expType.byteSize)
264 { 264 {
265 if(!expType.hasImplicitConversionTo(varType)) 265 if(!expType.hasImplicitConversionTo(varType))
266 messages.report(InvalidImplicitCast, decl.init.loc) 266 messages.report(InvalidImplicitCast, decl.init.loc)