With DMD 2.062, the following code compiles and runs:
void main() {
int[string] x;
static if (is(typeof(x) S : T[U], T, U)) { }
pragma(msg, S, " ", T, " ", U);
}
This is not evident from the spec. The spec should clarify whether this is supposed to compile or not. If it is not, the compiler implementation should be fixed.
Comment #1 by k.hara.pg — 2013-03-11T22:40:19Z
I think this is definitely a bug. There is no usefulness.
Long time ago I found the bug, but I couldn't fix the bug.
As far as I know, std.typecons.Rebindable implementation is relied on this buggy/bad feature.
Comment #2 by robert.schadek — 2024-12-13T18:04:42Z