Skip to content

[extension types] Specify promotion of representation variables #3411

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

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented Oct 18, 2023

This PR specifies how promotion of the representation variable of an extension type proceeds: It is applicable to any representation variable whose name is private, and it does not interfere with promotion of private class instance variables, or vice versa.

See this comment.

@eernstg eernstg merged commit 80ae9fc into main Oct 18, 2023
@eernstg eernstg deleted the spec_promotion_extension_type_oct23 branch October 18, 2023 14:00
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Oct 27, 2023
…able.

Update the type inference algorithm so that `FlowAnalysis.propertyGet`
is appropriately called when analyzing code that refers to the
representation variable of an extension type.

Flow analysis requires an arbitrary `Object` to represent the property
in question; this is later passed to
`OperationsCfe.isPropertyPromotable`. We use the synthetic
"representation field" (which is actually a `Procedure`) for this
purpose
(`ExtensionTypeRepresentationAccessTarget.representationField`).

Representation variables are considered promotable if they are public
(see
dart-lang/language#3411). `OperationsCfe.isPropertyPromotable`
can tell if the representation variable is public by checking the name
of the synthetic representation field.

Fixes #53439.

Bug: #53439
Change-Id: I8f7ff8fcd8e5a43de419b8441951b52a555fda1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332480
Commit-Queue: Paul Berry <[email protected]>
Reviewed-by: Chloe Stefantsova <[email protected]>
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.

2 participants