D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14290 - is-expression accepts instantiation of already instantiated template
Summary: is-expression accepts instantiation of already instantiated template
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid, pull
Depends on:
Blocks:
 
Reported: 2015-03-15 20:30 UTC by Marc Schütz
Modified: 2017-07-19 17:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Marc Schütz 2015-03-15 20:30:41 UTC
This compiles:

    struct Foo(int i) {}
    alias Foo1 = Foo!1;
    static assert(is(Foo!2 == Foo1!T, T...));

Foo1 is clearly not a template, therefore the is-expression should fail.
(The alias is needed for syntactic reasons.)

Discovered by Nicolas Sicard:
http://forum.dlang.org/post/jsofxhqbdoupzbfdhxxe@forum.dlang.org
Comment 3 github-bugzilla 2015-03-25 09:23:18 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4a90c005c971f40bced70257b343419436174e14
fix Issue 14290 - is-expression accepts instantiation of already instantiated template

https://github.com/D-Programming-Language/dmd/commit/5c1fedca8a9c7b8b85013f03cb2607469292bbe7
Merge pull request #4499 from 9rnsr/fix14290

Issue 14290 - is-expression accepts instantiation of already instantiated template
Comment 4 github-bugzilla 2015-06-17 21:02:16 UTC
Commits pushed to stable at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4a90c005c971f40bced70257b343419436174e14
fix Issue 14290 - is-expression accepts instantiation of already instantiated template

https://github.com/D-Programming-Language/dmd/commit/5c1fedca8a9c7b8b85013f03cb2607469292bbe7
Merge pull request #4499 from 9rnsr/fix14290
Comment 5 github-bugzilla 2017-07-19 17:42:38 UTC
Commits pushed to dmd-cxx at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/af1db6dba1c8dfe5044f0364c8d4c51aaa7ba1be
Supplemental fix for issue 14290

https://github.com/dlang/phobos/commit/31f4928ad691397155ff1d4019de7a28fb8bb5a9
Merge pull request #3057 from 9rnsr/fix14290