[Bug 31] New: Keyword 'function' and pointer test broken for IsExpression

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 9 22:01:39 PST 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=31

           Summary: Keyword 'function' and pointer test broken for
                    IsExpression
           Product: D
           Version: 0.148
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: walter at digitalmars.com
        ReportedBy: sean at f4.ca


Given the documentation, I would expect all eight tests to pass, yet tests six
and eight both fail.


C:\code\d\bugs>type 149_1.d
import std.c.stdio;

template isPointer( T )
{
    const bool isPointer = is( T : T* );
}

void main()
{
    struct S {}
    union U {}
    class C {}
    interface I {}
    enum E { e }
    alias void function() fp;
    alias void delegate() dp;

    static if( is( S == struct ) ) printf( "1. struct passes\n" );
    static if( is( U == union ) ) printf( "2. union passes\n" );
    static if( is( C == class ) ) printf( "3. class passes\n" );
    static if( is( I == interface ) ) printf( "4. interface passes\n" );
    static if( is( E == enum ) ) printf( "5. enum passes\n" );
    static if( is( fp == function ) ) printf( "6. function passes\n" );
    static if( is( dp == delegate ) ) printf( "7. delegate passes\n" );
    static if( isPointer!(int*) ) printf( "8. pointer passes\n" );
}
C:\code\d\bugs>dmd 149_1.d
C:\bin\dmd\bin\..\..\dm\bin\link.exe 149_1,,,user32+kernel32/noi;

C:\code\d\bugs>149_1
1. struct passes
2. union passes
3. class passes
4. interface passes
5. enum passes
7. delegate passes

C:\code\d\bugs>


-- 




More information about the Digitalmars-d-bugs mailing list