Files
sdk/pkg/vm
Nate Biggs 1e8ea8a7da Wrap field initializers copied by TFA in a FileUriExpression.
Before TFA runs, MixinFullResolution will clone a mixin's fields into the application classes for that mixin. The cloned Field on the application class will have a fileUri that refers to the original mixin file.

However, TFA then copies those fields into FieldInitializers which don't have a fileUri context and so the fileUri for the surrounding Constructor is used. This leaves expressions in the initializer with offsets relative to the mixin's file but in the context of the mixin application's file.

To fix this, we can wrap the initializer in a FileUriExpression referring to the original mixin class. We only do this if the field the initializer is copied from refers to a different file than the target constructor.

Also add handlers for FileUriExpressions to several visitors that don't already support this new AST node.

Change-Id: I47b0d48dfe87303949130a40216b199949cfa1d9
Tested: Existing test suite.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360420
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-04-02 19:55:19 +00:00
..

This package hosts VM specific Dart code and helper scripts.