[CP] Add ExtensionTypeRepresentationFieldInitializer.replaceChild #55194
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
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. ThereplaceChild
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 ofreplaceChild
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
The text was updated successfully, but these errors were encountered: