GNOME Bugzilla – Bug 773135
virtual methods which throw errors don't work with fast-vapi
Last modified: 2017-03-20 19:58:50 UTC
$ cat e.vala && valac --fast-vapi e.vapi e.vala public abstract class Foo : GLib.Object { public virtual void bar () throws GLib.Error { } } e.vala:2.3-2.25: error: overriding method `Foo.bar' is incompatible with base method `Foo.bar': incompatible error type `GLib.Error'. public virtual void bar () throws GLib.Error { } ^^^^^^^^^^^^^^^^^^^^^^^ Compilation failed: 1 error(s), 0 warning(s) Doesn't happen with 0.32. Haven't tested with 0.34.1, but there have been a few commits since then about better checking of type arguments; seems a likely place to look. AFAIK it only occurs with fast-vapis, and only for methods which throw errors.
*** Bug 780319 has been marked as a duplicate of this bug. ***
Created attachment 348342 [details] [review] Commit: method: always consider compatible with itself, even with unresolved types
This regression only concerns 0.35+ and was introduced with commit 03f8e291755297ae3c39520cd08d0df9684a9e66 Author: Matthias Berndt <matthias_berndt@gmx.de> Date: Mon Aug 8 19:41:33 2016 +0200 Fix type checking when using generics in combination with subtyping https://bugzilla.gnome.org/show_bug.cgi?id=615830
Created attachment 348357 [details] [review] method: Always consider compatible with itself This is even the case with unresolved types.
Attachment 348357 [details] pushed as c0ff1ad - method: Always consider compatible with itself