D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6262 - Templates which exist only inside is(typeof()) shouldn't be instantiated
Summary: Templates which exist only inside is(typeof()) shouldn't be instantiated
Status: RESOLVED DUPLICATE of issue 6661
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2011-07-07 00:06 UTC by Don
Modified: 2015-06-09 05:11 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 Don 2011-07-07 00:06:03 UTC
The code below should compile with no errors.

This is related to the other gagging bugs (bug 4269, bug 5932, bug 4197, bug 5996). I think that every template needs to record whether it is an investigative template or not. If it is, it shouldn't be considered to be instantiated.

-----
template Compileable(int z) { bool OK;}

static assert(!is(typeof( Compileable!(Bug6262!(int).bar()) )));

struct Bug6262(T)
{
   int bar() { T.codswallop(); return 3; }
}
Comment 1 Don 2012-03-21 12:51:44 UTC
I reported this one twice! Fixed in 2.056.

*** This issue has been marked as a duplicate of issue 6661 ***