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

[CP] Add ExtensionTypeRepresentationFieldInitializer.replaceChild #55194

Closed
chloestefantsova opened this issue Mar 14, 2024 · 1 comment
Closed
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. cherry-pick-review Issue that need cherry pick triage to approve merge-to-stable

Comments

@chloestefantsova
Copy link
Contributor

Commit(s) to merge

ef6d68c

Target

stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/357600

Issue Description

Invocations of redirecting factories weren't resolved to their final targets in initializers of extension type constructors. The issue affects the web platforms, but not the VM. The VM performs the resolution of redirecting factory targets via a different mechanism. The compiler on the web platforms crashes when it tries to compile a file containing an extension type declaration with an extension type constructor that has an invocation of a redirecting factory in its initializer.

What is the fix

The bug occurs due to the method replaceChild being empty in the internal AST node representing the initializer of an extension type constructor. The replaceChild method is used to substitute the invocation of the immediate redirecting factory target with the invocation of the final target. The CL with the fix gives a meaningful implementation of replaceChild to that internal AST node.

Why cherry-pick

The issue affects every program on web platforms that contains an extension type declaration where the extension type constructor invokes a redirecting factory in its initializer. Such programs make the compiler on the platforms crash.

Risk

low

Issue link(s)

#55135

Extra Info

No response

@chloestefantsova chloestefantsova added the cherry-pick-review Issue that need cherry pick triage to approve label Mar 14, 2024
@sigmundch sigmundch added the area-front-end Use area-front-end for front end / CFE / kernel format related issues. label Mar 14, 2024
@sigmundch
Copy link
Member

I'm generally in favor of this cherry-pick. The fix is pretty contained and low risk, and we've seen at least two reports of this issue from external customers as well.

@itsjustkevin itsjustkevin added cherry-pick-approved Label for approved cherrypick request merge-to-stable labels Mar 19, 2024
copybara-service bot pushed a commit that referenced this issue Mar 19, 2024
…Child

The added method is required for the resolution of redirection targets
to work: it replaces the immediate target invocation node with the
final target invocation node.

Closes #55135

Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/357161
Cherry-pick-request: #55194
Change-Id: I96643c5af0ca91209cd936aee78f13c416679275
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357600
Commit-Queue: Chloe Stefantsova <[email protected]>
Reviewed-by: Johnni Winther <[email protected]>
@itsjustkevin itsjustkevin added the cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. cherry-pick-review Issue that need cherry pick triage to approve merge-to-stable
Projects
None yet
Development

No branches or pull requests

7 participants