Commit 535feeeb authored by Jürg Billeter's avatar Jürg Billeter

Support virtual interface signals

Fixes bug 676802.
parent d634eb6c
......@@ -586,7 +586,15 @@ public class Vala.MemberAccess : Expression {
} else if (m.base_interface_method != null) {
// refer to base method to inherit default arguments
m = m.base_interface_method;
symbol_reference = m;
if (m.signal_reference != null) {
// method is class/default handler for a signal
// let signal deal with member access
symbol_reference = m.signal_reference;
} else {
symbol_reference = m;
}
member = symbol_reference;
}
access = m.access;
......
......@@ -493,6 +493,10 @@ public class Vala.Method : Subroutine {
private void find_base_class_method (Class cl) {
var sym = cl.scope.lookup (name);
if (sym is Signal) {
var sig = (Signal) sym;
sym = sig.default_handler;
}
if (sym is Method) {
var base_method = (Method) sym;
if (base_method.is_abstract || base_method.is_virtual) {
......@@ -503,20 +507,6 @@ public class Vala.Method : Subroutine {
return;
}
_base_method = base_method;
return;
}
} else if (sym is Signal) {
var sig = (Signal) sym;
if (sig.is_virtual) {
var base_method = sig.default_handler;
string invalid_match;
if (!compatible (base_method, out invalid_match)) {
error = true;
Report.error (source_reference, "overriding method `%s' is incompatible with base method `%s': %s.".printf (get_full_name (), base_method.get_full_name (), invalid_match));
return;
}
_base_method = base_method;
return;
}
......@@ -532,6 +522,10 @@ public class Vala.Method : Subroutine {
foreach (DataType type in cl.get_base_types ()) {
if (type.data_type is Interface) {
var sym = type.data_type.scope.lookup (name);
if (sym is Signal) {
var sig = (Signal) sym;
sym = sig.default_handler;
}
if (sym is Method) {
var base_method = (Method) sym;
if (base_method.is_abstract || base_method.is_virtual) {
......
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