Commit 7383ea66 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

fix late bound methods and signals, fixes bug 476953

2007-09-14  Juerg Billeter  <j@bitron.ch>

	* gobject/valacodegeneratorinvocationexpression.vala,
	  gobject/valacodegeneratorsignal.vala: fix late bound methods and
	  signals, fixes bug 476953

svn path=/trunk/; revision=603
parent 763c1b47
2007-09-14 Jürg Billeter <j@bitron.ch>
* gobject/valacodegeneratorinvocationexpression.vala,
gobject/valacodegeneratorsignal.vala: fix late bound methods and
signals, fixes bug 476953
2007-09-13 Jürg Billeter <j@bitron.ch>
* gobject/valacodegeneratormethod.vala: generate C code comment for
......
......@@ -83,9 +83,12 @@ public class Vala.CodeGenerator {
instance = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, instance);
}
var instance_target_type = new TypeReference ();
instance_target_type.data_type = (DataType) base_method.parent_symbol;
instance = get_implicit_cast_expression (instance, instance_expression_type, instance_target_type);
// parent_symbol may be null for late bound methods
if (base_method.parent_symbol != null) {
var instance_target_type = new TypeReference ();
instance_target_type.data_type = (DataType) base_method.parent_symbol;
instance = get_implicit_cast_expression (instance, instance_expression_type, instance_target_type);
}
if (!m.instance_last) {
ccall.add_argument (instance);
......
......@@ -105,11 +105,14 @@ public class Vala.CodeGenerator {
}
public override void visit_signal (Signal! sig) {
var dt = sig.parent_symbol as DataType;
if (!dt.is_subtype_of (gobject_type)) {
sig.error = true;
Report.error (sig.source_reference, "Only classes and interfaces deriving from GLib.Object support signals. `%s' does not derive from GLib.Object.".printf (dt.get_full_name ()));
return;
// parent_symbol may be null for late bound signals
if (sig.parent_symbol != null) {
var dt = sig.parent_symbol as DataType;
if (!dt.is_subtype_of (gobject_type)) {
sig.error = true;
Report.error (sig.source_reference, "Only classes and interfaces deriving from GLib.Object support signals. `%s' does not derive from GLib.Object.".printf (dt.get_full_name ()));
return;
}
}
sig.accept_children (this);
......
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