2008-02-05 Juerg Billeter <j@bitron.ch>
* vala/valapointertype.vala, vala/valasemanticanalyzer.vala: support
addressof expressions for reference types, fixes bug 514495
svn path=/trunk/; revision=971
2008-02-05 Jürg Billeter <j@bitron.ch>
+ * vala/valapointertype.vala, vala/valasemanticanalyzer.vala: support
+ addressof expressions for reference types, fixes bug 514495
+
+2008-02-05 Jürg Billeter <j@bitron.ch>
+
* vala/valasemanticanalyzer.vala: fix crash when casting an invalid
expression, fixes bug 514331
/* valapointertype.vala
*
- * Copyright (C) 2007 Jürg Billeter
+ * Copyright (C) 2007-2008 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
return true;
}
+ if (base_type.is_reference_type_or_type_parameter ()) {
+ // Object* is compatible with Object if Object is a reference type
+ return base_type.compatible (target_type, enable_non_null);
+ }
+
return false;
}
return;
}
- expr.static_type = new PointerType (expr.inner.static_type);
+ if (expr.inner.static_type.is_reference_type_or_type_parameter ()) {
+ expr.static_type = new PointerType (new PointerType (expr.inner.static_type));
+ } else {
+ expr.static_type = new PointerType (expr.inner.static_type);
+ }
}
public override void visit_reference_transfer_expression (ReferenceTransferExpression! expr) {