# HG changeset patch # User Anders Johnsen # Date 1216935370 -7200 # Node ID 491b5fc4782a64870150c03bde7825000ecd1136 # Parent dc9bf56b7ace34a2386e04555a891721c1113499 Small fixes to type checks. diff -r dc9bf56b7ace -r 491b5fc4782a sema/AstAction.d --- a/sema/AstAction.d Thu Jul 24 23:03:18 2008 +0200 +++ b/sema/AstAction.d Thu Jul 24 23:36:10 2008 +0200 @@ -1,6 +1,7 @@ module sema.AstAction; -import Integer = tango.text.convert.Integer; +import Integer = tango.text.convert.Integer, + tango.io.Stdout; import lexer.Token; diff -r dc9bf56b7ace -r 491b5fc4782a sema/TypeCheck.d --- a/sema/TypeCheck.d Thu Jul 24 23:03:18 2008 +0200 +++ b/sema/TypeCheck.d Thu Jul 24 23:36:10 2008 +0200 @@ -129,7 +129,7 @@ { auto argType = sel.type.asFunction.params[i]; auto expType = arg.type; - if (argType.byteSize != expType.byteSize) + if (argType.isSame(expType)) { if (!expType.hasImplicitConversionTo(argType)) messages.report(InvalidImplicitCast, exp.loc) @@ -222,7 +222,7 @@ { auto argType = exp.exp.type.asFunction.params[i]; auto expType = arg.type; - if(argType.byteSize != expType.byteSize) + if(!argType.isSame(expType)) { if(!expType.hasImplicitConversionTo(argType)) messages.report(InvalidImplicitCast, exp.loc) @@ -266,7 +266,7 @@ { auto argType = sel.type.asFunction.params[i]; auto expType = arg.type; - if (argType.byteSize != expType.byteSize) + if (!argType.isSame(expType)) { if (!expType.hasImplicitConversionTo(argType)) messages.report(InvalidImplicitCast, exp.loc) @@ -329,7 +329,7 @@ { auto returnType = stmt.env.parentFunction.type.asFunction.returnType; auto expType = stmt.exp.type; - if(returnType != expType) + if(!returnType.isSame(expType)) { if(!expType.hasImplicitConversionTo(returnType)) messages.report(InvalidImplicitCast, stmt.exp.loc) @@ -354,7 +354,7 @@ { auto varType = decl.identifier.type; auto expType = decl.init.type; - if(varType.byteSize != expType.byteSize) + if(!varType.isSame(expType)) { if(!expType.hasImplicitConversionTo(varType)) messages.report(InvalidImplicitCast, decl.init.loc) @@ -396,7 +396,7 @@ { auto argType = s.type.asFunction.params[i]; auto expType = arg.type; - if (argType != expType) + if (argType.isSame(expType)) { per = false; if( !expType.hasImplicitConversionTo(argType) )