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

Adjust objectPattern to allow Function() #3496

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented Dec 6, 2023

See dart-lang/sdk#54246 where @modulovalue raised this issue.

This PR changes the syntax of <objectPattern> such that it allows Function to be the denotation of a type (for example: Function(: var toString)).

The analyzer and the common front end already implement this behavior, hence there's no implementation effort.

Copy link
Member

@munificent munificent left a comment

Choose a reason for hiding this comment

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

Thanks!

@eernstg
Copy link
Member Author

eernstg commented Dec 8, 2023

Thanks!

@lrhn, you'd prefer to keep the specification unchanged, run a breaking change process, and remove the support for Function() as an object pattern from implementations?

@lrhn
Copy link
Member

lrhn commented Dec 8, 2023

I would. I expect it to not break any existing code, because nobody will have used it.

If I'm much wrong about that, we should perhaps reconsider.

@eernstg
Copy link
Member Author

eernstg commented Dec 13, 2023

We discussed this at the language meeting today and decided to keep the currently implemented behavior (which means that we do adopt the specification change which is performed by this PR).

@eernstg eernstg merged commit 06800d6 into main Dec 13, 2023
3 checks passed
@eernstg eernstg deleted the spec_Function_pattern_3468_dec23 branch December 13, 2023 16:55
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.

3 participants