typeof.stringof wrong type

Eugene Wissner via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 19 05:42:33 PDT 2016


fullyQualifiedName doesn't work with BitFlags for example:

import std.stdio;
import std.typecons;
import std.traits;

enum Stuff
{
	asdf
}

void main()
{
	BitFlags!Stuff a;

	typeof(a) b;
	mixin(fullyQualifiedName!(typeof(a)) ~ " c;");
	mixin(typeof(a).stringof ~ " d;");
}


Both mixins fail. fullyQualifiedName!(typeof(a)) becomes:
std.typecons.BitFlags!(test.Stuff, cast(Flag)false)

"cast(Flag)false" should be "cast(Flag!"unsafe")false". So string 
template parameter "unsafe" is missing. The same problem as I 
described before ("Flag" is an enum template like in my first 
example).



More information about the Digitalmars-d-learn mailing list