Skip to content

Don't parse lambda as UDA without parentheses#21009

Merged
thewilsonator merged 1 commit intodlang:masterfrom
pbackus:fix-uda-lambda-parsing
Mar 17, 2025
Merged

Don't parse lambda as UDA without parentheses#21009
thewilsonator merged 1 commit intodlang:masterfrom
pbackus:fix-uda-lambda-parsing

Conversation

@pbackus
Copy link
Copy Markdown
Contributor

@pbackus pbackus commented Mar 16, 2025

This brings the compiler's behavior in line with the language spec.

Fixes dlang/dlang.org#4137

@dlang-bot
Copy link
Copy Markdown
Contributor

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: and Returns:)

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

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

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#21009"

@zero-vector
Copy link
Copy Markdown

I created a dmd issue for this, maybe we can link it?
#21007

@thewilsonator thewilsonator linked an issue Mar 16, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

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

please add the test case from #21007

This brings the compiler's behavior in line with the language spec.

Fixes dlang/dlang.org#4137
@pbackus pbackus force-pushed the fix-uda-lambda-parsing branch from 5e9f375 to 0310958 Compare March 16, 2025 22:48
@pbackus
Copy link
Copy Markdown
Contributor Author

pbackus commented Mar 16, 2025

Oops; forgot to git add the tests. Thanks for the save!

@thewilsonator thewilsonator merged commit 7c95446 into dlang:master Mar 17, 2025
42 checks passed
@andrey-zherikov
Copy link
Copy Markdown
Contributor

oh, nice that it's finally fixed!👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lambda as UDA clashes with Shortened Function Definition Lambda as UDA is valid but spec requires brackets

5 participants