Skip to content

Add -preview=shortenedMethods to language spec#2956

Merged
dlang-bot merged 2 commits intodlang:masterfrom
pbackus:shortened-methods-spec
Feb 27, 2021
Merged

Add -preview=shortenedMethods to language spec#2956
dlang-bot merged 2 commits intodlang:masterfrom
pbackus:shortened-methods-spec

Conversation

@pbackus
Copy link
Contributor

@pbackus pbackus commented Feb 26, 2021

@dlang-bot
Copy link
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.

@adamdruppe
Copy link
Contributor

Thank you for taking action!

$(GLINK FunctionContracts)$(OPT) $(GLINK InOutStatement)

$(GNAME ShortenedFunctionBody):
$(D =>) $(GLINK AssignExpression) $(D ;)
Copy link
Member

Choose a reason for hiding this comment

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

The parser accepts the fully Expression rather than AssignExpression, so one of them is wrong/(needs changing).

This could also use an example as well (just a cleaned up testcase would be fine)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an example.

Re: Expression vs AssignExpression, AssignExpression is what's used in the grammar for lambdas, which this is supposed to match. And the only other thing included in Expression is CommaExpression, which would be rejected by semantic analysis anyway. So I think it's the parser that's wrong here.

@dlang-bot dlang-bot merged commit 50994c1 into dlang:master Feb 27, 2021
@CyberShadow
Copy link
Member

@pbackus Currently https://github.com/dlang/dmd/blob/master/test/compilable/shortened_methods.d#L9 doesn't parse with the official grammar, would you be willing to have another look at this?

@CyberShadow
Copy link
Member

Added 403bdbc to #3021.

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.

5 participants

Comments