@@ -624,6 +624,8 @@ mixin _MemberBodyBuilderContext<T extends SourceMemberBuilder>
624624 implements BodyBuilderContext {
625625 T get _member;
626626
627+ Member get _builtMember;
628+
627629 @override
628630 AugmentSuperTarget ? get augmentSuperTarget {
629631 if (_member.isAugmentation) {
@@ -633,20 +635,23 @@ mixin _MemberBodyBuilderContext<T extends SourceMemberBuilder>
633635 }
634636
635637 @override
636- void registerSuperCall () {
637- _member.member.transformerFlags | = TransformerFlag .superCalls;
638- }
638+ int get memberCharOffset => _member.charOffset;
639639
640640 @override
641- int get memberCharOffset => _member.charOffset;
641+ void registerSuperCall () {
642+ _builtMember.transformerFlags | = TransformerFlag .superCalls;
643+ }
642644}
643645
644646class FieldBodyBuilderContext extends BodyBuilderContext
645647 with _MemberBodyBuilderContext <SourceFieldBuilder > {
646648 @override
647649 SourceFieldBuilder _member;
648650
649- FieldBodyBuilderContext (this ._member,
651+ @override
652+ final Member _builtMember;
653+
654+ FieldBodyBuilderContext (this ._member, this ._builtMember,
650655 {required bool inOutlineBuildingPhase,
651656 required bool inMetadata,
652657 required bool inConstFields})
@@ -780,7 +785,10 @@ class ProcedureBodyBuilderContext extends BodyBuilderContext
780785 @override
781786 final SourceProcedureBuilder _member;
782787
783- ProcedureBodyBuilderContext (this ._member,
788+ @override
789+ final Member _builtMember;
790+
791+ ProcedureBodyBuilderContext (this ._member, this ._builtMember,
784792 {required bool inOutlineBuildingPhase,
785793 required bool inMetadata,
786794 required bool inConstFields})
@@ -799,6 +807,8 @@ mixin _ConstructorBodyBuilderContextMixin<T extends ConstructorDeclaration>
799807 implements BodyBuilderContext {
800808 T get _member;
801809
810+ TreeNode get _initializerParent;
811+
802812 @override
803813 DartType substituteFieldType (DartType fieldType) {
804814 return _member.substituteFieldType (fieldType);
@@ -818,7 +828,7 @@ mixin _ConstructorBodyBuilderContextMixin<T extends ConstructorDeclaration>
818828 void addInitializer (Initializer initializer, ExpressionGeneratorHelper helper,
819829 {required InitializerInferenceResult ? inferenceResult}) {
820830 _member.addInitializer (initializer, helper,
821- inferenceResult: inferenceResult);
831+ inferenceResult: inferenceResult, parent : _initializerParent );
822832 }
823833
824834 @override
@@ -859,7 +869,10 @@ class ConstructorBodyBuilderContext extends BodyBuilderContext
859869 @override
860870 final DeclaredSourceConstructorBuilder _member;
861871
862- ConstructorBodyBuilderContext (this ._member,
872+ @override
873+ final Member _builtMember;
874+
875+ ConstructorBodyBuilderContext (this ._member, this ._builtMember,
863876 {required bool inOutlineBuildingPhase,
864877 required bool inMetadata,
865878 required bool inConstFields})
@@ -883,6 +896,9 @@ class ConstructorBodyBuilderContext extends BodyBuilderContext
883896 @override
884897 // Coverage-ignore(suite): Not run.
885898 bool get hasFormalParameters => true ;
899+
900+ @override
901+ TreeNode get _initializerParent => _member.invokeTarget;
886902}
887903
888904class ExtensionTypeConstructorBodyBuilderContext extends BodyBuilderContext
@@ -893,8 +909,10 @@ class ExtensionTypeConstructorBodyBuilderContext extends BodyBuilderContext
893909 _MemberBodyBuilderContext <SourceExtensionTypeConstructorBuilder > {
894910 @override
895911 final SourceExtensionTypeConstructorBuilder _member;
912+ @override
913+ final Member _builtMember;
896914
897- ExtensionTypeConstructorBodyBuilderContext (this ._member,
915+ ExtensionTypeConstructorBodyBuilderContext (this ._member, this ._builtMember,
898916 {required bool inOutlineBuildingPhase,
899917 required bool inMetadata,
900918 required bool inConstFields})
@@ -912,6 +930,9 @@ class ExtensionTypeConstructorBodyBuilderContext extends BodyBuilderContext
912930 @override
913931 // Coverage-ignore(suite): Not run.
914932 bool get hasFormalParameters => true ;
933+
934+ @override
935+ TreeNode get _initializerParent => _member.invokeTarget;
915936}
916937
917938class FactoryBodyBuilderContext extends BodyBuilderContext
@@ -921,7 +942,10 @@ class FactoryBodyBuilderContext extends BodyBuilderContext
921942 @override
922943 final SourceFactoryBuilder _member;
923944
924- FactoryBodyBuilderContext (this ._member,
945+ @override
946+ final Member _builtMember;
947+
948+ FactoryBodyBuilderContext (this ._member, this ._builtMember,
925949 {required bool inOutlineBuildingPhase,
926950 required bool inMetadata,
927951 required bool inConstFields})
@@ -953,7 +977,10 @@ class RedirectingFactoryBodyBuilderContext extends BodyBuilderContext
953977 @override
954978 final RedirectingFactoryBuilder _member;
955979
956- RedirectingFactoryBodyBuilderContext (this ._member,
980+ @override
981+ final Member _builtMember;
982+
983+ RedirectingFactoryBodyBuilderContext (this ._member, this ._builtMember,
957984 {required bool inOutlineBuildingPhase,
958985 required bool inMetadata,
959986 required bool inConstFields})
@@ -1016,8 +1043,11 @@ class ExpressionCompilerProcedureBodyBuildContext extends BodyBuilderContext
10161043 @override
10171044 final SourceProcedureBuilder _member;
10181045
1046+ @override
1047+ final Member _builtMember;
1048+
10191049 ExpressionCompilerProcedureBodyBuildContext (
1020- DietListener listener, this ._member,
1050+ DietListener listener, this ._member, this ._builtMember,
10211051 {required bool isDeclarationInstanceMember,
10221052 required bool inOutlineBuildingPhase,
10231053 required bool inMetadata,
0 commit comments