Commit 5fb5abc0 authored by Rico Tzschichholz's avatar Rico Tzschichholz

vala: Abstract and virtual methods may not be variadic

The chain-up of the variadic parameter is not possible.

https://bugzilla.gnome.org/show_bug.cgi?id=643088
parent 777776ae
......@@ -90,6 +90,7 @@ TESTS = \
methods/bug642350.vala \
methods/bug642885.vala \
methods/bug642899.vala \
methods/bug643088.test \
methods/bug646345.vala \
methods/bug648030.test \
methods/bug648320.vala \
......
Invalid Code
class Foo {
public abstract void bar (int p, ...);
}
void main () {
}
......@@ -647,6 +647,12 @@ public class Vala.Method : Subroutine, Callable {
}
}
if (is_variadic () && (is_abstract || is_virtual)) {
error = true;
Report.error (source_reference, "Abstract and virtual methods may not be variadic. Use a `va_list' parameter instead of `...'.");
return false;
}
if (is_abstract) {
if (parent_symbol is Class) {
var cl = (Class) parent_symbol;
......
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