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 737500 - Vala crash when nested class/struct uses the generic from outer scope
Vala crash when nested class/struct uses the generic from outer scope
Status: RESOLVED DUPLICATE of bug 587905
Product: vala
Classification: Core
Component: Semantic Analyzer
0.26.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-27 20:53 UTC by Maciej (Matthew) Piechotka
Modified: 2018-02-17 15:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Maciej (Matthew) Piechotka 2014-09-27 20:53:53 UTC
class Foo<G> {
    class Bar {
        G foobar;
    }
}

Instead of error crashes vala:

test.vala:3.9-3.16: warning: field `Foo.Bar.foobar' never used
        G foobar;
        ^^^^^^^^
**
ERROR:valasemanticanalyzer.c:5672:vala_semantic_analyzer_get_actual_type: assertion failed: (instance_type != null)
Comment 1 Florian Pelz 2015-10-20 15:01:24 UTC
This does not crash for me with current vala. The following does however:

class Foo<G> {
    class Bar {
        public G foobar;
    }
    void foo (G foobar) {
        var bar = new Bar();
        bar.foobar = foobar;
    }
}

$ valac e.vala  
**
ERROR:valasemanticanalyzer.c:5675:vala_semantic_analyzer_get_actual_type: assertion failed: (instance_type != null)
zsh: abort (core dumped)  valac e.vala
Comment 2 Rico Tzschichholz 2018-02-17 15:40:04 UTC

*** This bug has been marked as a duplicate of bug 587905 ***