Well, this is interesting. With `__traits(compile, lhs is rhs)` or `is(typeof(lhs is rhs) == bool)`, this code works. Without the static if, it fails to compile. So, some of the types being tested don't work with `lhs is rhs`. If I use a pragma to print them out, it looks like it's these pairings:

    const(E), const(D)
    const(E), immutable(D)
    immutable(E), const(D)
    immutable(E), immutable(D)

But if I go with `is(T : S) || is(S : T)` like I originally had, the list is much longer, and the various types which can't possibly be the same are then listed. So, it looks like I should indeed switch it back to what I had originally. However, I'd be inclined to argue that the compiler should be changed to consider `lhs is rhs` to be illegal whenever it knows that it's impossible for it to be `true`, which it clearly isn't doing right now.