D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4431 - Template favors alias parameter for struct
Summary: Template favors alias parameter for struct
Status: RESOLVED DUPLICATE of issue 1659
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-06 04:25 UTC by Simen Kjaeraas
Modified: 2016-03-18 12:24 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Simen Kjaeraas 2010-07-06 04:25:34 UTC
template isType( T ) {
    enum isType = true;
}

template isType( alias T ) {
    enum isType = false;
}

struct S {
    alias int foo;
}

static assert( isType!S ); // fails

Testing shows that the latter isType definition is chosen.
Comment 1 Infiltrator 2014-03-18 23:12:45 UTC
Why is this a bug?
Comment 2 Kenji Hara 2016-03-18 12:24:56 UTC

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