diff --git a/src/dmd/typesem.d b/src/dmd/typesem.d index 17a5603cd8fa..6221f1173885 100644 --- a/src/dmd/typesem.d +++ b/src/dmd/typesem.d @@ -1928,6 +1928,12 @@ Type merge(Type type) case Tinstance: return type; + case Tsarray: + // prevents generating the mangle if the array dim is not yet known + if (!(cast(TypeSArray) type).dim.isIntegerExp()) + return type; + goto default; + case Tenum: break; diff --git a/test/compilable/b20045.d b/test/compilable/b20045.d new file mode 100644 index 000000000000..988bbca5d96f --- /dev/null +++ b/test/compilable/b20045.d @@ -0,0 +1,2 @@ +alias U = const ubyte[uint.sizeof]*; +static assert (is(U == const(ubyte[4]*)));