Skip to content

Commit

Permalink
fix Issue 13481 - bug with inferring attributes from built-in properties
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Sep 17, 2014
1 parent 9bbe770 commit 1ac9063
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/expression.c
Expand Up @@ -5290,11 +5290,17 @@ Expression *FuncExp::syntaxCopy()
fd2 = (*td2->members)[0]->isFuncLiteralDeclaration();
assert(fd2);
}
else
else if (fd->semanticRun == PASSinit)
{
td2 = NULL;
fd2 = (FuncLiteralDeclaration *)fd->syntaxCopy(NULL);
}
else
{
// Bugzilla 13481: Prevent multiple semantic analysis of lambda body.
td2 = NULL;
fd2 = fd;
}
return new FuncExp(loc, fd2, td2);
}

Expand Down
16 changes: 16 additions & 0 deletions test/compilable/compile1.d
Expand Up @@ -708,3 +708,19 @@ final class C12703
{
S12703 s = S12703(1);
}

/***************************************************/
// 13481

mixin template Mix13481(void function() callback)
{
static this()
{
callback();
}
}

void sort13481() { int[] arr; arr.sort; }
mixin Mix13481!(&sort13481);

mixin Mix13481!({ int[] arr; arr.sort; });

0 comments on commit 1ac9063

Please sign in to comment.