diff --git a/src/mtype.c b/src/mtype.c index 1e32cad2ee92..9a4dc203dc20 100644 --- a/src/mtype.c +++ b/src/mtype.c @@ -2428,6 +2428,8 @@ Identifier *Type::getTypeInfoIdent(int internal) if (ty == Tarray) buf.writeByte(mangleChar[((TypeArray *)this)->next->ty]); } + else if (deco) + buf.writestring(deco); else toDecoBuffer(&buf); @@ -2441,7 +2443,7 @@ Identifier *Type::getTypeInfoIdent(int internal) assert(name); sprintf(name, "_D%lluTypeInfo_%s6__initZ", (unsigned long long) 9 + len, buf.data); - //printf("name = %s\n", name); + //printf("%p, deco = %s, name = %s\n", this, deco, name); assert(strlen(name) < namelen); // don't overflow the buffer size_t off = 0; diff --git a/test/runnable/xtest46.d b/test/runnable/xtest46.d index 35c63094955e..323283aac64b 100644 --- a/test/runnable/xtest46.d +++ b/test/runnable/xtest46.d @@ -6881,6 +6881,32 @@ void test11317() /***************************************************/ +struct S12044(T) +{ + void f()() + { + new T[1]; + } + + bool opEquals(O)(O) + { + f(); + } +} + +void test12044() +{ + () + { + enum E { e } + auto arr = [E.e]; + S12044!E s; + } + (); +} + +/***************************************************/ + int main() { test1(); @@ -7164,6 +7190,7 @@ int main() test7254(); test11075(); test11317(); + test12044(); printf("Success\n"); return 0;