Commit 04e86121 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

improve argument checks of invocation expression, fixes bug 435854

2007-05-14  Jürg Billeter  <j@bitron.ch>

	* vala/valasemanticanalyzer.vala: improve argument checks of invocation
	  expression, fixes bug 435854

svn path=/trunk/; revision=316
parent 0899abe8
2007-05-14 Jürg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala: improve argument checks of invocation
expression, fixes bug 435854
2007-05-10 Jürg Billeter <j@bitron.ch>
* ccode/valaccodeblock.vala, ccode/valaccodedeclaration.vala,
......
......@@ -1244,9 +1244,14 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
}
} else {
var arg = (Expression) arg_it.data;
if (arg.static_type != null && !is_type_compatible (arg.static_type, param.type_reference)) {
/* if there was an error in the argument,
* i.e. arg.static_type == null, skip type check */
if (arg.static_type == null) {
// disallow untyped arguments except for type inference of callbacks
if (!(param.type_reference.data_type is Callback)) {
expr.error = true;
Report.error (expr.source_reference, "Invalid type for argument %d".printf (i + 1));
return false;
}
} else if (!is_type_compatible (arg.static_type, param.type_reference)) {
expr.error = true;
Report.error (expr.source_reference, "Argument %d: Cannot convert from `%s' to `%s'".printf (i + 1, arg.static_type.to_string (), param.type_reference.to_string ()));
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment