Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 14846 - Insufficient context deduction with implicit nested lambda #4848

Merged
merged 1 commit into from Aug 7, 2015

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Jul 29, 2015

@@ -51,6 +51,8 @@ bool checkFrameAccess(Loc loc, Scope *sc, AggregateDeclaration *ad, size_t iStar
{
if (!fd->isThis() && !fd->isNested())
break;
if (FuncLiteralDeclaration *fld = fd->isFuncLiteralDeclaration())
fld->tok = TOKdelegate;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkFrameAccess is supposed to be a pure function, merely checking things. But here it is now modifying global state. There's got to be a better way. I do note that checkNestedReference does it, too, so there's an excuse for it. I hope that when we switch to ddmd, we can migrate to a better design.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, the problem is in the function name - checkSomething VS checkAndFixSomething.

@WalterBright
Copy link
Member

Auto-merge toggled on

WalterBright added a commit that referenced this pull request Aug 7, 2015
Issue 14846 - Insufficient context deduction with implicit nested lambda
@WalterBright WalterBright merged commit 9538fe5 into dlang:master Aug 7, 2015
@9rnsr
Copy link
Contributor Author

9rnsr commented Aug 7, 2015

Thanks.

@9rnsr 9rnsr deleted the fix14846 branch August 7, 2015 13:54
9rnsr pushed a commit to 9rnsr/dmd that referenced this pull request Aug 8, 2015
Issue 14846 - Insufficient context deduction with implicit nested lambda
9rnsr pushed a commit to 9rnsr/dmd that referenced this pull request Aug 10, 2015
Issue 14846 - Insufficient context deduction with implicit nested lambda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants