After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773135 - virtual methods which throw errors don't work with fast-vapi
virtual methods which throw errors don't work with fast-vapi
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Semantic Analyzer
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
: 780319 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-10-18 06:51 UTC by Evan Nemerson
Modified: 2017-03-20 19:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Commit: method: always consider compatible with itself, even with unresolved types (980 bytes, patch)
2017-03-20 18:09 UTC, Marvin W
none Details | Review
method: Always consider compatible with itself (974 bytes, patch)
2017-03-20 19:57 UTC, Rico Tzschichholz
committed Details | Review

Description Evan Nemerson 2016-10-18 06:51:27 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.
Comment 1 Marvin W 2017-03-20 17:06:05 UTC
*** Bug 780319 has been marked as a duplicate of this bug. ***
Comment 2 Marvin W 2017-03-20 18:09:04 UTC
Created attachment 348342 [details] [review]
Commit: method: always consider compatible with itself, even with unresolved types
Comment 3 Rico Tzschichholz 2017-03-20 18:58:26 UTC
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
Comment 4 Rico Tzschichholz 2017-03-20 19:57:55 UTC
Created attachment 348357 [details] [review]
method: Always consider compatible with itself

This is even the case with unresolved types.
Comment 5 Rico Tzschichholz 2017-03-20 19:58:42 UTC
Attachment 348357 [details] pushed as c0ff1ad - method: Always consider compatible with itself