Commit e41d9f6d authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

any reference or array type or pointer type can be cast to a generic

2007-07-11  Juerg Billeter  <j@bitron.ch>

	* vala/valasemanticanalyzer.vala: any reference or array type or pointer
	  type can be cast to a generic pointer

svn path=/trunk/; revision=343
parent 9433e016
2007-07-11 Jürg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala: any reference or array type or pointer
type can be cast to a generic pointer
2007-07-11 Jürg Billeter <j@bitron.ch> 2007-07-11 Jürg Billeter <j@bitron.ch>
* vapi/libxml-2.0.vala: expand libxml2 bindings, * vapi/libxml-2.0.vala: expand libxml2 bindings,
......
...@@ -1175,6 +1175,19 @@ public class Vala.SemanticAnalyzer : CodeVisitor { ...@@ -1175,6 +1175,19 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
return false; return false;
} }
if (expected_type.data_type == pointer_type) {
/* any reference or array type or pointer type can be cast to a generic pointer */
if (expression_type.type_parameter != null ||
expression_type.data_type.is_reference_type () ||
expression_type.data_type is Pointer ||
expression_type.data_type is Array ||
expression_type.data_type is Callback) {
return true;
}
return false;
}
/* temporarily ignore type parameters */ /* temporarily ignore type parameters */
if (expected_type.type_parameter != null) { if (expected_type.type_parameter != null) {
return true; return true;
......
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