https://issues.dlang.org/show_bug.cgi?id=21889

Walter Bright <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |WONTFIX

--- Comment #2 from Walter Bright <[email protected]> ---
The documentation says:

"The result is true if the two arguments are the same symbol (once aliases are
resolved)."

  -- https://dlang.org/spec/traits.html#isSame

The code is behaving as specified, as Object and const(Object) are indeed the
same symbol.

But they are different types. To compare types, use

```
is(Object == const(Object))
```
or:
```
is(Object : const(Object))
```

There isn't a need to change anything. Use `is` if comparing types,
`traits(isSame)` for comparing symbols.

--

Reply via email to