-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Reviewed-by: Ömer Ağacan <[email protected]> Reviewed-by: Alexander Markov <[email protected]>
- Loading branch information
Showing
7 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters