typeof.stringof wrong type
Eugene Wissner via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Aug 17 05:08:00 PDT 2016
I have a problem, that .stringof doesn't return what I'm
expecting. Consider the following:
template A(string T)
{
enum A : bool
{
yes = true,
}
}
void main()
{
A!"asdf" a1;
typeof(a1) a2;
mixin(typeof(a1).stringof ~ " a3;");
}
I get an error: some.d-mixin-13|13 error| Error: template
some.A(string T) is used as a type
Why the second line in main() works but the third one not?
typeof(a1).stringof seems to ignore the string template parameter
T.
pragma(msg, typeof(a1).stringof) would return just "A".
Is it a bug?
More information about the Digitalmars-d-learn
mailing list