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

fix Issue 14162 - Erratic inference of @safe for lambdas #5881

Merged
merged 1 commit into from
Jun 28, 2016

Conversation

WalterBright
Copy link
Member

Inference of safety for lambdas should always occur if not explicitly set, because the source is always available.

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
14162 Erratic inference of @safe for lambdas

@@ -1276,7 +1261,8 @@ extern (C++) class FuncDeclaration : Declaration
*/
TemplateInstance ti;
if (fbody &&
(isFuncLiteralDeclaration() || (storage_class & STCinference) || (inferRetType && !isCtorDeclaration()) || isInstantiated() && !isVirtualMethod() &&
(sc.func || isFuncLiteralDeclaration() || (storage_class & STCinference) || (inferRetType && !isCtorDeclaration()) ||
Copy link
Member Author

Choose a reason for hiding this comment

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

Added sc.func here, because nested functions with bodies should have their attributes inferred unless overridden.

@WalterBright WalterBright force-pushed the fix14162 branch 16 times, most recently from b324d31 to b4e0260 Compare June 24, 2016 03:34
@WalterBright
Copy link
Member Author

Probably the most over-tested feature ever.

@WalterBright WalterBright force-pushed the fix14162 branch 2 times, most recently from 0dcdd65 to 7e7d4c3 Compare June 24, 2016 03:47
@WalterBright
Copy link
Member Author

WalterBright commented Jun 24, 2016

Blocked by dlang/phobos#4461 and dlang/phobos#4464

@andralex
Copy link
Member

Auto-merge toggled on

@WalterBright
Copy link
Member Author

Blocked by dlang/phobos#4474

@PetarKirov
Copy link
Member

On Windows the tests fail for a different reason, btw: https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=2097110&isPull=true

@WalterBright
Copy link
Member Author

Blocked by dlang/phobos#4477

@WalterBright
Copy link
Member Author

Blocked by dlang/phobos#4479

@WalterBright
Copy link
Member Author

Blocked by dlang/phobos#4483

@WalterBright
Copy link
Member Author

Blocked by dlang/phobos#4485

@andralex andralex merged commit 1116591 into dlang:master Jun 28, 2016
@WalterBright WalterBright deleted the fix14162 branch June 29, 2016 02:18
@pbackus
Copy link
Contributor

pbackus commented Mar 15, 2021

This introduced a regression.

https://issues.dlang.org/show_bug.cgi?id=21719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants