D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10587 - __traits(getAttributes) doesn't work on incomplete templated types
Summary: __traits(getAttributes) doesn't work on incomplete templated types
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-09 11:38 UTC by QAston
Modified: 2020-05-24 14:33 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 QAston 2013-07-09 11:38:30 UTC
Minimized case:
enum Attribute;
	
@Attribute
class MyTemplate(T) {
}

@Attribute
class MyType {
}

pragma(msg, __traits(getAttributes, MyTemplate)); // prints: tuple()
pragma(msg, __traits(getAttributes, MyTemplate!uint)); // prints: tuple((Attribute))
pragma(msg, __traits(getAttributes, MyType)); // prints: tuple((Attribute))

I think it either result should be the same for non-instantiated type as for instantiated or pragma(msg, __traits(getAttributes, MyTemplate)) should yeld a compile time error.
Comment 1 basile-z 2020-05-24 14:33:10 UTC
working as expected since v2.065.0