dmd
dmd copied to clipboard
Fix issue 21243 - Allow lambdas to return auto ref
Spec PR: https://github.com/dlang/dlang.org/pull/3410
Thanks for your pull request and interest in making D better, @pbackus! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:
- My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
- My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
- I have provided a detailed rationale explaining my changes
- New or modified functions have Ddoc comments (with
Params:andReturns:)
Please see CONTRIBUTING.md for more information.
If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.
Bugzilla references
| Auto-close | Bugzilla | Severity | Description |
|---|---|---|---|
| ✓ | 21243 | enhancement | Allow lambdas to return auto ref |
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#14454"
coverage diff is not 100%, please add a test to fix that.
@SixthDot Because of the way the calling code uses lookahead, the line in question (error message under case TOK.auto_: in parseFunctionLiteral) is currently unreachable. I left it in as a defensive measure, so that parseFunctionLiteral will behave sensibly even if the calling code changes. If reviewers prefer, I can change the line to an assert(0); instead of an error message.
Auto-tester failure is a segfault in this static destructor that occurs non-deterministically when running std.concurrency's test suite. Probably a race between the main thread writing to the __gshared variable scheduler and test threads reading from it in their static destructors. Almost certainly unrelated to this PR.
Is this, https://github.com/dlang/phobos/pull/8579, the fix you to that race conditions?
@ljmf00 Yes.
Force-pushed to re-run now that the race condition has (hopefully) been fixed.
Buildkite is having availability issues; force-pushed to re-run again.