www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19270] New: is expression fails with function types


          Issue ID: 19270
           Summary: is expression fails with function types
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: atila.neves gmail.com

The second static assert below fails and shouldn't since it's basically the
same thing as the first one:

int foo(short, double) { return 42; }
static assert(is(typeof(foo) == typeof(*(int function(short, double)).init)));
static assert(is(typeof(foo) == typeof(*(int function(A0,   double)).init)),

Note that this works as expected:

static assert(is(typeof(&foo) == int function(A0, double), A0));

Sep 27 2018