Changeset 371

Show
Ignore:
Timestamp:
02/05/10 22:53:22 (2 years ago)
Author:
walter
Message:

bugzilla 3450 incorrect result for is (typeof({ ... }())) inside a struct

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dmd-1.x/src/func.c

    r366 r371  
    733733    {   VarDeclaration *v; 
    734734 
    735         if (isFuncLiteralDeclaration() && isNested()
     735        if (isFuncLiteralDeclaration() && isNested() && !sc->intypeof
    736736        { 
    737         error("literals cannot be class members"); 
     737        error("function literals cannot be class members"); 
    738738        return; 
    739739        } 
    740740        else 
    741741        { 
    742         assert(!isNested());  // can't be both member and nested 
     742        assert(!isNested() || sc->intypeof);  // can't be both member and nested 
    743743        assert(ad->handle); 
    744744        v = new ThisDeclaration(loc, ad->handle); 
  • trunk/src/func.c

    r366 r371  
    842842    {   VarDeclaration *v; 
    843843 
    844         if (isFuncLiteralDeclaration() && isNested()
     844        if (isFuncLiteralDeclaration() && isNested() && !sc->intypeof
    845845        { 
    846         error("literals cannot be class members"); 
     846        error("function literals cannot be class members"); 
    847847        return; 
    848848        } 
    849849        else 
    850850        { 
    851         assert(!isNested());  // can't be both member and nested 
     851        assert(!isNested() || sc->intypeof);  // can't be both member and nested 
    852852        assert(ad->handle); 
    853853        Type *thandle = ad->handle;