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 767092 - compiler ignores type parameter arities in nested generic types
compiler ignores type parameter arities in nested generic types
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Semantic Analyzer
0.32.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-01 03:08 UTC by Matthias Berndt
Modified: 2016-06-25 13:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (814 bytes, patch)
2016-06-01 03:08 UTC, Matthias Berndt
none Details | Review

Description Matthias Berndt 2016-06-01 03:08:47 UTC
Created attachment 328853 [details] [review]
patch

Hey,

Here's an example:

class Foo<T> {}
void main(string[] args) {
  Foo<Foo<string, string> > foo = null;
}

Clearly this should fail to compile since Foo only takes one type parameter but is instantiated as Foo<string, string>. The attached patch fixes the issue.
Comment 1 Jürg Billeter 2016-06-25 13:57:26 UTC
commit 3850736455f02ed3ecc5fb3e10dba171f78be1f5
Author: Matthias Berndt <matthias_berndt@gmx.de>
Date:   Mon May 16 12:21:06 2016 +0200

    Check type arguments recursively
    
    This fixes error checking for code like this:
    
    class Foo<T> {}
    void main(string[] args) {
      Foo<Foo<string, string>> foo = null;
    }
    
    Fixes bug 767092.