https://issues.dlang.org/show_bug.cgi?id=21174
Simen Kjaeraas <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution|--- |INVALID --- Comment #1 from Simen Kjaeraas <[email protected]> --- E and E2 are different types from string, so when you check is(T == string), you're explicitly disallowing them. is(T1 == T2) is a lot stricter than calling fun(int) with a short value - it asks 'are these types the same type?', and E and string simply are not. You may have wanted to write is(T : string), which checks if E is implicitly convertible to string, which it is. This compiles and runs. --
