[Issue 966] New: is(H==function) fails if H is a function type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 15 03:12:53 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=966

           Summary: is(H==function) fails if H is a function type
           Product: D
           Version: 1.005
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: elmar at zandere.de


The following code fails with an assertion:

bool isfun(H)( H h){
  static if (is( H == function ))
    return true;
  else
    return false; 
}

void fun( int i ) {}

void main() {
  assert( isfun( &fun ) ); // should not 
}

BTW: If H is a delegate type, then is(H==delegate) works fine in the
corresponding code.


-- 



More information about the Digitalmars-d-bugs mailing list