D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6967 - template instantiation depends an pragma(msg, T.stringof) if __traits is used
Summary: template instantiation depends an pragma(msg, T.stringof) if __traits is used
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-17 09:41 UTC by Tobias Pankrath
Modified: 2012-12-12 22:20 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 Tobias Pankrath 2011-11-17 09:41:24 UTC
From a thread in d.learn: http://www.digitalmars.com/d/archives/digitalmars/D/learn/Strange_behaviour_in_templates_Another_bug_30591.html


I'm trying to learn template meta programming in D. To do this, I'm working
on a  meta state machine like Boost.MSM 
(http://www.boost.org/doc/libs/1_47_0/libs/msm/doc/HTML/index.html).

States are types and can have sub states. If they do, they need to have
an attribut 'SubStates', which should be a TypeTuble with the 
sub states.

The task at hand is: Given a State and a list of all States, create
a list of all parents of State including State itself.

This code (http://paste.pocoo.org/show/506154/) ought to do this
and it works sometimes. 

You can make to interesting observations of this code:

In its current form, 'dmd test.d -unittest' will print: "
> false

But if you uncomment the first pragma() in the unittest block,
it will print 
> () 
> true

If you change the body of ParentsDesc to 
> alias TypeTuple!() Result;
it will also print
> true

Although the static if in ParentsDesc is never true in this
example.
Comment 1 Kenji Hara 2012-12-12 22:20:23 UTC
The code (http://paste.pocoo.org/show/506154/) had disappears, so we cannot know what was the original issue.