diff options
author | Juerg Billeter <j@bitron.ch> | 2007-09-14 20:19:28 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2007-09-14 20:19:28 +0000 |
commit | 7383ea66aaf2821f9f422a654f1335590205077e (patch) | |
tree | 8d97f28c2fa85b74802d7b2712ef2eebd9b6dd42 | |
parent | 763c1b47c017e6589c44eb273e7590d4aba3b487 (diff) | |
download | vala-7383ea66aaf2821f9f422a654f1335590205077e.tar.gz |
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
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gobject/valacodegeneratorinvocationexpression.vala | 9 | ||||
-rw-r--r-- | gobject/valacodegeneratorsignal.vala | 13 |
3 files changed, 20 insertions, 8 deletions
@@ -1,3 +1,9 @@ +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 diff --git a/gobject/valacodegeneratorinvocationexpression.vala b/gobject/valacodegeneratorinvocationexpression.vala index cc8ce06fc..77e309e1d 100644 --- a/gobject/valacodegeneratorinvocationexpression.vala +++ b/gobject/valacodegeneratorinvocationexpression.vala @@ -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); diff --git a/gobject/valacodegeneratorsignal.vala b/gobject/valacodegeneratorsignal.vala index 9c320f9c5..f446f94c2 100644 --- a/gobject/valacodegeneratorsignal.vala +++ b/gobject/valacodegeneratorsignal.vala @@ -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); |