www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18541] New: comparison `==` of two typeid() should always be


          Issue ID: 18541
           Summary: comparison `==` of two typeid() should always be
                    rewritten as a "is"
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

I cant see why anyone would want a full bit per bit comparison of the result of
two `typeid()` since `typeid()` returns static instances, shared for each stuff
of a given type. The idea is to have an AST rewrite of

`typeid(T1) == typeid(T2)`  


`typeid(T1) is typeid(T2)`

which is compiled as faster code.

Mar 01 2018