Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bugzilla 3450 incorrect result for is (typeof({ ... }())) inside a st…
…ruct
  • Loading branch information
Walter Bright committed Feb 6, 2010
1 parent 8990db6 commit 5a4363c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/func.c
Expand Up @@ -732,14 +732,14 @@ void FuncDeclaration::semantic3(Scope *sc)
if (ad)
{ VarDeclaration *v;

if (isFuncLiteralDeclaration() && isNested())
if (isFuncLiteralDeclaration() && isNested() && !sc->intypeof)
{
error("literals cannot be class members");
error("function literals cannot be class members");
return;
}
else
{
assert(!isNested()); // can't be both member and nested
assert(!isNested() || sc->intypeof); // can't be both member and nested
assert(ad->handle);
v = new ThisDeclaration(loc, ad->handle);
v->storage_class |= STCparameter | STCin;
Expand Down

0 comments on commit 5a4363c

Please sign in to comment.