Version 3.10.0-188.0.dev Merge 7ade20d947139a08c34dfaff5d06a3f00da2512f into dev
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart index fa8513c..46190cd 100644 --- a/pkg/analyzer/lib/src/dart/analysis/driver.dart +++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -106,7 +106,7 @@ // TODO(scheglov): Clean up the list of implicitly analyzed files. class AnalysisDriver { /// The version of data format, should be incremented on every format change. - static const int DATA_VERSION = 547; + static const int DATA_VERSION = 548; /// The number of exception contexts allowed to write. Once this field is /// zero, we stop writing any new exception contexts in this process.
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart index ffd6610..9700ca8 100644 --- a/pkg/analyzer/lib/src/dart/element/element.dart +++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -443,6 +443,10 @@ previous.addFragment(current); return current; }); + TypeParameterFragmentImpl._linkFragments( + fragments, + getFragments: (f) => f.typeParameters, + ); } @override @@ -1015,12 +1019,6 @@ _applyResolutionConstantOffsets = callback; } - void withoutLoadingResolution(void Function() operation) { - _lockResolutionLoading++; - operation(); - _lockResolutionLoading--; - } - void _ensureReadResolution() { if (_lockResolutionLoading > 0) { return; @@ -1037,6 +1035,12 @@ } } } + + static void withoutLoadingResolution(void Function() operation) { + _lockResolutionLoading++; + operation(); + _lockResolutionLoading--; + } } class DirectiveUriImpl implements DirectiveUri {} @@ -2742,9 +2746,11 @@ } } +@elementClass class FieldElementImpl extends PropertyInducingElementImpl with InternalFieldElement { @override + @trackedIncludedInId final Reference reference; @override @@ -2759,33 +2765,36 @@ } @override + @trackedIncludedInId FieldElementImpl get baseElement => this; @override + @trackedIncludedInId InstanceElementImpl get enclosingElement { return _firstFragment.enclosingFragment.element; } @Deprecated('Use enclosingElement instead') @override + @trackedIndirectly InstanceElement get enclosingElement2 => enclosingElement; @override - FieldFragmentImpl get firstFragment => _firstFragment; - - @override - List<FieldFragmentImpl> get fragments { - return [ - for ( - FieldFragmentImpl? fragment = _firstFragment; - fragment != null; - fragment = fragment.nextFragment - ) - fragment, - ]; + @trackedDirectlyOpaque + FieldFragmentImpl get firstFragment { + globalResultRequirements?.recordOpaqueApiUse(this, 'firstFragment'); + return _firstFragment; } @override + @trackedDirectlyOpaque + List<FieldFragmentImpl> get fragments { + globalResultRequirements?.recordOpaqueApiUse(this, 'fragments'); + return _fragments; + } + + @override + @trackedDirectly GetterElementImpl? get getter { globalResultRequirements?.record_fieldElement_getter( element: this, @@ -2798,45 +2807,58 @@ /// Whether the type of this fragment references a type parameter of the /// enclosing element. This includes not only explicitly specified type /// annotations, but also inferred types. + @trackedIncludedInId bool get hasEnclosingTypeParameterReference { return _firstFragment.hasEnclosingTypeParameterReference; } @override + @trackedIncludedInId bool get hasImplicitType => _firstFragment.hasImplicitType; @override + @trackedIncludedInId bool get isAbstract => _firstFragment.isAbstract; @override + @trackedIncludedInId bool get isConst => _firstFragment.isConst; @override + @trackedIncludedInId bool get isCovariant => _firstFragment.isExplicitlyCovariant; @override + @trackedIncludedInId bool get isEnumConstant => _firstFragment.isEnumConstant; + @trackedIndirectly bool get isEnumValues { return enclosingElement is EnumElementImpl && name == 'values'; } @override + @trackedIncludedInId bool get isExternal => _firstFragment.isExternal; @override + @trackedIncludedInId bool get isFinal => _firstFragment.isFinal; @override + @trackedIncludedInId bool get isLate => _firstFragment.isLate; @override + @trackedIncludedInId bool get isPromotable => _firstFragment.isPromotable; @override + @trackedIncludedInId bool get isStatic => _firstFragment.isStatic; @override + @trackedIncludedInId bool get isSynthetic => _firstFragment.isSynthetic; /// Return `true` if this element is a synthetic enum field. @@ -2846,6 +2868,7 @@ /// synthetic. /// /// Such fields are `index`, `_name`, and `values`. + @trackedIndirectly bool get isSyntheticEnumField { return enclosingElement is EnumElementImpl && isSynthetic && @@ -2854,9 +2877,13 @@ } @override + @trackedIncludedInId ElementKind get kind => ElementKind.FIELD; + @trackedDirectlyOpaque FieldFragmentImpl get lastFragment { + globalResultRequirements?.recordOpaqueApiUse(this, 'lastFragment'); + var result = _firstFragment; while (true) { if (result.nextFragment case var nextFragment?) { @@ -2869,12 +2896,14 @@ @Deprecated('Use library instead') @override + @trackedIndirectly LibraryElementImpl get library2 => library; @override + @trackedIncludedInId MetadataImpl get metadata { var annotations = <ElementAnnotationImpl>[]; - for (var fragment in fragments) { + for (var fragment in _fragments) { annotations.addAll(fragment.metadata.annotations); } return MetadataImpl(annotations); @@ -2882,16 +2911,20 @@ @Deprecated('Use metadata instead') @override + @trackedIndirectly MetadataImpl get metadata2 => metadata; @override + @trackedIncludedInId String? get name => _firstFragment.name; @Deprecated('Use name instead') @override + @trackedIndirectly String? get name3 => name; @override + @trackedDirectly SetterElementImpl? get setter { globalResultRequirements?.record_fieldElement_setter( element: this, @@ -2902,17 +2935,30 @@ } @override - List<FieldFragmentImpl> get _fragments => fragments; + List<FieldFragmentImpl> get _fragments { + return [ + for ( + FieldFragmentImpl? fragment = _firstFragment; + fragment != null; + fragment = fragment.nextFragment + ) + fragment, + ]; + } @override + @trackedDirectlyOpaque T? accept<T>(ElementVisitor2<T> visitor) { + globalResultRequirements?.recordOpaqueApiUse(this, 'accept'); return visitor.visitFieldElement(this); } @Deprecated('Use accept instead') @override + @trackedIndirectly T? accept2<T>(ElementVisitor2<T> visitor) => accept(visitor); + @trackedInternal void linkFragments(List<FieldFragmentImpl> fragments) { assert(identical(fragments[0], _firstFragment)); fragments.reduce((previous, current) { @@ -3139,14 +3185,7 @@ @override List<FormalParameterFragmentImpl> get fragments { - return [ - for ( - FormalParameterFragmentImpl? fragment = _firstFragment; - fragment != null; - fragment = fragment.nextFragment - ) - fragment, - ]; + return _fragments; } @override @@ -3272,6 +3311,18 @@ TypeImpl get typeShared => type; @override + List<FormalParameterFragmentImpl> get _fragments { + return [ + for ( + FormalParameterFragmentImpl? fragment = _firstFragment; + fragment != null; + fragment = fragment.nextFragment + ) + fragment, + ]; + } + + @override T? accept<T>(ElementVisitor2<T> visitor) { return visitor.visitFormalParameterElement(this); } @@ -3957,9 +4008,11 @@ List<TypeParameterFragmentImpl> get typeParameters2 => typeParameters; } +@elementClass class GetterElementImpl extends PropertyAccessorElementImpl with InternalGetterElement { @override + @trackedIncludedInId Reference reference; @override @@ -3975,21 +4028,28 @@ } @override + @trackedIncludedInId GetterElementImpl get baseElement => this; @override + @trackedIndirectly SetterElement? get correspondingSetter { return variable.setter; } @Deprecated('Use correspondingSetter instead') @override + @trackedIndirectly SetterElement? get correspondingSetter2 { return correspondingSetter; } @override - GetterFragmentImpl get firstFragment => _firstFragment; + @trackedDirectlyOpaque + GetterFragmentImpl get firstFragment { + globalResultRequirements?.recordOpaqueApiUse(this, 'firstFragment'); + return _firstFragment; + } @override @trackedDirectlyOpaque @@ -3999,14 +4059,18 @@ } @override + @trackedIncludedInId ElementKind get kind => ElementKind.GETTER; @override + @trackedDirectlyOpaque GetterFragmentImpl get lastFragment { + globalResultRequirements?.recordOpaqueApiUse(this, 'lastFragment'); return super.lastFragment as GetterFragmentImpl; } @override + @trackedIndirectly Element get nonSynthetic { if (isSynthetic) { return variable.nonSynthetic; @@ -4016,6 +4080,7 @@ } @override + @trackedIndirectly Version? get sinceSdkVersion { if (isSynthetic) { return variable.sinceSdkVersion; @@ -4036,19 +4101,24 @@ } @override + @trackedDirectlyOpaque T? accept<T>(ElementVisitor2<T> visitor) { + globalResultRequirements?.recordOpaqueApiUse(this, 'accept'); return visitor.visitGetterElement(this); } @Deprecated('Use accept instead') @override + @trackedIndirectly T? accept2<T>(ElementVisitor2<T> visitor) => accept(visitor); @override + @trackedIndirectly void appendTo(ElementDisplayStringBuilder builder) { builder.writeGetterElement(this); } + @trackedInternal void linkFragments(List<GetterFragmentImpl> fragments) { assert(identical(fragments[0], _firstFragment)); fragments.reduce((previous, current) { @@ -7242,6 +7312,11 @@ String? get name3 => name; @override + List<LocalVariableFragmentImpl> get _fragments { + return [_firstFragment]; + } + + @override T? accept<T>(ElementVisitor2<T> visitor) { return visitor.visitLocalVariableElement(this); } @@ -7841,6 +7916,10 @@ previous.addFragment(current); return current; }); + TypeParameterFragmentImpl._linkFragments( + fragments, + getFragments: (f) => f.typeParameters, + ); } } @@ -7904,6 +7983,11 @@ fragment.previousFragment = this; nextFragment = fragment; } + + void addTypeParameter(TypeParameterFragmentImpl typeParameter) { + _typeParameters.add(typeParameter); + typeParameter.enclosingFragment = this; + } } @elementClass @@ -8036,6 +8120,10 @@ previous.addFragment(current); return current; }); + TypeParameterFragmentImpl._linkFragments( + fragments, + getFragments: (f) => f.typeParameters, + ); } } @@ -8888,18 +8976,22 @@ abstract class PromotableElementImpl extends VariableElementImpl {} +@elementClass abstract class PropertyAccessorElementImpl extends ExecutableElementImpl with InternalPropertyAccessorElement { PropertyInducingElementImpl? _variable3; @override + @trackedIncludedInId PropertyAccessorElementImpl get baseElement => this; @override + @trackedIncludedInId Element get enclosingElement => _firstFragment.enclosingFragment.element; @Deprecated('Use enclosingElement instead') @override + @trackedIndirectly Element get enclosingElement2 => enclosingElement; @override @@ -8909,15 +9001,19 @@ List<PropertyAccessorFragmentImpl> get fragments; @override + @trackedDirectlyOpaque PropertyAccessorFragmentImpl get lastFragment { + globalResultRequirements?.recordOpaqueApiUse(this, 'lastFragment'); return super.lastFragment as PropertyAccessorFragmentImpl; } @override + @trackedIncludedInId String? get name => _firstFragment.name; @Deprecated('Use name instead') @override + @trackedIndirectly String? get name3 => name; @override @@ -8940,7 +9036,7 @@ @Deprecated('Use variable instead') @override - @trackedDirectly + @trackedIndirectly PropertyInducingElementImpl? get variable3 { return variable; } @@ -8994,12 +9090,15 @@ } } +@elementClass abstract class PropertyInducingElementImpl extends VariableElementImpl with InternalPropertyInducingElement, DeferredResolutionReadingMixin { @override + @trackedInternal GetterElementImpl? getter; @override + @trackedInternal SetterElementImpl? setter; TypeImpl? _type; @@ -9012,30 +9111,29 @@ PropertyInducingFragmentImpl get firstFragment; @override + @trackedDirectlyOpaque List<PropertyInducingFragmentImpl> get fragments { - return [ - for ( - PropertyInducingFragmentImpl? fragment = _firstFragment; - fragment != null; - fragment = fragment.nextFragment - ) - fragment, - ]; + globalResultRequirements?.recordOpaqueApiUse(this, 'fragments'); + return _fragments; } @Deprecated('Use getter instead') @override + @trackedIndirectly GetterElementImpl? get getter2 => getter; @override + @trackedIncludedInId bool get hasInitializer { return _fragments.any((f) => f.hasInitializer); } @override + @trackedIncludedInId LibraryElementImpl get library => super.library!; @override + @trackedIndirectly Element get nonSynthetic { if (isSynthetic) { if (enclosingElement case EnumElementImpl enclosingElement) { @@ -9055,8 +9153,10 @@ @Deprecated('Use setter instead') @override + @trackedIndirectly SetterElementImpl? get setter2 => setter; + @trackedIncludedInId bool get shouldUseTypeForInitializerInference { return hasModifier(Modifier.SHOULD_USE_TYPE_FOR_INITIALIZER_INFERENCE); } @@ -9066,6 +9166,7 @@ } @override + @trackedIncludedInId TypeImpl get type { _ensureReadResolution(); if (_type case var type?) { @@ -9102,9 +9203,11 @@ @override PropertyInducingFragmentImpl get _firstFragment; + @override List<PropertyInducingFragmentImpl> get _fragments; @override + @trackedIndirectly void appendTo(ElementDisplayStringBuilder builder) { builder.writeVariableElement(this); } @@ -9177,9 +9280,11 @@ MetadataImpl get metadata2 => metadata; } +@elementClass class SetterElementImpl extends PropertyAccessorElementImpl with InternalSetterElement { @override + @trackedIncludedInId Reference reference; @override @@ -9195,28 +9300,37 @@ } @override + @trackedIncludedInId SetterElementImpl get baseElement => this; @override + @trackedIndirectly GetterElement? get correspondingGetter { return variable.getter; } @Deprecated('Use correspondingGetter instead') @override + @trackedIndirectly GetterElement? get correspondingGetter2 { return correspondingGetter; } @override + @trackedIncludedInId Element get enclosingElement => _firstFragment.enclosingFragment.element; @Deprecated('Use enclosingElement instead') @override + @trackedIndirectly Element get enclosingElement2 => enclosingElement; @override - SetterFragmentImpl get firstFragment => _firstFragment; + @trackedDirectlyOpaque + SetterFragmentImpl get firstFragment { + globalResultRequirements?.recordOpaqueApiUse(this, 'firstFragment'); + return _firstFragment; + } @override @trackedDirectlyOpaque @@ -9226,14 +9340,18 @@ } @override + @trackedIncludedInId ElementKind get kind => ElementKind.SETTER; @override + @trackedDirectlyOpaque SetterFragmentImpl get lastFragment { + globalResultRequirements?.recordOpaqueApiUse(this, 'lastFragment'); return super.lastFragment as SetterFragmentImpl; } @override + @trackedIndirectly String? get lookupName { if (name case var name?) { return '$name='; @@ -9242,6 +9360,7 @@ } @override + @trackedIndirectly Element get nonSynthetic { if (isSynthetic) { return variable.nonSynthetic; @@ -9251,6 +9370,7 @@ } @override + @trackedIndirectly Version? get sinceSdkVersion { if (isSynthetic) { return variable.sinceSdkVersion; @@ -9258,6 +9378,7 @@ return super.sinceSdkVersion; } + @trackedIncludedInId FormalParameterElementImpl get valueFormalParameter { return formalParameters.single; } @@ -9275,19 +9396,24 @@ } @override + @trackedDirectlyOpaque T? accept<T>(ElementVisitor2<T> visitor) { + globalResultRequirements?.recordOpaqueApiUse(this, 'accept'); return visitor.visitSetterElement(this); } @Deprecated('Use accept instead') @override + @trackedIndirectly T? accept2<T>(ElementVisitor2<T> visitor) => accept(visitor); @override + @trackedIndirectly void appendTo(ElementDisplayStringBuilder builder) { builder.writeSetterElement(this); } + @trackedInternal void linkFragments(List<SetterFragmentImpl> fragments) { assert(identical(fragments[0], _firstFragment)); fragments.reduce((previous, current) { @@ -9679,9 +9805,11 @@ } } +@elementClass class TopLevelVariableElementImpl extends PropertyInducingElementImpl implements TopLevelVariableElement { @override + @trackedIncludedInId final Reference reference; @override @@ -9693,20 +9821,97 @@ } @override + @trackedIncludedInId TopLevelVariableElementImpl get baseElement => this; @override + @trackedIncludedInId LibraryElementImpl get enclosingElement => library; @Deprecated('Use enclosingElement instead') @override + @trackedIndirectly LibraryElement get enclosingElement2 => enclosingElement; @override - TopLevelVariableFragmentImpl get firstFragment => _firstFragment; + @trackedDirectlyOpaque + TopLevelVariableFragmentImpl get firstFragment { + globalResultRequirements?.recordOpaqueApiUse(this, 'firstFragment'); + return _firstFragment; + } @override + @trackedDirectlyOpaque List<TopLevelVariableFragmentImpl> get fragments { + globalResultRequirements?.recordOpaqueApiUse(this, 'fragments'); + return _fragments; + } + + @override + @trackedIncludedInId + bool get hasImplicitType => _firstFragment.hasImplicitType; + + @override + @trackedIncludedInId + bool get isConst => _firstFragment.isConst; + + @override + @trackedIncludedInId + bool get isExternal => _firstFragment.isExternal; + + @override + @trackedIncludedInId + bool get isFinal => _firstFragment.isFinal; + + @override + @trackedIncludedInId + bool get isLate => _firstFragment.isLate; + + @override + @trackedIncludedInId + bool get isStatic => _firstFragment.isStatic; + + @override + @trackedIncludedInId + bool get isSynthetic { + return _firstFragment.isSynthetic; + } + + @override + @trackedIncludedInId + ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; + + @Deprecated('Use library instead') + @override + @trackedIndirectly + LibraryElement get library2 => library; + + @override + @trackedIncludedInId + MetadataImpl get metadata { + var annotations = <ElementAnnotationImpl>[]; + for (var fragment in _fragments) { + annotations.addAll(fragment.metadata.annotations); + } + return MetadataImpl(annotations); + } + + @Deprecated('Use metadata instead') + @override + @trackedIndirectly + MetadataImpl get metadata2 => metadata; + + @override + @trackedIncludedInId + String? get name => _firstFragment.name; + + @Deprecated('Use name instead') + @override + @trackedIndirectly + String? get name3 => name; + + @override + List<TopLevelVariableFragmentImpl> get _fragments { return [ for ( TopLevelVariableFragmentImpl? fragment = _firstFragment; @@ -9718,75 +9923,18 @@ } @override - bool get hasImplicitType => _firstFragment.hasImplicitType; - - @override - bool get isConst => _firstFragment.isConst; - - @override - bool get isExternal => _firstFragment.isExternal; - - @override - bool get isFinal => _firstFragment.isFinal; - - @override - bool get isLate => _firstFragment.isLate; - - @override - bool get isStatic => _firstFragment.isStatic; - - @override - bool get isSynthetic { - return _firstFragment.isSynthetic; - } - - @override - ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; - - @Deprecated('Use library instead') - @override - LibraryElement get library2 => library; - - @override - MetadataImpl get metadata { - var annotations = <ElementAnnotationImpl>[]; - for (var fragment in _fragments) { - annotations.addAll(fragment.metadata.annotations); - } - return MetadataImpl(annotations); - } - - @Deprecated('Use metadata instead') - @override - MetadataImpl get metadata2 => metadata; - - @override - String? get name => _firstFragment.name; - - @Deprecated('Use name instead') - @override - String? get name3 => name; - - @override - List<TopLevelVariableFragmentImpl> get _fragments { - var result = <TopLevelVariableFragmentImpl>[]; - TopLevelVariableFragmentImpl? current = _firstFragment; - while (current != null) { - result.add(current); - current = current.nextFragment; - } - return result; - } - - @override + @trackedDirectlyOpaque T? accept<T>(ElementVisitor2<T> visitor) { + globalResultRequirements?.recordOpaqueApiUse(this, 'accept'); return visitor.visitTopLevelVariableElement(this); } @Deprecated('Use accept instead') @override + @trackedIndirectly T? accept2<T>(ElementVisitor2<T> visitor) => accept(visitor); + @trackedInternal void linkFragments(List<TopLevelVariableFragmentImpl> fragments) { assert(identical(fragments[0], _firstFragment)); fragments.reduce((previous, current) { @@ -10474,8 +10622,26 @@ fragment.previousFragment = this; nextFragment = fragment; } + + static void _linkFragments<T extends FragmentImpl>( + List<T> fragments, { + required List<TypeParameterFragmentImpl> Function(T) getFragments, + }) { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { + var firstFragments = getFragments(fragments.first); + for (var i = 0; i < firstFragments.length; i++) { + // Side effect: set element for the fragment. + TypeParameterElementImpl(firstFragment: firstFragments[i]); + fragments.reduce((previous, current) { + getFragments(previous)[i].addFragment(getFragments(current)[i]); + return current; + }); + } + }); + } } +@elementClass abstract class VariableElementImpl extends ElementImpl with InternalVariableElement implements ConstantEvaluationTarget { @@ -10485,20 +10651,23 @@ /// /// Is `null` if [constantInitializer2] is `null`, or if the value could not /// be computed because of errors. + @trackedInternal Constant? evaluationResult; @override + @trackedIncludedInId ExpressionImpl? get constantInitializer { return constantInitializer2?.expression; } // TODO(scheglov): remove this + @trackedIncludedInId ConstantInitializerImpl? get constantInitializer2 { if (_constantInitializer case var result?) { return result; } - for (var fragment in fragments.reversed) { + for (var fragment in _fragments.reversed) { if (fragment.initializer case ExpressionImpl expression) { return _constantInitializer = ConstantInitializerImpl( fragment: fragment, @@ -10511,16 +10680,21 @@ } @override + @trackedInternal bool get isConstantEvaluated => evaluationResult != null; @override + @trackedIncludedInId LibraryFragmentImpl? get libraryFragment => _firstFragment.libraryFragment; set type(TypeImpl type) { // TODO(scheglov): eventually move logic from PropertyInducingElementImpl } + List<VariableFragmentImpl> get _fragments; + @override + @trackedIndirectly void appendTo(ElementDisplayStringBuilder builder) { builder.writeVariableElement(this); } @@ -10530,6 +10704,7 @@ /// this variable was not declared with the 'const' modifier or if the value /// of this variable could not be computed because of errors. @override + @trackedIndirectly DartObject? computeConstantValue() { if (evaluationResult == null) { var library = libraryFragment?.element; @@ -10551,12 +10726,15 @@ return null; } + @trackedInternal void resetConstantInitializer() { _constantInitializer = null; } @override + @trackedDirectlyOpaque void visitChildren<T>(ElementVisitor2<T> visitor) { + globalResultRequirements?.recordOpaqueApiUse(this, 'visitChildren'); for (var child in children) { child.accept(visitor); }
diff --git a/pkg/analyzer/lib/src/fine/manifest_item.dart b/pkg/analyzer/lib/src/fine/manifest_item.dart index a4e7f0d..8b67aa0 100644 --- a/pkg/analyzer/lib/src/fine/manifest_item.dart +++ b/pkg/analyzer/lib/src/fine/manifest_item.dart
@@ -570,18 +570,32 @@ } class FieldItem extends VariableItem<FieldElementImpl> { - final bool isStatic; + final bool hasEnclosingTypeParameterReference; + final bool isAbstract; + final bool isCovariant; + final bool isEnumConstant; + final bool isExternal; + final bool isPromotable; FieldItem({ required super.id, required super.isSynthetic, required super.metadata, + required super.hasInitializer, + required super.hasImplicitType, required super.isConst, required super.isFinal, required super.isLate, + required super.isStatic, + required super.shouldUseTypeForInitializerInference, required super.type, required super.constInitializer, - required this.isStatic, + required this.hasEnclosingTypeParameterReference, + required this.isAbstract, + required this.isCovariant, + required this.isEnumConstant, + required this.isExternal, + required this.isPromotable, }); factory FieldItem.fromElement({ @@ -593,12 +607,23 @@ id: id, isSynthetic: element.isSynthetic, metadata: ManifestMetadata.encode(context, element.metadata), + hasInitializer: element.hasInitializer, + hasImplicitType: element.hasImplicitType, isConst: element.isConst, isFinal: element.isFinal, isLate: element.isLate, + isStatic: element.isStatic, + shouldUseTypeForInitializerInference: + element.shouldUseTypeForInitializerInference, type: element.type.encode(context), constInitializer: element.constantInitializer?.encode(context), - isStatic: element.isStatic, + hasEnclosingTypeParameterReference: + element.hasEnclosingTypeParameterReference, + isAbstract: element.isAbstract, + isCovariant: element.isCovariant, + isEnumConstant: element.isEnumConstant, + isExternal: element.isExternal, + isPromotable: element.isPromotable, ); } @@ -607,24 +632,45 @@ id: ManifestItemId.read(reader), isSynthetic: reader.readBool(), metadata: ManifestMetadata.read(reader), + hasInitializer: reader.readBool(), + hasImplicitType: reader.readBool(), isConst: reader.readBool(), isFinal: reader.readBool(), isLate: reader.readBool(), + isStatic: reader.readBool(), + shouldUseTypeForInitializerInference: reader.readBool(), type: ManifestType.read(reader), constInitializer: ManifestNode.readOptional(reader), - isStatic: reader.readBool(), + hasEnclosingTypeParameterReference: reader.readBool(), + isAbstract: reader.readBool(), + isCovariant: reader.readBool(), + isEnumConstant: reader.readBool(), + isExternal: reader.readBool(), + isPromotable: reader.readBool(), ); } @override bool match(MatchContext context, FieldElementImpl element) { - return super.match(context, element) && isStatic == element.isStatic; + return super.match(context, element) && + hasEnclosingTypeParameterReference == + element.hasEnclosingTypeParameterReference && + isAbstract == element.isAbstract && + isCovariant == element.isCovariant && + isEnumConstant == element.isEnumConstant && + isExternal == element.isExternal && + isPromotable == element.isPromotable; } @override void write(BufferedSink sink) { super.write(sink); - sink.writeBool(isStatic); + sink.writeBool(hasEnclosingTypeParameterReference); + sink.writeBool(isAbstract); + sink.writeBool(isCovariant); + sink.writeBool(isEnumConstant); + sink.writeBool(isExternal); + sink.writeBool(isPromotable); } static Map<LookupName, FieldItem> readMap(SummaryDataReader reader) { @@ -1524,15 +1570,22 @@ } class TopLevelVariableItem extends VariableItem<TopLevelVariableElementImpl> { + final bool isExternal; + TopLevelVariableItem({ required super.id, required super.isSynthetic, required super.metadata, + required super.hasInitializer, + required super.hasImplicitType, required super.isConst, required super.isFinal, required super.isLate, + required super.isStatic, + required super.shouldUseTypeForInitializerInference, required super.type, required super.constInitializer, + required this.isExternal, }); factory TopLevelVariableItem.fromElement({ @@ -1544,11 +1597,17 @@ id: id, isSynthetic: element.isSynthetic, metadata: ManifestMetadata.encode(context, element.metadata), + hasInitializer: element.hasInitializer, + hasImplicitType: element.hasImplicitType, isConst: element.isConst, isFinal: element.isFinal, isLate: element.isLate, + isStatic: element.isStatic, + shouldUseTypeForInitializerInference: + element.shouldUseTypeForInitializerInference, type: element.type.encode(context), constInitializer: element.constantInitializer?.encode(context), + isExternal: element.isExternal, ); } @@ -1557,13 +1616,29 @@ id: ManifestItemId.read(reader), isSynthetic: reader.readBool(), metadata: ManifestMetadata.read(reader), + hasInitializer: reader.readBool(), + hasImplicitType: reader.readBool(), isConst: reader.readBool(), isFinal: reader.readBool(), isLate: reader.readBool(), + isStatic: reader.readBool(), + shouldUseTypeForInitializerInference: reader.readBool(), type: ManifestType.read(reader), constInitializer: ManifestNode.readOptional(reader), + isExternal: reader.readBool(), ); } + + @override + bool match(MatchContext context, TopLevelVariableElementImpl element) { + return super.match(context, element) && isExternal == element.isExternal; + } + + @override + void write(BufferedSink sink) { + super.write(sink); + sink.writeBool(isExternal); + } } class TypeAliasItem extends ManifestItem<TypeAliasElementImpl> { @@ -1620,11 +1695,15 @@ } } -sealed class VariableItem<E extends VariableElementImpl> +sealed class VariableItem<E extends PropertyInducingElementImpl> extends ManifestItem<E> { + final bool hasInitializer; + final bool hasImplicitType; final bool isConst; final bool isFinal; final bool isLate; + final bool isStatic; + final bool shouldUseTypeForInitializerInference; final ManifestType type; final ManifestNode? constInitializer; @@ -1632,9 +1711,13 @@ required super.id, required super.isSynthetic, required super.metadata, + required this.hasInitializer, + required this.hasImplicitType, required this.isConst, required this.isFinal, required this.isLate, + required this.isStatic, + required this.shouldUseTypeForInitializerInference, required this.type, required this.constInitializer, }); @@ -1642,9 +1725,14 @@ @override bool match(MatchContext context, E element) { return super.match(context, element) && + hasInitializer == element.hasInitializer && + hasImplicitType == element.hasImplicitType && isConst == element.isConst && isFinal == element.isFinal && isLate == element.isLate && + isStatic == element.isStatic && + shouldUseTypeForInitializerInference == + element.shouldUseTypeForInitializerInference && type.match(context, element.type) && constInitializer.match(context, element.constantInitializer); } @@ -1652,9 +1740,13 @@ @override void write(BufferedSink sink) { super.write(sink); + sink.writeBool(hasInitializer); + sink.writeBool(hasImplicitType); sink.writeBool(isConst); sink.writeBool(isFinal); sink.writeBool(isLate); + sink.writeBool(isStatic); + sink.writeBool(shouldUseTypeForInitializerInference); type.write(sink); constInitializer.writeOptional(sink); }
diff --git a/pkg/analyzer/lib/src/summary2/bundle_reader.dart b/pkg/analyzer/lib/src/summary2/bundle_reader.dart index 94d3807..cc3fc5f 100644 --- a/pkg/analyzer/lib/src/summary2/bundle_reader.dart +++ b/pkg/analyzer/lib/src/summary2/bundle_reader.dart
@@ -266,18 +266,6 @@ var element = ClassElementImpl(reference, fragments.first); element.linkFragments(fragments); - element.withoutLoadingResolution(() { - var typeParameterFragments = fragments.first.typeParameters; - for (var i = 0; i < typeParameterFragments.length; i++) { - // Side effect: set element for the fragment. - TypeParameterElementImpl(firstFragment: typeParameterFragments[i]); - fragments.reduce((previous, current) { - previous.typeParameters[i].addFragment(current.typeParameters[i]); - return current; - }); - } - }); - element.readModifiers(_reader); element.hasNonFinalField = _reader.readBool(); @@ -913,6 +901,7 @@ firstFragment: fragments.first, ); element.linkFragments(fragments); + element.readModifiers(_reader); element.typeInferenceError = _readTopLevelInferenceError(); @@ -970,6 +959,7 @@ var fragments = _readFragmentsById<MixinFragmentImpl>(); var element = MixinElementImpl(reference, fragments.first); element.linkFragments(fragments); + element.readModifiers(_reader); element.hasNonFinalField = _reader.readBool();
diff --git a/pkg/analyzer/lib/src/summary2/element_builder.dart b/pkg/analyzer/lib/src/summary2/element_builder.dart index c26b9af..c8456c9 100644 --- a/pkg/analyzer/lib/src/summary2/element_builder.dart +++ b/pkg/analyzer/lib/src/summary2/element_builder.dart
@@ -194,30 +194,11 @@ if (fragment.isAugmentation && lastFragment is ClassFragmentImpl) { lastFragment.addFragment(fragment); - var lastTypeParameterFragments = lastFragment.typeParameters; - - // Trim extra type parameters. - if (lastTypeParameterFragments.length < fragment.typeParameters.length) { - fragment.typeParameters.length = lastTypeParameterFragments.length; - } - - // Add missing type parameters. - if (lastTypeParameterFragments.length > fragment.typeParameters.length) { - for ( - var i = fragment.typeParameters.length; - i < lastTypeParameterFragments.length; - i++ - ) { - fragment.addTypeParameter( - TypeParameterFragmentImpl(name: lastTypeParameterFragments[i].name) - ..isSynthetic = true, - ); - } - } - - for (var i = 0; i < lastTypeParameterFragments.length; i++) { - lastTypeParameterFragments[i].addFragment(fragment.typeParameters[i]); - } + _linkTypeParameters( + lastFragments: lastFragment.typeParameters, + fragments: fragment.typeParameters, + add: fragment.addTypeParameter, + ); return; } @@ -227,6 +208,7 @@ ); for (var typeParameterFragment in fragment.typeParameters) { + // Side effect: set element for the fragment. TypeParameterElementImpl(firstFragment: typeParameterFragment); } @@ -471,9 +453,21 @@ if (lastFragment is MethodFragmentImpl && fragment.isAugmentation) { lastFragment.addFragment(fragment); + + _linkTypeParameters( + lastFragments: lastFragment.typeParameters, + fragments: fragment.typeParameters, + add: fragment.addTypeParameter, + ); + return; } + for (var typeParameterFragment in fragment.typeParameters) { + // Side effect: set element for the fragment. + TypeParameterElementImpl(firstFragment: typeParameterFragment); + } + instanceElement.addMethod( MethodElementImpl( name: fragment.name, @@ -549,9 +543,15 @@ ) { assert(!fragment.isSynthetic); libraryFragment.addMixin(fragment); - if (fragment.isAugmentation && lastFragment is MixinFragmentImpl) { lastFragment.addFragment(fragment); + + _linkTypeParameters( + lastFragments: lastFragment.typeParameters, + fragments: fragment.typeParameters, + add: fragment.addTypeParameter, + ); + return; } @@ -559,6 +559,12 @@ _addTopReference('@mixin', fragment.name), fragment, ); + + for (var typeParameterFragment in fragment.typeParameters) { + // Side effect: set element for the fragment. + TypeParameterElementImpl(firstFragment: typeParameterFragment); + } + libraryElement.addMixin(element); libraryBuilder.declare(element, element.reference); } @@ -766,6 +772,31 @@ } } + void _linkTypeParameters<T extends FragmentImpl>({ + required List<TypeParameterFragmentImpl> lastFragments, + required List<TypeParameterFragmentImpl> fragments, + required void Function(TypeParameterFragmentImpl) add, + }) { + // Trim extra type parameters. + if (lastFragments.length < fragments.length) { + fragments.length = lastFragments.length; + } + + // Synthesize missing type parameters. + if (lastFragments.length > fragments.length) { + for (var i = fragments.length; i < lastFragments.length; i++) { + add( + TypeParameterFragmentImpl(name: lastFragments[i].name) + ..isSynthetic = true, + ); + } + } + + for (var i = 0; i < lastFragments.length; i++) { + lastFragments[i].addFragment(fragments[i]); + } + } + TopLevelVariableElementImpl? _topLevelVariableElement( FragmentImpl? fragment, ) {
diff --git a/pkg/analyzer/lib/src/summary2/informative_data.dart b/pkg/analyzer/lib/src/summary2/informative_data.dart index 019137d..a78a90c 100644 --- a/pkg/analyzer/lib/src/summary2/informative_data.dart +++ b/pkg/analyzer/lib/src/summary2/informative_data.dart
@@ -69,7 +69,7 @@ unitElement.setCodeRange(unitInfo.codeOffset, unitInfo.codeLength); unitElement.lineInfo = LineInfo(unitInfo.lineStarts); - unitElement.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToImports(unitElement.libraryImports, unitInfo); _applyToExports(unitElement.libraryExports, unitInfo); _applyToPartIncludes(unitElement.parts, unitInfo); @@ -173,7 +173,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToFormalParameters(element.formalParameters, info.parameters); }); @@ -194,7 +194,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToTypeParameters(element.typeParameters, info.typeParameters); }); @@ -204,7 +204,7 @@ }); _scheduleApplyMembersOffsets(element, () { - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToConstructors(element.constructors, info.constructors); _applyToFields(element.fields, info.fields); _applyToAccessors(element.getters, info.getters); @@ -223,7 +223,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToTypeParameters(element.typeParameters, info.typeParameters); }); @@ -266,7 +266,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToFormalParameters(element.formalParameters, info.parameters); }); @@ -287,7 +287,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToTypeParameters(element.typeParameters, info.typeParameters); _applyToConstructors(element.constructors, info.constructors); _applyToFields(element.fields, info.fields); @@ -318,7 +318,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToTypeParameters(element.typeParameters, info.typeParameters); }); @@ -342,7 +342,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToTypeParameters(element.typeParameters, info.typeParameters); }); @@ -358,7 +358,7 @@ applier.applyToMetadata(representationField.metadata); }); - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { var primaryConstructor = element.constructors.first; primaryConstructor.setCodeRange(infoRep.codeOffset, infoRep.codeLength); primaryConstructor.typeNameOffset = info.nameOffset; @@ -367,7 +367,7 @@ primaryConstructor.nameOffset = infoRep.constructorNameOffset; primaryConstructor.nameEnd = infoRep.constructorNameEnd; - primaryConstructor.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { var representation = primaryConstructor.formalParameters.first; representation.firstTokenOffset = infoRep.firstTokenOffset; representation.nameOffset = infoRep.fieldNameOffset; @@ -430,7 +430,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToTypeParameters(element.typeParameters, info.typeParameters); _applyToFormalParameters(element.formalParameters, info.parameters); }); @@ -451,7 +451,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToTypeParameters(element.typeParameters, info.typeParameters); if (element.aliasedElement case GenericFunctionTypeFragmentImpl aliased) { _applyToFormalParameters(aliased.formalParameters, info.parameters); @@ -474,7 +474,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToTypeParameters(element.typeParameters, info.typeParameters); if (element.aliasedElement case GenericFunctionTypeFragmentImpl aliased) { _applyToTypeParameters( @@ -527,7 +527,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToTypeParameters(element.typeParameters, info.typeParameters); _applyToFormalParameters(element.formalParameters, info.parameters); }); @@ -549,7 +549,7 @@ element.nameOffset = info.nameOffset; element.documentationComment = info.documentationComment; - element.withoutLoadingResolution(() { + DeferredResolutionReadingMixin.withoutLoadingResolution(() { _applyToTypeParameters(element.typeParameters, info.typeParameters); _applyToConstructors(element.constructors, info.constructors); _applyToFields(element.fields, info.fields);
diff --git a/pkg/analyzer/lib/src/summary2/types_builder.dart b/pkg/analyzer/lib/src/summary2/types_builder.dart index d3cd9c7..50ee031 100644 --- a/pkg/analyzer/lib/src/summary2/types_builder.dart +++ b/pkg/analyzer/lib/src/summary2/types_builder.dart
@@ -346,10 +346,14 @@ var constraints = _toInterfaceTypeList( node.onClause?.superclassConstraints, ); - element.superclassConstraints = constraints; - element.interfaces = _toInterfaceTypeList( - node.implementsClause?.interfaces, - ); + element.superclassConstraints = [ + ...element.superclassConstraints, + ...constraints, + ]; + element.interfaces = [ + ...element.interfaces, + ..._toInterfaceTypeList(node.implementsClause?.interfaces), + ]; } NullabilitySuffix _nullability(AstNode node, bool hasQuestion) { @@ -414,8 +418,9 @@ if (type != null) { for (var variable in node.variables) { var variableFragment = variable.declaredFragment!; - var variableElement = variableFragment.element; - variableElement.type = type; + if (variableFragment.previousFragment == null) { + variableFragment.element.type = type; + } } } }
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart index 1e21a76..bbf149a 100644 --- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart +++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -19224,6 +19224,7 @@ extendedType: int @ dart:core declaredFields foo: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo: #M2 @@ -19268,8 +19269,10 @@ extendedType: int @ dart:core declaredFields bar: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters bar: #M4 @@ -19320,8 +19323,10 @@ extendedType: int @ dart:core declaredFields bar: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters bar: #M3 @@ -19369,8 +19374,10 @@ extendedType: int @ dart:core declaredFields bar: #M5 + flags: isSynthetic shouldUseTypeForInitializerInference type: double @ dart:core foo: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters bar: #M6 @@ -19421,8 +19428,10 @@ extendedType: int @ dart:core declaredFields bar: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters bar: #M3 @@ -19469,6 +19478,7 @@ extendedType: int @ dart:core declaredFields foo: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo: #M4 @@ -19981,6 +19991,7 @@ extendedType: int @ dart:core declaredFields foo: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo=: #M2 @@ -20028,8 +20039,10 @@ extendedType: int @ dart:core declaredFields bar: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters bar=: #M4 @@ -20086,8 +20099,10 @@ extendedType: int @ dart:core declaredFields bar: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters bar=: #M3 @@ -20141,8 +20156,10 @@ extendedType: int @ dart:core declaredFields bar: #M5 + flags: isSynthetic shouldUseTypeForInitializerInference type: double @ dart:core foo: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters bar=: #M6 @@ -20199,8 +20216,10 @@ extendedType: int @ dart:core declaredFields bar: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters bar=: #M3 @@ -20253,6 +20272,7 @@ extendedType: int @ dart:core declaredFields foo: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo=: #M4 @@ -45476,6 +45496,520 @@ ); } + test_manifest_class_field_modifier_hasEnclosingTypeParameterReference() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +class A<T> { + final T? foo1; + final int? foo2; + final T? foo3; + final int? foo4; +} +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + typeParameters + #0 covariant + bound: <null> + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: hasEnclosingTypeParameterReference isFinal shouldUseTypeForInitializerInference + type: typeParameter#0? + foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M3 + flags: hasEnclosingTypeParameterReference isFinal shouldUseTypeForInitializerInference + type: typeParameter#0? + foo4: #M4 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: hasEnclosingTypeParameterReference isSimplyBounded isSynthetic + returnType: typeParameter#0? + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M7 + flags: hasEnclosingTypeParameterReference isSimplyBounded isSynthetic + returnType: typeParameter#0? + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + interface: #M9 + map + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 + implemented + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 +''', + updatedCode: r''' +class A<T> { + final T? foo1; + final int? foo2; + final int? foo3; + final T? foo4; +} +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + typeParameters + #0 covariant + bound: <null> + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: hasEnclosingTypeParameterReference isFinal shouldUseTypeForInitializerInference + type: typeParameter#0? + foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M10 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M11 + flags: hasEnclosingTypeParameterReference isFinal shouldUseTypeForInitializerInference + type: typeParameter#0? + declaredGetters + foo1: #M5 + flags: hasEnclosingTypeParameterReference isSimplyBounded isSynthetic + returnType: typeParameter#0? + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M12 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M13 + flags: hasEnclosingTypeParameterReference isSimplyBounded isSynthetic + returnType: typeParameter#0? + interface: #M14 + map + foo1: #M5 + foo2: #M6 + foo3: #M12 + foo4: #M13 + implemented + foo1: #M5 + foo2: #M6 + foo3: #M12 + foo4: #M13 +''', + ); + } + + test_manifest_class_field_modifier_hasImplicitType() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +class A { + final foo1 = 0; + final int foo2 = 0; + final foo3 = 0; + final int foo4 = 0; +} +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: hasImplicitType hasInitializer isFinal + type: int @ dart:core + foo2: #M2 + flags: hasInitializer isFinal shouldUseTypeForInitializerInference + type: int @ dart:core + foo3: #M3 + flags: hasImplicitType hasInitializer isFinal + type: int @ dart:core + foo4: #M4 + flags: hasInitializer isFinal shouldUseTypeForInitializerInference + type: int @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded isSynthetic + returnType: int @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int @ dart:core + foo3: #M7 + flags: isSimplyBounded isSynthetic + returnType: int @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int @ dart:core + interface: #M9 + map + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 + implemented + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 +''', + updatedCode: r''' +class A { + final foo1 = 0; + final int foo2 = 0; + final int foo3 = 0; + final foo4 = 0; +} +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: hasImplicitType hasInitializer isFinal + type: int @ dart:core + foo2: #M2 + flags: hasInitializer isFinal shouldUseTypeForInitializerInference + type: int @ dart:core + foo3: #M10 + flags: hasInitializer isFinal shouldUseTypeForInitializerInference + type: int @ dart:core + foo4: #M11 + flags: hasImplicitType hasInitializer isFinal + type: int @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded isSynthetic + returnType: int @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int @ dart:core + foo3: #M7 + flags: isSimplyBounded isSynthetic + returnType: int @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int @ dart:core + interface: #M9 + map + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 + implemented + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 +''', + ); + } + + test_manifest_class_field_modifier_hasInitializer() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +class A { + final int? foo1 = 0; + final int? foo2; + final int? foo3 = 0; + final int? foo4; +} +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: hasInitializer isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M3 + flags: hasInitializer isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M4 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M7 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + interface: #M9 + map + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 + implemented + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 +''', + updatedCode: r''' +class A { + final int? foo1 = 0; + final int? foo2; + final int? foo3; + final int? foo4 = 0; +} +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: hasInitializer isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M10 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M11 + flags: hasInitializer isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M7 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + interface: #M9 + map + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 + implemented + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 +''', + ); + } + + test_manifest_class_field_modifier_isAbstract() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +class A { + abstract int? foo1; + int? foo2; + abstract int? foo3; + int? foo4; +} +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + flags: hasNonFinalField + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: isAbstract shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M3 + flags: isAbstract shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M4 + flags: shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isAbstract isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M7 + flags: isAbstract isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + declaredSetters + foo1=: #M9 + flags: isAbstract isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo2=: #M10 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo3=: #M11 + flags: isAbstract isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo4=: #M12 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + interface: #M13 + map + foo1: #M5 + foo1=: #M9 + foo2: #M6 + foo2=: #M10 + foo3: #M7 + foo3=: #M11 + foo4: #M8 + foo4=: #M12 + implemented + foo2: #M6 + foo2=: #M10 + foo4: #M8 + foo4=: #M12 +''', + updatedCode: r''' +class A { + abstract int? foo1; + int? foo2; + int? foo3; + abstract int? foo4; +} +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + flags: hasNonFinalField + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: isAbstract shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M14 + flags: shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M15 + flags: isAbstract shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isAbstract isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M16 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M17 + flags: isAbstract isSimplyBounded isSynthetic + returnType: int? @ dart:core + declaredSetters + foo1=: #M9 + flags: isAbstract isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo2=: #M10 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo3=: #M18 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo4=: #M19 + flags: isAbstract isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + interface: #M20 + map + foo1: #M5 + foo1=: #M9 + foo2: #M6 + foo2=: #M10 + foo3: #M16 + foo3=: #M18 + foo4: #M17 + foo4=: #M19 + implemented + foo2: #M6 + foo2=: #M10 + foo3: #M16 + foo3=: #M18 +''', + ); + } + test_manifest_class_field_modifier_isConst() async { await _runLibraryManifestScenario( initialCode: r''' @@ -45526,6 +46060,298 @@ ); } + test_manifest_class_field_modifier_isCovariant() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +class A { + covariant int? foo1; + int? foo2; + covariant int? foo3; + int? foo4; +} +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + flags: hasNonFinalField + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: isCovariant shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M3 + flags: isCovariant shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M4 + flags: shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M7 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + declaredSetters + foo1=: #M9 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo2=: #M10 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo3=: #M11 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo4=: #M12 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + interface: #M13 + map + foo1: #M5 + foo1=: #M9 + foo2: #M6 + foo2=: #M10 + foo3: #M7 + foo3=: #M11 + foo4: #M8 + foo4=: #M12 + implemented + foo1: #M5 + foo1=: #M9 + foo2: #M6 + foo2=: #M10 + foo3: #M7 + foo3=: #M11 + foo4: #M8 + foo4=: #M12 +''', + updatedCode: r''' +class A { + covariant int? foo1; + int? foo2; + int? foo3; + covariant int? foo4; +} +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + flags: hasNonFinalField + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: isCovariant shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M14 + flags: shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M15 + flags: isCovariant shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M7 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + declaredSetters + foo1=: #M9 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo2=: #M10 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo3=: #M16 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + foo4=: #M17 + flags: isSimplyBounded isSynthetic + functionType: FunctionType + positional + required int? @ dart:core + returnType: void + interface: #M18 + map + foo1: #M5 + foo1=: #M9 + foo2: #M6 + foo2=: #M10 + foo3: #M7 + foo3=: #M16 + foo4: #M8 + foo4=: #M17 + implemented + foo1: #M5 + foo1=: #M9 + foo2: #M6 + foo2=: #M10 + foo3: #M7 + foo3=: #M16 + foo4: #M8 + foo4=: #M17 +''', + ); + } + + test_manifest_class_field_modifier_isExternal() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +class A { + external final int? foo1; + final int? foo2; + external final int? foo3; + final int? foo4; +} +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: isExternal isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M3 + flags: isExternal isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M4 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M7 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + interface: #M9 + map + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 + implemented + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 +''', + updatedCode: r''' +class A { + external final int? foo1; + final int? foo2; + final int? foo3; + external final int? foo4; +} +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: isExternal isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M10 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M11 + flags: isExternal isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M7 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + interface: #M9 + map + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 + implemented + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 +''', + ); + } + test_manifest_class_field_modifier_isFinal() async { await _runLibraryManifestScenario( initialCode: r''' @@ -45666,6 +46492,358 @@ ); } + test_manifest_class_field_modifier_isPromotable() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +class A { + final int? _foo1; + final int? _foo2; + final int? _foo3; + final int? _foo4; +} + +class B { + int? get _foo2; + int? get _foo4; +} +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + _foo1: #M1 + flags: isFinal isPromotable shouldUseTypeForInitializerInference + type: int? @ dart:core + _foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + _foo3: #M3 + flags: isFinal isPromotable shouldUseTypeForInitializerInference + type: int? @ dart:core + _foo4: #M4 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + _foo1: #M5 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + _foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + _foo3: #M7 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + _foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + interface: #M9 + B: #M10 + supertype: Object @ dart:core + declaredFields + _foo2: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + _foo4: #M12 + flags: isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + _foo2: #M13 + flags: isAbstract isSimplyBounded + returnType: int? @ dart:core + _foo4: #M14 + flags: isAbstract isSimplyBounded + returnType: int? @ dart:core + interface: #M15 +''', + updatedCode: r''' +class A { + final int? _foo1; + final int? _foo2; + final int? _foo3; + final int? _foo4; +} + +class B { + int? get _foo2; + int? get _foo3; +} +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + _foo1: #M1 + flags: isFinal isPromotable shouldUseTypeForInitializerInference + type: int? @ dart:core + _foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + _foo3: #M16 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + _foo4: #M17 + flags: isFinal isPromotable shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + _foo1: #M5 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + _foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + _foo3: #M7 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + _foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + interface: #M9 + B: #M10 + supertype: Object @ dart:core + declaredFields + _foo2: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + _foo3: #M18 + flags: isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + _foo2: #M13 + flags: isAbstract isSimplyBounded + returnType: int? @ dart:core + _foo3: #M19 + flags: isAbstract isSimplyBounded + returnType: int? @ dart:core + interface: #M15 +''', + ); + } + + test_manifest_class_field_modifier_isStatic() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +class A { + static final int? foo1; + final int? foo2; + static final int? foo3; + final int? foo4; +} +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M3 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M4 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M7 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + interface: #M9 + map + foo2: #M6 + foo4: #M8 + implemented + foo2: #M6 + foo4: #M8 +''', + updatedCode: r''' +class A { + static final int? foo1; + final int? foo2; + final int? foo3; + static final int? foo4; +} +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M10 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M11 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M12 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M13 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + interface: #M14 + map + foo2: #M6 + foo3: #M12 + implemented + foo2: #M6 + foo3: #M12 +''', + ); + } + + test_manifest_class_field_modifier_isSynthetic() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +class A { + int? get foo1 => 0; + final int? foo2; + int? get foo3 => 0; + final int? foo4; +} +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M4 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M7 + flags: isSimplyBounded + returnType: int? @ dart:core + foo4: #M8 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + interface: #M9 + map + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 + implemented + foo1: #M5 + foo2: #M6 + foo3: #M7 + foo4: #M8 +''', + updatedCode: r''' +class A { + int? get foo1 => 0; + final int? foo2; + final int? foo3; + int? get foo4 => 0; +} +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredClasses + A: #M0 + supertype: Object @ dart:core + declaredFields + foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M2 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M10 + flags: isFinal shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + declaredGetters + foo1: #M5 + flags: isSimplyBounded + returnType: int? @ dart:core + foo2: #M6 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo3: #M12 + flags: isSimplyBounded isSynthetic + returnType: int? @ dart:core + foo4: #M13 + flags: isSimplyBounded + returnType: int? @ dart:core + interface: #M14 + map + foo1: #M5 + foo2: #M6 + foo3: #M12 + foo4: #M13 + implemented + foo1: #M5 + foo2: #M6 + foo3: #M12 + foo4: #M13 +''', + ); + } + test_manifest_class_field_private_final() async { await _runLibraryManifestScenario( initialCode: r''' @@ -45804,102 +46982,6 @@ ); } - test_manifest_class_field_static_falseToTrue() async { - await _runLibraryManifestScenario( - initialCode: r''' -class A { - int foo = 0; -} -''', - expectedInitialEvents: r''' -[operation] linkLibraryCycle SDK -[operation] linkLibraryCycle - package:test/test.dart - declaredClasses - A: #M0 - declaredFields - foo: #M1 - declaredGetters - foo: #M2 - declaredSetters - foo=: #M3 - interface: #M4 - map - foo: #M2 - foo=: #M3 - implemented - foo: #M2 - foo=: #M3 -''', - updatedCode: r''' -class A { - static int foo = 0; -} -''', - expectedUpdatedEvents: r''' -[operation] linkLibraryCycle - package:test/test.dart - declaredClasses - A: #M0 - declaredFields - foo: #M5 - declaredGetters - foo: #M6 - declaredSetters - foo=: #M7 - interface: #M8 -''', - ); - } - - test_manifest_class_field_static_trueToFalse() async { - await _runLibraryManifestScenario( - initialCode: r''' -class A { - static int foo = 0; -} -''', - expectedInitialEvents: r''' -[operation] linkLibraryCycle SDK -[operation] linkLibraryCycle - package:test/test.dart - declaredClasses - A: #M0 - declaredFields - foo: #M1 - declaredGetters - foo: #M2 - declaredSetters - foo=: #M3 - interface: #M4 -''', - updatedCode: r''' -class A { - int foo = 0; -} -''', - expectedUpdatedEvents: r''' -[operation] linkLibraryCycle - package:test/test.dart - declaredClasses - A: #M0 - declaredFields - foo: #M5 - declaredGetters - foo: #M6 - declaredSetters - foo=: #M7 - interface: #M8 - map - foo: #M6 - foo=: #M7 - implemented - foo: #M6 - foo=: #M7 -''', - ); - } - test_manifest_class_field_type() async { await _runLibraryManifestScenario( initialCode: r''' @@ -46758,12 +47840,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -46805,12 +47891,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M10 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M11 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 declaredGetters foo1: #M5 @@ -46854,10 +47944,13 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic declaredGetters foo1: #M4 @@ -46894,10 +47987,13 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo2: #M8 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo3: #M9 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M4 @@ -46948,12 +48044,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -46983,12 +48083,16 @@ supertype: A @ package:test/test.dart declaredFields foo1: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M12 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M13 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M14 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M15 @@ -47048,12 +48152,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -47083,12 +48191,16 @@ supertype: A @ package:test/test.dart declaredFields foo1: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M12 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M13 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M14 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M15 @@ -47150,12 +48262,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -47197,12 +48313,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -47250,12 +48370,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -47298,12 +48422,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -47353,12 +48481,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -47397,12 +48529,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M10 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -47535,6 +48671,7 @@ supertype: Object @ dart:core declaredFields foo: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo: #M2 @@ -47559,6 +48696,7 @@ supertype: Object @ dart:core declaredFields foo: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: double @ dart:core declaredGetters foo: #M5 @@ -48017,6 +49155,7 @@ supertype: Object @ dart:core declaredFields a: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int? @ dart:core declaredGetters a: #M2 @@ -48032,6 +49171,7 @@ supertype: Object @ dart:core declaredFields a: #M5 + flags: shouldUseTypeForInitializerInference type: int? @ dart:core declaredGetters a: #M6 @@ -48069,6 +49209,7 @@ supertype: Object @ dart:core declaredFields a: #M9 + flags: shouldUseTypeForInitializerInference type: int? @ dart:core declaredGetters a: #M2 @@ -48092,6 +49233,7 @@ supertype: Object @ dart:core declaredFields a: #M12 + flags: isFinal shouldUseTypeForInitializerInference type: int? @ dart:core declaredGetters a: #M6 @@ -53743,12 +54885,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -53802,12 +54948,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M10 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M11 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 declaredSetters foo1=: #M5 @@ -53870,12 +55020,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -53917,12 +55071,16 @@ supertype: A @ package:test/test.dart declaredFields foo1: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M12 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M13 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M14 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M15 @@ -53994,12 +55152,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -54041,12 +55203,16 @@ supertype: A @ package:test/test.dart declaredFields foo1: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M12 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M13 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M14 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M15 @@ -54120,12 +55286,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -54179,12 +55349,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -54244,12 +55418,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -54304,12 +55482,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -54371,12 +55553,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -54427,12 +55613,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M10 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -55007,6 +56197,7 @@ supertype: Object @ dart:core declaredFields foo: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: List @ dart:core dynamic declaredSetters @@ -55025,6 +56216,7 @@ supertype: Object @ dart:core declaredFields foo: #M5 + flags: isSynthetic shouldUseTypeForInitializerInference type: List @ dart:core void declaredSetters @@ -55072,6 +56264,7 @@ supertype: Object @ dart:core declaredFields foo: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: List @ dart:core dynamic declaredSetters @@ -55090,6 +56283,7 @@ supertype: Object @ dart:core declaredFields foo: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: List @ dart:core int @ dart:core declaredSetters @@ -55137,6 +56331,7 @@ supertype: Object @ dart:core declaredFields foo: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo=: #M2 @@ -55164,6 +56359,7 @@ supertype: Object @ dart:core declaredFields foo: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: double @ dart:core declaredSetters foo=: #M5 @@ -56608,6 +57804,7 @@ returnType: double @ dart:core declaredVariables b: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: double @ dart:core constInitializer tokenBuffer: 0+a @@ -56634,11 +57831,13 @@ returnType: int @ dart:core declaredVariables a: #M5 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 1 tokenLengthList: [1] b: #M6 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0+a @@ -56675,11 +57874,13 @@ returnType: int @ dart:core declaredVariables a: #M2 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 tokenLengthList: [1] b: #M3 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 1+a @@ -56705,6 +57906,7 @@ returnType: double @ dart:core declaredVariables b: #M6 + flags: hasImplicitType hasInitializer isConst isStatic type: double @ dart:core constInitializer tokenBuffer: 1+a @@ -56765,6 +57967,7 @@ returnType: int @ dart:core declaredVariables a: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer isValid: false @@ -56785,10 +57988,12 @@ returnType: int @ dart:core declaredVariables a: #M3 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer isValid: false b: #M4 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 @@ -57127,6 +58332,7 @@ returnType: int @ dart:core declaredVariables a: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0ascore.int @@ -57154,6 +58360,7 @@ returnType: int @ dart:core declaredVariables a: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0ascore.int @@ -57164,6 +58371,7 @@ 3 = importPrefix 5 = element 0 b: #M4 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 @@ -57188,6 +58396,7 @@ returnType: int @ dart:core declaredVariables a: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer isValid: false @@ -57208,10 +58417,12 @@ returnType: int @ dart:core declaredVariables a: #M3 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer isValid: false b: #M4 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 @@ -57491,6 +58702,7 @@ returnType: int @ dart:core declaredVariables a: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer isValid: false @@ -57511,10 +58723,12 @@ returnType: int @ dart:core declaredVariables a: #M3 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer isValid: false b: #M4 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 @@ -57539,6 +58753,7 @@ returnType: bool @ dart:core declaredVariables a: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: bool @ dart:core constInitializer tokenBuffer: identical(0,1) @@ -57564,6 +58779,7 @@ returnType: int @ dart:core declaredVariables a: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: bool @ dart:core constInitializer tokenBuffer: identical(0,1) @@ -57573,6 +58789,7 @@ elementIndexList 5 = element 0 b: #M4 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 @@ -57607,6 +58824,7 @@ returnType: int @ dart:core declaredVariables foo: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 @@ -57619,6 +58837,7 @@ returnType: int @ dart:core declaredVariables foo: #M3 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 @@ -57631,6 +58850,7 @@ returnType: InvalidType declaredVariables x: #M5 + flags: hasImplicitType hasInitializer isConst isStatic type: InvalidType constInitializer tokenBuffer: foo @@ -57657,6 +58877,7 @@ returnType: InvalidType declaredVariables x: #M5 + flags: hasImplicitType hasInitializer isConst isStatic type: InvalidType constInitializer tokenBuffer: foo @@ -57735,11 +58956,13 @@ returnType: int @ dart:core declaredVariables a: #M2 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 tokenLengthList: [1] b: #M3 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer isValid: false @@ -57764,15 +58987,18 @@ returnType: int @ dart:core declaredVariables a: #M2 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 tokenLengthList: [1] b: #M5 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer isValid: false c: #M6 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 @@ -57797,6 +59023,7 @@ returnType: int @ dart:core declaredVariables a: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer isValid: false @@ -57817,10 +59044,12 @@ returnType: int @ dart:core declaredVariables a: #M3 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer isValid: false b: #M4 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 @@ -57978,11 +59207,13 @@ supertype: Object @ dart:core declaredFields a: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 tokenLengthList: [1] b: #M2 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 @@ -58006,6 +59237,7 @@ returnType: int @ dart:core declaredVariables c: #M8 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: prefix.A.a @@ -58020,6 +59252,7 @@ 13 = element 1 21 = element 2 d: #M9 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: prefix.A.b @@ -58049,11 +59282,13 @@ supertype: Object @ dart:core declaredFields a: #M1 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 0 tokenLengthList: [1] b: #M10 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: 1 @@ -58085,6 +59320,7 @@ returnType: int @ dart:core declaredVariables c: #M8 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: prefix.A.a @@ -58099,6 +59335,7 @@ 13 = element 1 21 = element 2 d: #M11 + flags: hasImplicitType hasInitializer isConst isStatic type: int @ dart:core constInitializer tokenBuffer: prefix.A.b @@ -58601,6 +59838,7 @@ returnType: Type @ dart:core declaredVariables x: #M2 + flags: hasImplicitType hasInitializer isConst isStatic type: Type @ dart:core constInitializer tokenBuffer: A @@ -58627,6 +59865,7 @@ returnType: Type @ dart:core declaredVariables x: #M2 + flags: hasImplicitType hasInitializer isConst isStatic type: Type @ dart:core constInitializer tokenBuffer: A @@ -58636,6 +59875,7 @@ elementIndexList 5 = element 0 y: #M4 + flags: hasImplicitType hasInitializer isConst isStatic type: Type @ dart:core constInitializer tokenBuffer: double @@ -60408,12 +61648,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -60449,12 +61693,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M9 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M10 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 declaredGetters foo1: #M5 @@ -60493,10 +61741,13 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic declaredGetters foo1: #M4 @@ -60525,10 +61776,13 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo2: #M7 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo3: #M8 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M4 @@ -60565,12 +61819,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -60603,12 +61861,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -60648,12 +61910,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -60686,12 +61952,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M9 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M10 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -61165,12 +62435,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -61218,12 +62492,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M9 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M10 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 declaredSetters foo1=: #M5 @@ -61275,12 +62553,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -61325,12 +62607,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -61382,12 +62668,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -61432,12 +62722,16 @@ extendedType: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M9 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M10 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -61552,6 +62846,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -61605,6 +62900,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -61665,6 +62961,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -61718,6 +63015,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -61778,6 +63076,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -61831,6 +63130,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -61958,14 +63258,19 @@ typeErasure: typeParameter#0 declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M5 + flags: hasEnclosingTypeParameterReference isFinal shouldUseTypeForInitializerInference type: typeParameter#0 declaredGetters foo1: #M6 @@ -62017,14 +63322,19 @@ typeErasure: typeParameter#0 declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M12 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M13 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 it: #M5 + flags: hasEnclosingTypeParameterReference isFinal shouldUseTypeForInitializerInference type: typeParameter#0 declaredGetters foo1: #M6 @@ -62079,12 +63389,16 @@ typeErasure: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic it: #M4 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -62127,12 +63441,16 @@ typeErasure: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo2: #M10 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo3: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M4 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -62183,14 +63501,19 @@ typeErasure: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M5 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M6 @@ -62239,14 +63562,19 @@ typeErasure: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M5 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M6 @@ -62302,14 +63630,19 @@ typeErasure: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M5 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M6 @@ -62354,14 +63687,19 @@ typeErasure: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M12 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M13 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M5 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M6 @@ -62649,6 +63987,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -62688,6 +64027,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -62739,6 +64079,7 @@ typeErasure: typeParameter#0 declaredFields it: #M1 + flags: hasEnclosingTypeParameterReference isFinal shouldUseTypeForInitializerInference type: typeParameter#0 declaredGetters it: #M2 @@ -62795,6 +64136,7 @@ typeErasure: typeParameter#0 declaredFields it: #M1 + flags: hasEnclosingTypeParameterReference isFinal shouldUseTypeForInitializerInference type: typeParameter#0 declaredGetters it: #M2 @@ -62854,6 +64196,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -62900,6 +64243,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -62954,6 +64298,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -63007,6 +64352,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -63067,6 +64413,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -63116,6 +64463,7 @@ typeErasure: int @ dart:core declaredFields it: #M1 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M2 @@ -63405,14 +64753,19 @@ typeErasure: typeParameter#0 declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M5 + flags: hasEnclosingTypeParameterReference isFinal shouldUseTypeForInitializerInference type: typeParameter#0 declaredGetters it: #M6 @@ -63477,14 +64830,19 @@ typeErasure: typeParameter#0 declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M12 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M13 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 it: #M5 + flags: hasEnclosingTypeParameterReference isFinal shouldUseTypeForInitializerInference type: typeParameter#0 declaredGetters it: #M6 @@ -63553,14 +64911,19 @@ typeErasure: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M5 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M6 @@ -63622,14 +64985,19 @@ typeErasure: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M5 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M6 @@ -63698,14 +65066,19 @@ typeErasure: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M5 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M6 @@ -63763,14 +65136,19 @@ typeErasure: int @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M12 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M13 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core it: #M5 + flags: isFinal shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters it: #M6 @@ -65001,12 +66379,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -65048,12 +66430,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M10 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M11 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 declaredGetters foo1: #M5 @@ -65098,10 +66484,13 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic declaredGetters foo1: #M4 @@ -65139,10 +66528,13 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo2: #M8 + flags: isSynthetic shouldUseTypeForInitializerInference type: dynamic foo3: #M9 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M4 @@ -65193,12 +66585,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -65230,12 +66626,16 @@ S @ package:test/test.dart declaredFields foo1: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M12 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M13 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M14 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M15 @@ -65295,12 +66695,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -65332,12 +66736,16 @@ S @ package:test/test.dart declaredFields foo1: #M21 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M22 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M23 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M24 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M25 @@ -65399,12 +66807,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -65446,12 +66858,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -65500,12 +66916,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -65549,12 +66969,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -65605,12 +67029,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -65650,12 +67078,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M10 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo1: #M5 @@ -65789,6 +67221,7 @@ Object @ dart:core declaredFields foo: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredGetters foo: #M2 @@ -65814,6 +67247,7 @@ Object @ dart:core declaredFields foo: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: double @ dart:core declaredGetters foo: #M5 @@ -68190,12 +69624,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -68249,12 +69687,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M10 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M11 + flags: hasEnclosingTypeParameterReference isSynthetic shouldUseTypeForInitializerInference type: typeParameter#0 declaredSetters foo1=: #M5 @@ -68317,12 +69759,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -68366,12 +69812,16 @@ S @ package:test/test.dart declaredFields foo1: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M12 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M13 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M14 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M15 @@ -68443,12 +69893,16 @@ supertype: Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -68492,12 +69946,16 @@ S @ package:test/test.dart declaredFields foo1: #M21 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M22 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M23 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M24 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M25 @@ -68571,12 +70029,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -68630,12 +70092,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -68696,12 +70162,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -68757,12 +70227,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -68825,12 +70299,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M3 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -68882,12 +70360,16 @@ Object @ dart:core declaredFields foo1: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M2 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M10 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M11 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo1=: #M5 @@ -69196,6 +70678,7 @@ Object @ dart:core declaredFields foo: #M1 + flags: isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core declaredSetters foo=: #M2 @@ -69224,6 +70707,7 @@ Object @ dart:core declaredFields foo: #M4 + flags: isSynthetic shouldUseTypeForInitializerInference type: double @ dart:core declaredSetters foo=: #M5 @@ -70742,10 +72226,13 @@ returnType: dynamic declaredVariables foo1: #M3 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: dynamic foo2: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M5 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: dynamic ''', updatedCode: r''' @@ -70768,10 +72255,13 @@ returnType: int @ dart:core declaredVariables foo1: #M3 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: dynamic foo2: #M8 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: dynamic foo3: #M9 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core ''', ); @@ -70805,12 +72295,16 @@ returnType: int @ dart:core declaredVariables foo1: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M5 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M6 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M7 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core ''', updatedCode: r''' @@ -70837,12 +72331,16 @@ returnType: int @ dart:core declaredVariables foo1: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M5 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M6 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M7 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core ''', ); @@ -71066,10 +72564,13 @@ returnType: void declaredVariables foo1: #M3 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M5 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core ''', updatedCode: r''' @@ -71101,10 +72602,13 @@ returnType: void declaredVariables foo1: #M3 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M5 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core ''', ); @@ -71150,12 +72654,16 @@ returnType: void declaredVariables foo1: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M5 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M6 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M7 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core ''', updatedCode: r''' @@ -71194,12 +72702,16 @@ returnType: void declaredVariables foo1: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo2: #M5 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo3: #M6 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core foo4: #M7 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core ''', ); @@ -71224,6 +72736,7 @@ returnType: void declaredVariables a: #M1 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: int @ dart:core ''', updatedCode: r''' @@ -71241,6 +72754,7 @@ returnType: void declaredVariables a: #M3 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference type: double @ dart:core ''', ); @@ -71405,6 +72919,166 @@ ); } + test_manifest_topLevelVariable_modifier_hasImplicitType() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +final foo1 = 0; +final int foo2 = 0; +final foo3 = 0; +final int foo4 = 0; +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredGetters + foo1: #M0 + flags: isSimplyBounded isStatic isSynthetic + returnType: int @ dart:core + foo2: #M1 + flags: isSimplyBounded isStatic isSynthetic + returnType: int @ dart:core + foo3: #M2 + flags: isSimplyBounded isStatic isSynthetic + returnType: int @ dart:core + foo4: #M3 + flags: isSimplyBounded isStatic isSynthetic + returnType: int @ dart:core + declaredVariables + foo1: #M4 + flags: hasImplicitType hasInitializer isFinal isStatic + type: int @ dart:core + foo2: #M5 + flags: hasInitializer isFinal isStatic shouldUseTypeForInitializerInference + type: int @ dart:core + foo3: #M6 + flags: hasImplicitType hasInitializer isFinal isStatic + type: int @ dart:core + foo4: #M7 + flags: hasInitializer isFinal isStatic shouldUseTypeForInitializerInference + type: int @ dart:core +''', + updatedCode: r''' +final foo1 = 0; +final int foo2 = 0; +final int foo3 = 0; +final foo4 = 0; +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredGetters + foo1: #M0 + flags: isSimplyBounded isStatic isSynthetic + returnType: int @ dart:core + foo2: #M1 + flags: isSimplyBounded isStatic isSynthetic + returnType: int @ dart:core + foo3: #M2 + flags: isSimplyBounded isStatic isSynthetic + returnType: int @ dart:core + foo4: #M3 + flags: isSimplyBounded isStatic isSynthetic + returnType: int @ dart:core + declaredVariables + foo1: #M4 + flags: hasImplicitType hasInitializer isFinal isStatic + type: int @ dart:core + foo2: #M5 + flags: hasInitializer isFinal isStatic shouldUseTypeForInitializerInference + type: int @ dart:core + foo3: #M8 + flags: hasInitializer isFinal isStatic shouldUseTypeForInitializerInference + type: int @ dart:core + foo4: #M9 + flags: hasImplicitType hasInitializer isFinal isStatic + type: int @ dart:core +''', + ); + } + + test_manifest_topLevelVariable_modifier_hasInitializer() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +final int? foo1 = 0; +final int? foo2; +final int? foo3 = 0; +final int? foo4; +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredGetters + foo1: #M0 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo2: #M1 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo3: #M2 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo4: #M3 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + declaredVariables + foo1: #M4 + flags: hasInitializer isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M5 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M6 + flags: hasInitializer isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M7 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core +''', + updatedCode: r''' +final int? foo1 = 0; +final int? foo2; +final int? foo3; +final int? foo4 = 0; +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredGetters + foo1: #M0 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo2: #M1 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo3: #M2 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo4: #M3 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + declaredVariables + foo1: #M4 + flags: hasInitializer isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M5 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M8 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M9 + flags: hasInitializer isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core +''', + ); + } + test_manifest_topLevelVariable_modifier_isConst() async { await _runLibraryManifestScenario( initialCode: r''' @@ -71445,6 +73119,86 @@ ); } + test_manifest_topLevelVariable_modifier_isExternal() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +external final int? foo1; +final int? foo2; +external final int? foo3; +final int? foo4; +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredGetters + foo1: #M0 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo2: #M1 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo3: #M2 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo4: #M3 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + declaredVariables + foo1: #M4 + flags: isExternal isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M5 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M6 + flags: isExternal isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M7 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core +''', + updatedCode: r''' +external final int? foo1; +final int? foo2; +final int? foo3; +external final int? foo4; +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredGetters + foo1: #M0 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo2: #M1 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo3: #M2 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo4: #M3 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + declaredVariables + foo1: #M4 + flags: isExternal isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M5 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M8 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M9 + flags: isExternal isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core +''', + ); + } + test_manifest_topLevelVariable_modifier_isFinal() async { await _runLibraryManifestScenario( initialCode: r''' @@ -71529,6 +73283,86 @@ ); } + test_manifest_topLevelVariable_modifier_isSynthetic() async { + configuration.withElementManifests = true; + + await _runLibraryManifestScenario( + initialCode: r''' +int? get foo1 => 0; +final int? foo2; +int? get foo3 => 0; +final int? foo4; +''', + expectedInitialEvents: r''' +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/test.dart + declaredGetters + foo1: #M0 + flags: isSimplyBounded isStatic + returnType: int? @ dart:core + foo2: #M1 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo3: #M2 + flags: isSimplyBounded isStatic + returnType: int? @ dart:core + foo4: #M3 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + declaredVariables + foo1: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M5 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M6 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M7 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core +''', + updatedCode: r''' +int? get foo1 => 0; +final int? foo2; +final int? foo3; +int? get foo4 => 0; +''', + expectedUpdatedEvents: r''' +[operation] linkLibraryCycle + package:test/test.dart + declaredGetters + foo1: #M0 + flags: isSimplyBounded isStatic + returnType: int? @ dart:core + foo2: #M1 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo3: #M8 + flags: isSimplyBounded isStatic isSynthetic + returnType: int? @ dart:core + foo4: #M9 + flags: isSimplyBounded isStatic + returnType: int? @ dart:core + declaredVariables + foo1: #M4 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo2: #M5 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo3: #M10 + flags: isFinal isStatic shouldUseTypeForInitializerInference + type: int? @ dart:core + foo4: #M11 + flags: isStatic isSynthetic shouldUseTypeForInitializerInference + type: int? @ dart:core +''', + ); + } + test_manifest_topLevelVariable_private_const() async { await _runLibraryManifestScenario( initialCode: r''' @@ -74359,6 +76193,124 @@ ); } + test_req_instanceElement_fieldElement_getter() async { + newFile('$testPackageLibPath/a.dart', r''' +class A { + int foo = 0; +} +'''); + + newFile(testFile.path, r''' +import 'a.dart'; +'''); + + _ManualRequirements.install((state) { + var A = state.singleUnit.scopeInstanceElement('A'); + A.getField('foo')!.getter; + }); + + await _runManualRequirementsRecording( + expectedEvents: r''' +[status] working +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/a.dart + declaredClasses + A: #M0 + declaredFields + foo: #M1 + declaredGetters + foo: #M2 + declaredSetters + foo=: #M3 + interface: #M4 + map + foo: #M2 + foo=: #M3 + implemented + foo: #M2 + foo=: #M3 + requirements +[operation] linkLibraryCycle + package:test/test.dart + requirements +[operation] analyzedLibrary + file: /home/test/lib/test.dart + requirements + libraries + package:test/a.dart + exportedTopLevels + A: #M0 + instances + A + requestedDeclaredFields + foo: #M1 + requestedDeclaredGetters + foo: #M2 +[status] idle +''', + ); + } + + test_req_instanceElement_fieldElement_setter() async { + newFile('$testPackageLibPath/a.dart', r''' +class A { + int foo = 0; +} +'''); + + newFile(testFile.path, r''' +import 'a.dart'; +'''); + + _ManualRequirements.install((state) { + var A = state.singleUnit.scopeInstanceElement('A'); + A.getField('foo')!.setter; + }); + + await _runManualRequirementsRecording( + expectedEvents: r''' +[status] working +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/a.dart + declaredClasses + A: #M0 + declaredFields + foo: #M1 + declaredGetters + foo: #M2 + declaredSetters + foo=: #M3 + interface: #M4 + map + foo: #M2 + foo=: #M3 + implemented + foo: #M2 + foo=: #M3 + requirements +[operation] linkLibraryCycle + package:test/test.dart + requirements +[operation] analyzedLibrary + file: /home/test/lib/test.dart + requirements + libraries + package:test/a.dart + exportedTopLevels + A: #M0 + instances + A + requestedDeclaredFields + foo: #M1 + requestedDeclaredSetters + foo=: #M3 +[status] idle +''', + ); + } + test_req_instanceElement_fields() async { newFile('$testPackageLibPath/a.dart', r''' class A { @@ -74648,6 +76600,126 @@ ); } + test_req_instanceElement_getterElement_correspondingSetter() async { + newFile('$testPackageLibPath/a.dart', r''' +class A { + int foo = 0; +} +'''); + + newFile(testFile.path, r''' +import 'a.dart'; +'''); + + _ManualRequirements.install((state) { + var A = state.singleUnit.scopeInstanceElement('A'); + A.getGetter('foo')!.correspondingSetter; + }); + + await _runManualRequirementsRecording( + expectedEvents: r''' +[status] working +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/a.dart + declaredClasses + A: #M0 + declaredFields + foo: #M1 + declaredGetters + foo: #M2 + declaredSetters + foo=: #M3 + interface: #M4 + map + foo: #M2 + foo=: #M3 + implemented + foo: #M2 + foo=: #M3 + requirements +[operation] linkLibraryCycle + package:test/test.dart + requirements +[operation] analyzedLibrary + file: /home/test/lib/test.dart + requirements + libraries + package:test/a.dart + exportedTopLevels + A: #M0 + instances + A + requestedDeclaredFields + foo: #M1 + requestedDeclaredGetters + foo: #M2 + requestedDeclaredSetters + foo=: #M3 +[status] idle +''', + ); + } + + test_req_instanceElement_getterElement_nonSynthetic() async { + newFile('$testPackageLibPath/a.dart', r''' +class A { + int foo = 0; +} +'''); + + newFile(testFile.path, r''' +import 'a.dart'; +'''); + + _ManualRequirements.install((state) { + var A = state.singleUnit.scopeInstanceElement('A'); + A.getGetter('foo')!.nonSynthetic; + }); + + await _runManualRequirementsRecording( + expectedEvents: r''' +[status] working +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/a.dart + declaredClasses + A: #M0 + declaredFields + foo: #M1 + declaredGetters + foo: #M2 + declaredSetters + foo=: #M3 + interface: #M4 + map + foo: #M2 + foo=: #M3 + implemented + foo: #M2 + foo=: #M3 + requirements +[operation] linkLibraryCycle + package:test/test.dart + requirements +[operation] analyzedLibrary + file: /home/test/lib/test.dart + requirements + libraries + package:test/a.dart + exportedTopLevels + A: #M0 + instances + A + requestedDeclaredFields + foo: #M1 + requestedDeclaredGetters + foo: #M2 +[status] idle +''', + ); + } + test_req_instanceElement_getterElement_variable() async { newFile('$testPackageLibPath/a.dart', r''' class A { @@ -74860,6 +76932,126 @@ ); } + test_req_instanceElement_setterElement_correspondingGetter() async { + newFile('$testPackageLibPath/a.dart', r''' +class A { + int foo = 0; +} +'''); + + newFile(testFile.path, r''' +import 'a.dart'; +'''); + + _ManualRequirements.install((state) { + var A = state.singleUnit.scopeInstanceElement('A'); + A.getSetter('foo')!.correspondingGetter; + }); + + await _runManualRequirementsRecording( + expectedEvents: r''' +[status] working +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/a.dart + declaredClasses + A: #M0 + declaredFields + foo: #M1 + declaredGetters + foo: #M2 + declaredSetters + foo=: #M3 + interface: #M4 + map + foo: #M2 + foo=: #M3 + implemented + foo: #M2 + foo=: #M3 + requirements +[operation] linkLibraryCycle + package:test/test.dart + requirements +[operation] analyzedLibrary + file: /home/test/lib/test.dart + requirements + libraries + package:test/a.dart + exportedTopLevels + A: #M0 + instances + A + requestedDeclaredFields + foo: #M1 + requestedDeclaredGetters + foo: #M2 + requestedDeclaredSetters + foo=: #M3 +[status] idle +''', + ); + } + + test_req_instanceElement_setterElement_nonSynthetic() async { + newFile('$testPackageLibPath/a.dart', r''' +class A { + int foo = 0; +} +'''); + + newFile(testFile.path, r''' +import 'a.dart'; +'''); + + _ManualRequirements.install((state) { + var A = state.singleUnit.scopeInstanceElement('A'); + A.getSetter('foo')!.nonSynthetic; + }); + + await _runManualRequirementsRecording( + expectedEvents: r''' +[status] working +[operation] linkLibraryCycle SDK +[operation] linkLibraryCycle + package:test/a.dart + declaredClasses + A: #M0 + declaredFields + foo: #M1 + declaredGetters + foo: #M2 + declaredSetters + foo=: #M3 + interface: #M4 + map + foo: #M2 + foo=: #M3 + implemented + foo: #M2 + foo=: #M3 + requirements +[operation] linkLibraryCycle + package:test/test.dart + requirements +[operation] analyzedLibrary + file: /home/test/lib/test.dart + requirements + libraries + package:test/a.dart + exportedTopLevels + A: #M0 + instances + A + requestedDeclaredFields + foo: #M1 + requestedDeclaredSetters + foo=: #M3 +[status] idle +''', + ); + } + test_req_instanceElement_setterElement_variable() async { newFile('$testPackageLibPath/a.dart', r''' class A {
diff --git a/pkg/analyzer/test/src/dart/analysis/result_printer.dart b/pkg/analyzer/test/src/dart/analysis/result_printer.dart index 1024a73..8610646 100644 --- a/pkg/analyzer/test/src/dart/analysis/result_printer.dart +++ b/pkg/analyzer/test/src/dart/analysis/result_printer.dart
@@ -1110,6 +1110,20 @@ }; } + Map<String, bool> _variableItemFlags(VariableItem item) { + return { + 'hasInitializer': item.hasInitializer, + 'hasImplicitType': item.hasImplicitType, + 'isConst': item.isConst, + 'isFinal': item.isFinal, + 'isLate': item.isLate, + 'isStatic': item.isStatic, + 'isSynthetic': item.isSynthetic, + 'shouldUseTypeForInitializerInference': + item.shouldUseTypeForInitializerInference, + }; + } + void _writeClassItem(ClassItem item) { if (configuration.withElementManifests) { sink.withIndent(() { @@ -1232,6 +1246,16 @@ sink.writelnWithIndent('$name: $idStr'); if (configuration.withElementManifests) { sink.withIndent(() { + sink.writeFlags({ + ..._variableItemFlags(item), + 'hasEnclosingTypeParameterReference': + item.hasEnclosingTypeParameterReference, + 'isAbstract': item.isAbstract, + 'isCovariant': item.isCovariant, + 'isEnumConstant': item.isEnumConstant, + 'isExternal': item.isExternal, + 'isPromotable': item.isPromotable, + }); _writeMetadata(item); _writeNamedType('type', item.type); _writeNode('constInitializer', item.constInitializer); @@ -1627,6 +1651,10 @@ void _writeTopLevelVariableItem(TopLevelVariableItem item) { if (configuration.withElementManifests) { sink.withIndent(() { + sink.writeFlags({ + ..._variableItemFlags(item), + 'isExternal': item.isExternal, + }); _writeMetadata(item); _writeNamedType('type', item.type); _writeNode('constInitializer', item.constInitializer);
diff --git a/pkg/analyzer/test/src/summary/elements/class_test.dart b/pkg/analyzer/test/src/summary/elements/class_test.dart index 39f6053..4ef1315 100644 --- a/pkg/analyzer/test/src/summary/elements/class_test.dart +++ b/pkg/analyzer/test/src/summary/elements/class_test.dart
@@ -23147,7 +23147,7 @@ hasInitializer foo reference: <testLibrary>::@class::A::@field::foo firstFragment: #F3 - type: double + type: int getter: <testLibrary>::@class::A::@getter::foo setter: <testLibrary>::@class::A::@setter::foo constructors @@ -23158,7 +23158,7 @@ synthetic foo reference: <testLibrary>::@class::A::@getter::foo firstFragment: #F6 - returnType: double + returnType: int variable: <testLibrary>::@class::A::@field::foo setters synthetic foo @@ -23167,7 +23167,7 @@ formalParameters #E0 requiredPositional value firstFragment: #F8 - type: double + type: int returnType: void variable: <testLibrary>::@class::A::@field::foo '''); @@ -26901,6 +26901,521 @@ '''); } + test_method_typeParameters_111() async { + var library = await buildLibrary(r''' +class A { + void foo<T>(){} +} +augment class A { + augment void foo<T>(){} +} +augment class A { + augment void foo<T>(){} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@class::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 class A (nameOffset:44) (firstTokenOffset:30) (offset:44) + element: <testLibrary>::@class::A + previousFragment: #F1 + nextFragment: #F7 + methods + #F4 augment foo (nameOffset:63) (firstTokenOffset:50) (offset:63) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F3 + nextFragment: #F8 + typeParameters + #F6 T (nameOffset:67) (firstTokenOffset:67) (offset:67) + element: #E0 T + previousFragment: #F5 + nextFragment: #F9 + #F7 class A (nameOffset:90) (firstTokenOffset:76) (offset:90) + element: <testLibrary>::@class::A + previousFragment: #F2 + methods + #F8 augment foo (nameOffset:109) (firstTokenOffset:96) (offset:109) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F4 + typeParameters + #F9 T (nameOffset:113) (firstTokenOffset:113) (offset:113) + element: #E0 T + previousFragment: #F6 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + returnType: void +'''); + } + + test_method_typeParameters_121() async { + var library = await buildLibrary(r''' +class A { + void foo<T>(){} +} +augment class A { + augment void foo<T, U>(){} +} +augment class A { + augment void foo<T>(){} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@class::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 class A (nameOffset:44) (firstTokenOffset:30) (offset:44) + element: <testLibrary>::@class::A + previousFragment: #F1 + nextFragment: #F7 + methods + #F4 augment foo (nameOffset:63) (firstTokenOffset:50) (offset:63) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F3 + nextFragment: #F8 + typeParameters + #F6 T (nameOffset:67) (firstTokenOffset:67) (offset:67) + element: #E0 T + previousFragment: #F5 + nextFragment: #F9 + #F7 class A (nameOffset:93) (firstTokenOffset:79) (offset:93) + element: <testLibrary>::@class::A + previousFragment: #F2 + methods + #F8 augment foo (nameOffset:112) (firstTokenOffset:99) (offset:112) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F4 + typeParameters + #F9 T (nameOffset:116) (firstTokenOffset:116) (offset:116) + element: #E0 T + previousFragment: #F6 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + returnType: void +'''); + } + + test_method_typeParameters_212() async { + var library = await buildLibrary(r''' +class A { + void foo<T, U>(){} +} +augment class A { + augment void foo<T>(){} +} +augment class A { + augment void foo<T, U>(){} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@class::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F7 U (nameOffset:24) (firstTokenOffset:24) (offset:24) + element: #E1 U + nextFragment: #F8 + #F2 class A (nameOffset:47) (firstTokenOffset:33) (offset:47) + element: <testLibrary>::@class::A + previousFragment: #F1 + nextFragment: #F9 + methods + #F4 augment foo (nameOffset:66) (firstTokenOffset:53) (offset:66) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F3 + nextFragment: #F10 + typeParameters + #F6 T (nameOffset:70) (firstTokenOffset:70) (offset:70) + element: #E0 T + previousFragment: #F5 + nextFragment: #F11 + #F8 U (nameOffset:<null>) (firstTokenOffset:<null>) (offset:66) + element: #E1 U + previousFragment: #F7 + nextFragment: #F12 + #F9 class A (nameOffset:93) (firstTokenOffset:79) (offset:93) + element: <testLibrary>::@class::A + previousFragment: #F2 + methods + #F10 augment foo (nameOffset:112) (firstTokenOffset:99) (offset:112) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F4 + typeParameters + #F11 T (nameOffset:116) (firstTokenOffset:116) (offset:116) + element: #E0 T + previousFragment: #F6 + #F12 U (nameOffset:119) (firstTokenOffset:119) (offset:119) + element: #E1 U + previousFragment: #F8 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + #E1 U + firstFragment: #F7 + returnType: void +'''); + } + + test_method_typeParameters_bounds_bounds_int_int() async { + var library = await buildLibrary(r''' +class A { + void foo<T extends int>() {} +} +augment class A { + augment void foo<T extends int>() {} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@class::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 class A (nameOffset:57) (firstTokenOffset:43) (offset:57) + element: <testLibrary>::@class::A + previousFragment: #F1 + methods + #F4 augment foo (nameOffset:76) (firstTokenOffset:63) (offset:76) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F3 + typeParameters + #F6 T (nameOffset:80) (firstTokenOffset:80) (offset:80) + element: #E0 T + previousFragment: #F5 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + bound: int + returnType: void +'''); + } + + test_method_typeParameters_bounds_int_nothing() async { + var library = await buildLibrary(r''' +class A { + void foo<T extends int>() {} +} +augment class A { + augment void foo<T>() {} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@class::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 class A (nameOffset:57) (firstTokenOffset:43) (offset:57) + element: <testLibrary>::@class::A + previousFragment: #F1 + methods + #F4 augment foo (nameOffset:76) (firstTokenOffset:63) (offset:76) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F3 + typeParameters + #F6 T (nameOffset:80) (firstTokenOffset:80) (offset:80) + element: #E0 T + previousFragment: #F5 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + bound: int + returnType: void +'''); + } + + test_method_typeParameters_bounds_int_string() async { + var library = await buildLibrary(r''' +class A { + void foo<T extends int>() {} +} +augment class A { + augment void foo<T extends String>() {} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@class::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 class A (nameOffset:57) (firstTokenOffset:43) (offset:57) + element: <testLibrary>::@class::A + previousFragment: #F1 + methods + #F4 augment foo (nameOffset:76) (firstTokenOffset:63) (offset:76) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F3 + typeParameters + #F6 T (nameOffset:80) (firstTokenOffset:80) (offset:80) + element: #E0 T + previousFragment: #F5 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + bound: int + returnType: void +'''); + } + + test_method_typeParameters_bounds_nothing_int() async { + var library = await buildLibrary(r''' +class A { + void foo<T>() {} +} +augment class A { + augment void foo<T extends int>() {} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@class::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 class A (nameOffset:45) (firstTokenOffset:31) (offset:45) + element: <testLibrary>::@class::A + previousFragment: #F1 + methods + #F4 augment foo (nameOffset:64) (firstTokenOffset:51) (offset:64) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F3 + typeParameters + #F6 T (nameOffset:68) (firstTokenOffset:68) (offset:68) + element: #E0 T + previousFragment: #F5 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + returnType: void +'''); + } + + test_method_typeParameters_differentNames() async { + var library = await buildLibrary(r''' +class A { + void foo<T, U>() {} +} + +augment class A { + augment void foo<U, T>() {} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@class::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F7 U (nameOffset:24) (firstTokenOffset:24) (offset:24) + element: #E1 U + nextFragment: #F8 + #F2 class A (nameOffset:49) (firstTokenOffset:35) (offset:49) + element: <testLibrary>::@class::A + previousFragment: #F1 + methods + #F4 augment foo (nameOffset:68) (firstTokenOffset:55) (offset:68) + element: <testLibrary>::@class::A::@method::foo + previousFragment: #F3 + typeParameters + #F6 U (nameOffset:72) (firstTokenOffset:72) (offset:72) + element: #E0 T + previousFragment: #F5 + #F8 T (nameOffset:75) (firstTokenOffset:75) (offset:75) + element: #E1 U + previousFragment: #F7 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + #E1 U + firstFragment: #F7 + returnType: void +'''); + } + test_modifiers_abstract() async { var library = await buildLibrary(r''' abstract class A {} @@ -27541,9 +28056,9 @@ '''); } - test_typeParameters_bounds_01() async { + test_typeParameters_bounds_int_int() async { var library = await buildLibrary(r''' -class A<T> {} +class A<T extends int> {} augment class A<T extends int> {} '''); @@ -27562,11 +28077,11 @@ #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) element: #E0 T nextFragment: #F4 - #F2 class A (nameOffset:28) (firstTokenOffset:14) (offset:28) + #F2 class A (nameOffset:40) (firstTokenOffset:26) (offset:40) element: <testLibrary>::@class::A previousFragment: #F1 typeParameters - #F4 T (nameOffset:30) (firstTokenOffset:30) (offset:30) + #F4 T (nameOffset:42) (firstTokenOffset:42) (offset:42) element: #E0 T previousFragment: #F3 classes @@ -27576,10 +28091,11 @@ typeParameters #E0 T firstFragment: #F3 + bound: int '''); } - test_typeParameters_bounds_10() async { + test_typeParameters_bounds_int_nothing() async { var library = await buildLibrary(r''' class A<T extends int> {} augment class A<T> {} @@ -27618,46 +28134,7 @@ '''); } - test_typeParameters_bounds_11() async { - var library = await buildLibrary(r''' -class A<T extends int> {} -augment class A<T extends int> {} -'''); - - configuration.withConstructors = false; - checkElementText(library, r''' -library - reference: <testLibrary> - fragments - #F0 <testLibraryFragment> - element: <testLibrary> - classes - #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) - element: <testLibrary>::@class::A - nextFragment: #F2 - typeParameters - #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) - element: #E0 T - nextFragment: #F4 - #F2 class A (nameOffset:40) (firstTokenOffset:26) (offset:40) - element: <testLibrary>::@class::A - previousFragment: #F1 - typeParameters - #F4 T (nameOffset:42) (firstTokenOffset:42) (offset:42) - element: #E0 T - previousFragment: #F3 - classes - class A - reference: <testLibrary>::@class::A - firstFragment: #F1 - typeParameters - #E0 T - firstFragment: #F3 - bound: int -'''); - } - - test_typeParameters_bounds_12() async { + test_typeParameters_bounds_int_string() async { var library = await buildLibrary(r''' class A<T extends int> {} augment class A<T extends String> {} @@ -27696,14 +28173,13 @@ '''); } - test_typeParameters_defaultType() async { + test_typeParameters_bounds_nothing_int() async { var library = await buildLibrary(r''' -class A<T extends B> {} -class B {} - -augment class A<T extends B> {} +class A<T> {} +augment class A<T extends int> {} '''); + configuration.withConstructors = false; checkElementText(library, r''' library reference: <testLibrary> @@ -27718,21 +28194,11 @@ #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) element: #E0 T nextFragment: #F4 - constructors - #F5 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:6) - element: <testLibrary>::@class::A::@constructor::new - typeName: A - #F6 class B (nameOffset:30) (firstTokenOffset:24) (offset:30) - element: <testLibrary>::@class::B - constructors - #F7 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:30) - element: <testLibrary>::@class::B::@constructor::new - typeName: B - #F2 class A (nameOffset:50) (firstTokenOffset:36) (offset:50) + #F2 class A (nameOffset:28) (firstTokenOffset:14) (offset:28) element: <testLibrary>::@class::A previousFragment: #F1 typeParameters - #F4 T (nameOffset:52) (firstTokenOffset:52) (offset:52) + #F4 T (nameOffset:30) (firstTokenOffset:30) (offset:30) element: #E0 T previousFragment: #F3 classes @@ -27742,18 +28208,6 @@ typeParameters #E0 T firstFragment: #F3 - bound: B - constructors - synthetic new - reference: <testLibrary>::@class::A::@constructor::new - firstFragment: #F5 - class B - reference: <testLibrary>::@class::B - firstFragment: #F6 - constructors - synthetic new - reference: <testLibrary>::@class::B::@constructor::new - firstFragment: #F7 '''); }
diff --git a/pkg/analyzer/test/src/summary/elements/mixin_test.dart b/pkg/analyzer/test/src/summary/elements/mixin_test.dart index ed9c7cc..1cd49c7 100644 --- a/pkg/analyzer/test/src/summary/elements/mixin_test.dart +++ b/pkg/analyzer/test/src/summary/elements/mixin_test.dart
@@ -12,14 +12,246 @@ defineReflectiveSuite(() { defineReflectiveTests(MixinElementTest_keepLinking); defineReflectiveTests(MixinElementTest_fromBytes); - // TODO(scheglov): implement augmentation - // defineReflectiveTests(MixinElementTest_augmentation_fromBytes); - // defineReflectiveTests(MixinElementTest_augmentation_keepLinking); + defineReflectiveTests(MixinElementTest_augmentation_fromBytes); + defineReflectiveTests(MixinElementTest_augmentation_keepLinking); defineReflectiveTests(UpdateNodeTextExpectations); }); } abstract class MixinElementTest extends ElementsBaseTest { + test_allSupertypes() async { + var library = await buildLibrary(r''' +mixin M {} +class A with M {} +'''); + + configuration + ..withAllSupertypes = true + ..withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:17) (firstTokenOffset:11) (offset:17) + element: <testLibrary>::@class::A + mixins + #F2 mixin M (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::M + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + supertype: Object + mixins + M + allSupertypes + M + Object + mixins + mixin M + reference: <testLibrary>::@mixin::M + firstFragment: #F2 + superclassConstraints + Object + allSupertypes + Object +'''); + } + + test_allSupertypes_generic() async { + var library = await buildLibrary(r''' +class A<T, U> {} +class B<T> extends A<int, T> {} + +mixin M1 on A<int, double> {} +mixin M2 on B<String> {} +'''); + + configuration + ..withAllSupertypes = true + ..withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + typeParameters + #F2 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + #F3 U (nameOffset:11) (firstTokenOffset:11) (offset:11) + element: #E1 U + #F4 class B (nameOffset:23) (firstTokenOffset:17) (offset:23) + element: <testLibrary>::@class::B + typeParameters + #F5 T (nameOffset:25) (firstTokenOffset:25) (offset:25) + element: #E2 T + mixins + #F6 mixin M1 (nameOffset:56) (firstTokenOffset:50) (offset:56) + element: <testLibrary>::@mixin::M1 + #F7 mixin M2 (nameOffset:86) (firstTokenOffset:80) (offset:86) + element: <testLibrary>::@mixin::M2 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + typeParameters + #E0 T + firstFragment: #F2 + #E1 U + firstFragment: #F3 + allSupertypes + Object + class B + reference: <testLibrary>::@class::B + firstFragment: #F4 + typeParameters + #E2 T + firstFragment: #F5 + supertype: A<int, T> + allSupertypes + A<int, T> + Object + mixins + mixin M1 + reference: <testLibrary>::@mixin::M1 + firstFragment: #F6 + superclassConstraints + A<int, double> + allSupertypes + A<int, double> + Object + mixin M2 + reference: <testLibrary>::@mixin::M2 + firstFragment: #F7 + superclassConstraints + B<String> + allSupertypes + A<int, String> + B<String> + Object +'''); + } + + test_allSupertypes_hasInterfaces() async { + var library = await buildLibrary(r''' +class A {} +class B {} +class C {} + +mixin M on A implements B, C {} +'''); + + configuration + ..withAllSupertypes = true + ..withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + #F2 class B (nameOffset:17) (firstTokenOffset:11) (offset:17) + element: <testLibrary>::@class::B + #F3 class C (nameOffset:28) (firstTokenOffset:22) (offset:28) + element: <testLibrary>::@class::C + mixins + #F4 mixin M (nameOffset:40) (firstTokenOffset:34) (offset:40) + element: <testLibrary>::@mixin::M + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + allSupertypes + Object + class B + reference: <testLibrary>::@class::B + firstFragment: #F2 + allSupertypes + Object + class C + reference: <testLibrary>::@class::C + firstFragment: #F3 + allSupertypes + Object + mixins + mixin M + reference: <testLibrary>::@mixin::M + firstFragment: #F4 + superclassConstraints + A + interfaces + B + C + allSupertypes + A + B + C + Object +'''); + } + + test_allSupertypes_hasSuperclassConstraints() async { + var library = await buildLibrary(r''' +class A {} +mixin M on A {} +class B with M {} +'''); + + configuration + ..withAllSupertypes = true + ..withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + classes + #F1 class A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@class::A + #F2 class B (nameOffset:33) (firstTokenOffset:27) (offset:33) + element: <testLibrary>::@class::B + mixins + #F3 mixin M (nameOffset:17) (firstTokenOffset:11) (offset:17) + element: <testLibrary>::@mixin::M + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + allSupertypes + Object + class B + reference: <testLibrary>::@class::B + firstFragment: #F2 + supertype: Object + mixins + M + allSupertypes + A + M + Object + mixins + mixin M + reference: <testLibrary>::@mixin::M + firstFragment: #F3 + superclassConstraints + A + allSupertypes + A + Object +'''); + } + test_mixin() async { var library = await buildLibrary(r''' class A {} @@ -1841,3299 +2073,1353 @@ } abstract class MixinElementTest_augmentation extends ElementsBaseTest { - test_allSupertypes() async { - var library = await buildLibrary(r''' -mixin M {} -class A with M {} -'''); - - configuration - ..withAllSupertypes = true - ..withConstructors = false; - checkElementText(library, r''' -library - reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - classes - class A @17 - reference: <testLibraryFragment>::@class::A - enclosingElement3: <testLibraryFragment> - supertype: Object - mixins - M - allSupertypes - M - Object - mixins - mixin M @6 - reference: <testLibraryFragment>::@mixin::M - enclosingElement3: <testLibraryFragment> - superclassConstraints - Object - allSupertypes - Object ----------------------------------------- -library - reference: <testLibrary> - fragments - <testLibraryFragment> - element: <testLibrary> - classes - class A @17 - reference: <testLibraryFragment>::@class::A - element: <testLibrary>::@class::A - mixins - mixin M @6 - reference: <testLibraryFragment>::@mixin::M - element: <testLibrary>::@mixin::M - classes - class A - reference: <testLibrary>::@class::A - firstFragment: <testLibraryFragment>::@class::A - supertype: Object - mixins - M - allSupertypes - M - Object - mixins - mixin M - reference: <testLibrary>::@mixin::M - firstFragment: <testLibraryFragment>::@mixin::M - superclassConstraints - Object - allSupertypes - Object -'''); - } - - test_allSupertypes_generic() async { - var library = await buildLibrary(r''' -class A<T, U> {} -class B<T> extends A<int, T> {} - -mixin M1 on A<int, double> {} -mixin M2 on B<String> {} -'''); - - configuration - ..withAllSupertypes = true - ..withConstructors = false; - checkElementText(library, r''' -library - reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - classes - class A @6 - reference: <testLibraryFragment>::@class::A - enclosingElement3: <testLibraryFragment> - typeParameters - covariant T @8 - defaultType: dynamic - covariant U @11 - defaultType: dynamic - allSupertypes - Object - class B @23 - reference: <testLibraryFragment>::@class::B - enclosingElement3: <testLibraryFragment> - typeParameters - covariant T @25 - defaultType: dynamic - supertype: A<int, T> - allSupertypes - A<int, T> - Object - mixins - mixin M1 @56 - reference: <testLibraryFragment>::@mixin::M1 - enclosingElement3: <testLibraryFragment> - superclassConstraints - A<int, double> - allSupertypes - A<int, double> - Object - mixin M2 @86 - reference: <testLibraryFragment>::@mixin::M2 - enclosingElement3: <testLibraryFragment> - superclassConstraints - B<String> - allSupertypes - A<int, String> - B<String> - Object ----------------------------------------- -library - reference: <testLibrary> - fragments - <testLibraryFragment> - element: <testLibrary> - classes - class A @6 - reference: <testLibraryFragment>::@class::A - element: <testLibrary>::@class::A - typeParameters - T @8 - element: <not-implemented> - U @11 - element: <not-implemented> - class B @23 - reference: <testLibraryFragment>::@class::B - element: <testLibrary>::@class::B - typeParameters - T @25 - element: <not-implemented> - mixins - mixin M1 @56 - reference: <testLibraryFragment>::@mixin::M1 - element: <testLibrary>::@mixin::M1 - mixin M2 @86 - reference: <testLibraryFragment>::@mixin::M2 - element: <testLibrary>::@mixin::M2 - classes - class A - reference: <testLibrary>::@class::A - firstFragment: <testLibraryFragment>::@class::A - typeParameters - T - U - allSupertypes - Object - class B - reference: <testLibrary>::@class::B - firstFragment: <testLibraryFragment>::@class::B - typeParameters - T - supertype: A<int, T> - allSupertypes - A<int, T> - Object - mixins - mixin M1 - reference: <testLibrary>::@mixin::M1 - firstFragment: <testLibraryFragment>::@mixin::M1 - superclassConstraints - A<int, double> - allSupertypes - A<int, double> - Object - mixin M2 - reference: <testLibrary>::@mixin::M2 - firstFragment: <testLibraryFragment>::@mixin::M2 - superclassConstraints - B<String> - allSupertypes - A<int, String> - B<String> - Object -'''); - } - - test_allSupertypes_hasInterfaces() async { - var library = await buildLibrary(r''' -class A {} -class B {} -class C {} - -mixin M on A implements B, C {} -'''); - - configuration - ..withAllSupertypes = true - ..withConstructors = false; - checkElementText(library, r''' -library - reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - classes - class A @6 - reference: <testLibraryFragment>::@class::A - enclosingElement3: <testLibraryFragment> - allSupertypes - Object - class B @17 - reference: <testLibraryFragment>::@class::B - enclosingElement3: <testLibraryFragment> - allSupertypes - Object - class C @28 - reference: <testLibraryFragment>::@class::C - enclosingElement3: <testLibraryFragment> - allSupertypes - Object - mixins - mixin M @40 - reference: <testLibraryFragment>::@mixin::M - enclosingElement3: <testLibraryFragment> - superclassConstraints - A - interfaces - B - C - allSupertypes - A - B - C - Object ----------------------------------------- -library - reference: <testLibrary> - fragments - <testLibraryFragment> - element: <testLibrary> - classes - class A @6 - reference: <testLibraryFragment>::@class::A - element: <testLibrary>::@class::A - class B @17 - reference: <testLibraryFragment>::@class::B - element: <testLibrary>::@class::B - class C @28 - reference: <testLibraryFragment>::@class::C - element: <testLibrary>::@class::C - mixins - mixin M @40 - reference: <testLibraryFragment>::@mixin::M - element: <testLibrary>::@mixin::M - classes - class A - reference: <testLibrary>::@class::A - firstFragment: <testLibraryFragment>::@class::A - allSupertypes - Object - class B - reference: <testLibrary>::@class::B - firstFragment: <testLibraryFragment>::@class::B - allSupertypes - Object - class C - reference: <testLibrary>::@class::C - firstFragment: <testLibraryFragment>::@class::C - allSupertypes - Object - mixins - mixin M - reference: <testLibrary>::@mixin::M - firstFragment: <testLibraryFragment>::@mixin::M - superclassConstraints - A - interfaces - B - C - allSupertypes - A - B - C - Object -'''); - } - - test_allSupertypes_hasSuperclassConstraints() async { - var library = await buildLibrary(r''' -class A {} -mixin M on A {} -class B with M {} -'''); - - configuration - ..withAllSupertypes = true - ..withConstructors = false; - checkElementText(library, r''' -library - reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - classes - class A @6 - reference: <testLibraryFragment>::@class::A - enclosingElement3: <testLibraryFragment> - allSupertypes - Object - class B @33 - reference: <testLibraryFragment>::@class::B - enclosingElement3: <testLibraryFragment> - supertype: Object - mixins - M - allSupertypes - A - M - Object - mixins - mixin M @17 - reference: <testLibraryFragment>::@mixin::M - enclosingElement3: <testLibraryFragment> - superclassConstraints - A - allSupertypes - A - Object ----------------------------------------- -library - reference: <testLibrary> - fragments - <testLibraryFragment> - element: <testLibrary> - classes - class A @6 - reference: <testLibraryFragment>::@class::A - element: <testLibrary>::@class::A - class B @33 - reference: <testLibraryFragment>::@class::B - element: <testLibrary>::@class::B - mixins - mixin M @17 - reference: <testLibraryFragment>::@mixin::M - element: <testLibrary>::@mixin::M - classes - class A - reference: <testLibrary>::@class::A - firstFragment: <testLibraryFragment>::@class::A - allSupertypes - Object - class B - reference: <testLibrary>::@class::B - firstFragment: <testLibraryFragment>::@class::B - supertype: Object - mixins - M - allSupertypes - A - M - Object - mixins - mixin M - reference: <testLibrary>::@mixin::M - firstFragment: <testLibraryFragment>::@mixin::M - superclassConstraints - A - allSupertypes - A - Object -'''); - } - test_augmentationTarget() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -part 'b.dart'; -augment mixin A {} -'''); - - newFile('$testPackageLibPath/b.dart', r''' -part of 'a.dart'; -augment mixin A {} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A {} + +augment mixin A {} +augment mixin A {} '''); configuration.withExportScope = true; checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - augmented - superclassConstraints - Object - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - parts - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - augment mixin A @50 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - mixins - augment mixin A @32 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - exportedReferences - declared <testLibraryFragment>::@mixin::A - exportNamespace - A: <testLibraryFragment>::@mixin::A ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @50 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 + #F2 mixin A (nameOffset:26) (firstTokenOffset:12) (offset:26) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibrary>::@fragment::package:test/a.dart - previousFragment: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @32 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + previousFragment: #F1 + nextFragment: #F3 + #F3 mixin A (nameOffset:45) (firstTokenOffset:31) (offset:45) element: <testLibrary>::@mixin::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + previousFragment: #F2 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object exportedReferences - declared <testLibraryFragment>::@mixin::A + declared <testLibrary>::@mixin::A exportNamespace - A: <testLibraryFragment>::@mixin::A + A: <testLibrary>::@mixin::A '''); } test_augmentationTarget_augmentationThenDeclaration() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; - -augment class A { + var library = await buildLibrary(r''' +augment mixin A { void foo1() {} } -class A { +mixin A { void foo2() {} } -augment class A { +augment mixin A { void foo3() {} } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - classes - augment class A @36 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0 - methods - foo1 @47 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0::@method::foo1 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0 - returnType: void - class A @66 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentation: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::1 - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::A::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@class::A - methods - foo2 @77 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::A::@method::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@class::A - returnType: void - augmented - constructors - <testLibrary>::@fragment::package:test/a.dart::@class::A::@constructor::new - methods - <testLibrary>::@fragment::package:test/a.dart::@class::A::@method::foo2 - <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::1::@method::foo3 - augment class A @104 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::1 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@class::A - methods - foo3 @115 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::1::@method::foo3 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::1 - returnType: void ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - classes - class A @36 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0 - element: <testLibrary>::@class::A::@def::0 - constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0::@constructor::new - element: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0::@constructor::new#element - typeName: A + mixins + #F1 mixin A (nameOffset:14) (firstTokenOffset:0) (offset:14) + element: <testLibrary>::@mixin::A::@def::0 methods - foo1 @47 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0::@method::foo1 - element: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0::@method::foo1#element - class A @66 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::A - element: <testLibrary>::@class::A::@def::1 - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::1 - constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/a.dart::@class::A::@constructor::new - element: <testLibrary>::@fragment::package:test/a.dart::@class::A::@constructor::new#element - typeName: A + #F2 foo1 (nameOffset:25) (firstTokenOffset:20) (offset:25) + element: <testLibrary>::@mixin::A::@def::0::@method::foo1 + #F3 mixin A (nameOffset:44) (firstTokenOffset:38) (offset:44) + element: <testLibrary>::@mixin::A::@def::1 + nextFragment: #F4 methods - foo2 @77 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::A::@method::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@class::A::@method::foo2#element - class A @104 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::1 - element: <testLibrary>::@class::A::@def::1 - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@class::A + #F5 foo2 (nameOffset:55) (firstTokenOffset:50) (offset:55) + element: <testLibrary>::@mixin::A::@def::1::@method::foo2 + #F4 mixin A (nameOffset:82) (firstTokenOffset:68) (offset:82) + element: <testLibrary>::@mixin::A::@def::1 + previousFragment: #F3 methods - foo3 @115 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::1::@method::foo3 - element: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::1::@method::foo3#element - classes - class A - reference: <testLibrary>::@class::A::@def::0 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0 - constructors - synthetic new - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0::@constructor::new + #F6 foo3 (nameOffset:93) (firstTokenOffset:88) (offset:93) + element: <testLibrary>::@mixin::A::@def::1::@method::foo3 + mixins + mixin A + reference: <testLibrary>::@mixin::A::@def::0 + firstFragment: #F1 + superclassConstraints + Object methods foo1 - reference: <testLibrary>::@class::A::@def::0::@method::foo1 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::0::@method::foo1 - class A - reference: <testLibrary>::@class::A::@def::1 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::A - constructors - synthetic new - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::A::@constructor::new + reference: <testLibrary>::@mixin::A::@def::0::@method::foo1 + firstFragment: #F2 + returnType: void + mixin A + reference: <testLibrary>::@mixin::A::@def::1 + firstFragment: #F3 + superclassConstraints + Object methods foo2 - reference: <testLibrary>::@class::A::@def::1::@method::foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::A::@method::foo2 + reference: <testLibrary>::@mixin::A::@def::1::@method::foo2 + firstFragment: #F5 + returnType: void foo3 - reference: <testLibrary>::@class::A::@def::1::@method::foo3 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@def::1::@method::foo3 + reference: <testLibrary>::@mixin::A::@def::1::@method::foo3 + firstFragment: #F6 + returnType: void '''); } test_augmentationTarget_no2() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -part 'b.dart'; + var library = await buildLibrary(r''' +mixin B {} + augment mixin A { void foo1() {} } -'''); - newFile('$testPackageLibPath/b.dart', r''' -part of 'a.dart'; augment mixin A { void foo2() {} } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin B {} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin B @21 - reference: <testLibraryFragment>::@mixin::B - enclosingElement3: <testLibraryFragment> - superclassConstraints - Object - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - parts - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - augment mixin A @50 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - superclassConstraints - Object - methods - foo1 @61 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::foo1 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: void - augmented - superclassConstraints - Object - methods - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::foo1 - <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@method::foo2 - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - mixins - augment mixin A @32 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - methods - foo2 @43 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@method::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - returnType: void ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin B @21 - reference: <testLibraryFragment>::@mixin::B + #F1 mixin B (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::B - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @50 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F2 mixin A (nameOffset:26) (firstTokenOffset:12) (offset:26) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + nextFragment: #F3 methods - foo1 @61 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::foo1 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::foo1#element - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibrary>::@fragment::package:test/a.dart - previousFragment: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @32 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + #F4 foo1 (nameOffset:37) (firstTokenOffset:32) (offset:37) + element: <testLibrary>::@mixin::A::@method::foo1 + #F3 mixin A (nameOffset:64) (firstTokenOffset:50) (offset:64) element: <testLibrary>::@mixin::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + previousFragment: #F2 methods - foo2 @43 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@method::foo2 - element: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@method::foo2#element + #F5 foo2 (nameOffset:75) (firstTokenOffset:70) (offset:75) + element: <testLibrary>::@mixin::A::@method::foo2 mixins mixin B reference: <testLibrary>::@mixin::B - firstFragment: <testLibraryFragment>::@mixin::B + firstFragment: #F1 superclassConstraints Object mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + firstFragment: #F2 superclassConstraints Object methods foo1 reference: <testLibrary>::@mixin::A::@method::foo1 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::foo1 + firstFragment: #F4 + returnType: void foo2 reference: <testLibrary>::@mixin::A::@method::foo2 - firstFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@method::foo2 + firstFragment: #F5 + returnType: void '''); } test_augmented_field_augment_field() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A { - augment int foo = 1; -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A { int foo = 0; } + +augment mixin A { + augment int foo = 1; +} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - foo @31 - reference: <testLibraryFragment>::@mixin::A::@field::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - shouldUseTypeForInitializerInference: true - id: field_0 - getter: getter_0 - setter: setter_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - synthetic get foo @-1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - synthetic set foo= @-1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _foo @-1 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - <testLibraryFragment>::@mixin::A::@getter::foo - <testLibraryFragment>::@mixin::A::@setter::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - fields - augment foo @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - type: int - shouldUseTypeForInitializerInference: true - id: field_1 - augmentationTarget: <testLibraryFragment>::@mixin::A::@field::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - hasInitializer foo @31 - reference: <testLibraryFragment>::@mixin::A::@field::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - getter2: <testLibraryFragment>::@mixin::A::@getter::foo - setter2: <testLibraryFragment>::@mixin::A::@setter::foo + #F3 hasInitializer foo (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::A::@field::foo + nextFragment: #F4 getters - synthetic get foo - reference: <testLibraryFragment>::@mixin::A::@getter::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element + #F5 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@getter::foo setters - synthetic set foo - reference: <testLibraryFragment>::@mixin::A::@setter::foo - element: <testLibraryFragment>::@mixin::A::@setter::foo#element + #F6 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo formalParameters - _foo - element: <testLibraryFragment>::@mixin::A::@setter::foo::@parameter::_foo#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F7 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo::@formalParameter::value + #F2 mixin A (nameOffset:42) (firstTokenOffset:28) (offset:42) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 fields - augment hasInitializer foo @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@field::foo + #F4 augment hasInitializer foo (nameOffset:60) (firstTokenOffset:60) (offset:60) + element: <testLibrary>::@mixin::A::@field::foo + previousFragment: #F3 mixins - mixin A + hasNonFinalField mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields hasInitializer foo - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo + reference: <testLibrary>::@mixin::A::@field::foo + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo#element - setter: <testLibraryFragment>::@mixin::A::@setter::foo#element + getter: <testLibrary>::@mixin::A::@getter::foo + setter: <testLibrary>::@mixin::A::@setter::foo getters - synthetic get foo - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@getter::foo + firstFragment: #F5 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo setters - synthetic set foo - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@setter::foo + firstFragment: #F6 formalParameters - requiredPositional _foo + #E0 requiredPositional value + firstFragment: #F7 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo '''); } test_augmented_field_augment_field2() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + int foo = 0; +} + augment mixin A { augment int foo = 1; } -'''); - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; augment mixin A { augment int foo = 2; } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -part 'b.dart'; -mixin A { - int foo = 0; -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @36 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - foo @46 - reference: <testLibraryFragment>::@mixin::A::@field::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - shouldUseTypeForInitializerInference: true - id: field_0 - getter: getter_0 - setter: setter_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - synthetic get foo @-1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - synthetic set foo= @-1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _foo @-1 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - <testLibraryFragment>::@mixin::A::@getter::foo - <testLibraryFragment>::@mixin::A::@setter::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - fields - augment foo @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - type: int - shouldUseTypeForInitializerInference: true - id: field_1 - augmentationTarget: <testLibraryFragment>::@mixin::A::@field::foo - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - fields - augment foo @53 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - type: int - shouldUseTypeForInitializerInference: true - id: field_2 - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @36 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - hasInitializer foo @46 - reference: <testLibraryFragment>::@mixin::A::@field::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - getter2: <testLibraryFragment>::@mixin::A::@getter::foo - setter2: <testLibraryFragment>::@mixin::A::@setter::foo + #F3 hasInitializer foo (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::A::@field::foo + nextFragment: #F4 getters - synthetic get foo - reference: <testLibraryFragment>::@mixin::A::@getter::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element + #F5 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@getter::foo setters - synthetic set foo - reference: <testLibraryFragment>::@mixin::A::@setter::foo - element: <testLibraryFragment>::@mixin::A::@setter::foo#element + #F6 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo formalParameters - _foo - element: <testLibraryFragment>::@mixin::A::@setter::foo::@parameter::_foo#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F7 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo::@formalParameter::value + #F2 mixin A (nameOffset:42) (firstTokenOffset:28) (offset:42) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + previousFragment: #F1 + nextFragment: #F8 fields - augment hasInitializer foo @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@field::foo - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + #F4 augment hasInitializer foo (nameOffset:60) (firstTokenOffset:60) (offset:60) + element: <testLibrary>::@mixin::A::@field::foo + previousFragment: #F3 + nextFragment: #F9 + #F8 mixin A (nameOffset:86) (firstTokenOffset:72) (offset:86) element: <testLibrary>::@mixin::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + previousFragment: #F2 fields - augment hasInitializer foo @53 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo + #F9 augment hasInitializer foo (nameOffset:104) (firstTokenOffset:104) (offset:104) + element: <testLibrary>::@mixin::A::@field::foo + previousFragment: #F4 mixins - mixin A + hasNonFinalField mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields hasInitializer foo - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo + reference: <testLibrary>::@mixin::A::@field::foo + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo#element - setter: <testLibraryFragment>::@mixin::A::@setter::foo#element + getter: <testLibrary>::@mixin::A::@getter::foo + setter: <testLibrary>::@mixin::A::@setter::foo getters - synthetic get foo - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@getter::foo + firstFragment: #F5 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo setters - synthetic set foo - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@setter::foo + firstFragment: #F6 formalParameters - requiredPositional _foo + #E0 requiredPositional value + firstFragment: #F7 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo '''); } test_augmented_field_augment_field_afterGetter() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + int foo = 0; +} + augment mixin A { augment int get foo => 1; } -'''); - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; augment mixin A { augment int foo = 2; } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -part 'b.dart'; -mixin A { - int foo = 0; -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @36 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - foo @46 - reference: <testLibraryFragment>::@mixin::A::@field::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - shouldUseTypeForInitializerInference: true - id: field_0 - getter: getter_0 - setter: setter_0 - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - synthetic get foo @-1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - synthetic set foo= @-1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _foo @-1 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - <testLibraryFragment>::@mixin::A::@setter::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - accessors - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: int - id: getter_1 - variable: <null> - augmentationTarget: <testLibraryFragment>::@mixin::A::@getter::foo - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - fields - augment foo @53 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - type: int - shouldUseTypeForInitializerInference: true - id: field_1 - augmentationTarget: <testLibraryFragment>::@mixin::A::@field::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @36 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - hasInitializer foo @46 - reference: <testLibraryFragment>::@mixin::A::@field::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - getter2: <testLibraryFragment>::@mixin::A::@getter::foo - setter2: <testLibraryFragment>::@mixin::A::@setter::foo + #F3 hasInitializer foo (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::A::@field::foo + nextFragment: #F4 getters - synthetic get foo - reference: <testLibraryFragment>::@mixin::A::@getter::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo + #F5 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@getter::foo + nextFragment: #F6 setters - synthetic set foo - reference: <testLibraryFragment>::@mixin::A::@setter::foo - element: <testLibraryFragment>::@mixin::A::@setter::foo#element + #F7 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo formalParameters - _foo - element: <testLibraryFragment>::@mixin::A::@setter::foo::@parameter::_foo#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F8 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo::@formalParameter::value + #F2 mixin A (nameOffset:42) (firstTokenOffset:28) (offset:42) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + previousFragment: #F1 + nextFragment: #F9 getters - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@getter::foo - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + #F6 augment foo (nameOffset:64) (firstTokenOffset:48) (offset:64) + element: <testLibrary>::@mixin::A::@getter::foo + previousFragment: #F5 + #F9 mixin A (nameOffset:91) (firstTokenOffset:77) (offset:91) element: <testLibrary>::@mixin::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + previousFragment: #F2 fields - augment hasInitializer foo @53 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@field::foo + #F4 augment hasInitializer foo (nameOffset:109) (firstTokenOffset:109) (offset:109) + element: <testLibrary>::@mixin::A::@field::foo + previousFragment: #F3 mixins - mixin A + hasNonFinalField mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields hasInitializer foo - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo + reference: <testLibrary>::@mixin::A::@field::foo + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo#element - setter: <testLibraryFragment>::@mixin::A::@setter::foo#element + getter: <testLibrary>::@mixin::A::@getter::foo + setter: <testLibrary>::@mixin::A::@setter::foo getters - synthetic get foo - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@getter::foo + firstFragment: #F5 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo setters - synthetic set foo - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@setter::foo + firstFragment: #F7 formalParameters - requiredPositional _foo + #E0 requiredPositional value + firstFragment: #F8 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo '''); } test_augmented_field_augment_field_afterSetter() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + int foo = 0; +} + augment mixin A { augment set foo(int _) {} } -'''); - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; augment mixin A { augment int foo = 2; } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -part 'b.dart'; -mixin A { - int foo = 0; -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @36 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - foo @46 - reference: <testLibraryFragment>::@mixin::A::@field::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - shouldUseTypeForInitializerInference: true - id: field_0 - getter: getter_0 - setter: setter_0 - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - synthetic get foo @-1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - synthetic set foo= @-1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _foo @-1 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo - augmented - superclassConstraints - Object - fields - <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - <testLibraryFragment>::@mixin::A::@getter::foo - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - accessors - augment set foo= @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - parameters - requiredPositional _ @61 - type: int - returnType: void - id: setter_1 - variable: <null> - augmentationTarget: <testLibraryFragment>::@mixin::A::@setter::foo - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - fields - augment foo @53 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - type: int - shouldUseTypeForInitializerInference: true - id: field_1 - augmentationTarget: <testLibraryFragment>::@mixin::A::@field::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @36 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - hasInitializer foo @46 - reference: <testLibraryFragment>::@mixin::A::@field::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - getter2: <testLibraryFragment>::@mixin::A::@getter::foo - setter2: <testLibraryFragment>::@mixin::A::@setter::foo + #F3 hasInitializer foo (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::A::@field::foo + nextFragment: #F4 getters - synthetic get foo - reference: <testLibraryFragment>::@mixin::A::@getter::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element + #F5 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@getter::foo setters - synthetic set foo - reference: <testLibraryFragment>::@mixin::A::@setter::foo - element: <testLibraryFragment>::@mixin::A::@setter::foo#element + #F6 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo formalParameters - _foo - element: <testLibraryFragment>::@mixin::A::@setter::foo::@parameter::_foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F7 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo::@formalParameter::value + nextFragment: #F8 + #F2 mixin A (nameOffset:42) (firstTokenOffset:28) (offset:42) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + previousFragment: #F1 + nextFragment: #F9 setters - augment set foo @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@setter::foo#element + #F8 augment foo (nameOffset:60) (firstTokenOffset:48) (offset:60) + element: <testLibrary>::@mixin::A::@setter::foo formalParameters - _ @61 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo::@parameter::_#element - previousFragment: <testLibraryFragment>::@mixin::A::@setter::foo - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + #F10 _ (nameOffset:68) (firstTokenOffset:64) (offset:68) + element: <testLibrary>::@mixin::A::@setter::foo::@formalParameter::_ + previousFragment: #F6 + #F9 mixin A (nameOffset:91) (firstTokenOffset:77) (offset:91) element: <testLibrary>::@mixin::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + previousFragment: #F2 fields - augment hasInitializer foo @53 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@fieldAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@field::foo + #F4 augment hasInitializer foo (nameOffset:109) (firstTokenOffset:109) (offset:109) + element: <testLibrary>::@mixin::A::@field::foo + previousFragment: #F3 mixins - mixin A + hasNonFinalField mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields hasInitializer foo - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo + reference: <testLibrary>::@mixin::A::@field::foo + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo#element - setter: <testLibraryFragment>::@mixin::A::@setter::foo#element + getter: <testLibrary>::@mixin::A::@getter::foo + setter: <testLibrary>::@mixin::A::@setter::foo getters - synthetic get foo - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@getter::foo + firstFragment: #F5 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo setters - synthetic set foo - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@setter::foo + firstFragment: #F6 formalParameters - requiredPositional _foo + #E0 requiredPositional value + firstFragment: #F7 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo '''); } test_augmented_field_augment_field_differentTypes() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + int foo = 0; +} + augment mixin A { augment double foo = 1.2; } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A { - int foo = 0; -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - foo @31 - reference: <testLibraryFragment>::@mixin::A::@field::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - shouldUseTypeForInitializerInference: true - id: field_0 - getter: getter_0 - setter: setter_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - synthetic get foo @-1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - synthetic set foo= @-1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _foo @-1 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - <testLibraryFragment>::@mixin::A::@getter::foo - <testLibraryFragment>::@mixin::A::@setter::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - fields - augment foo @56 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - type: double - shouldUseTypeForInitializerInference: true - id: field_1 - augmentationTarget: <testLibraryFragment>::@mixin::A::@field::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - hasInitializer foo @31 - reference: <testLibraryFragment>::@mixin::A::@field::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - getter2: <testLibraryFragment>::@mixin::A::@getter::foo - setter2: <testLibraryFragment>::@mixin::A::@setter::foo + #F3 hasInitializer foo (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::A::@field::foo + nextFragment: #F4 getters - synthetic get foo - reference: <testLibraryFragment>::@mixin::A::@getter::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element + #F5 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@getter::foo setters - synthetic set foo - reference: <testLibraryFragment>::@mixin::A::@setter::foo - element: <testLibraryFragment>::@mixin::A::@setter::foo#element + #F6 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo formalParameters - _foo - element: <testLibraryFragment>::@mixin::A::@setter::foo::@parameter::_foo#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F7 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo::@formalParameter::value + #F2 mixin A (nameOffset:42) (firstTokenOffset:28) (offset:42) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 fields - augment hasInitializer foo @56 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@field::foo + #F4 augment hasInitializer foo (nameOffset:63) (firstTokenOffset:63) (offset:63) + element: <testLibrary>::@mixin::A::@field::foo + previousFragment: #F3 mixins - mixin A + hasNonFinalField mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields hasInitializer foo - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo + reference: <testLibrary>::@mixin::A::@field::foo + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo#element - setter: <testLibraryFragment>::@mixin::A::@setter::foo#element + getter: <testLibrary>::@mixin::A::@getter::foo + setter: <testLibrary>::@mixin::A::@setter::foo getters - synthetic get foo - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@getter::foo + firstFragment: #F5 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo setters - synthetic set foo - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@setter::foo + firstFragment: #F6 formalParameters - requiredPositional _foo + #E0 requiredPositional value + firstFragment: #F7 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo '''); } /// This is not allowed by the specification, but allowed syntactically, /// so we need a way to handle it. test_augmented_field_augment_getter() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + int get foo => 0; +} + augment mixin A { augment int foo = 1; } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A { - int get foo => 0; -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - synthetic foo @-1 - reference: <testLibraryFragment>::@mixin::A::@field::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - id: field_0 - getter: getter_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - get foo @35 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - accessors - <testLibraryFragment>::@mixin::A::@getter::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - fields - augment foo @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - type: int - shouldUseTypeForInitializerInference: true - id: field_1 - augmentationTarget: <testLibraryFragment>::@mixin::A::@field::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - synthetic foo - reference: <testLibraryFragment>::@mixin::A::@field::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - getter2: <testLibraryFragment>::@mixin::A::@getter::foo + #F3 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:6) + element: <testLibrary>::@mixin::A::@field::foo + nextFragment: #F4 getters - get foo @35 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F5 foo (nameOffset:20) (firstTokenOffset:12) (offset:20) + element: <testLibrary>::@mixin::A::@getter::foo + #F2 mixin A (nameOffset:47) (firstTokenOffset:33) (offset:47) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 fields - augment hasInitializer foo @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@fieldAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@field::foo + #F4 augment hasInitializer foo (nameOffset:65) (firstTokenOffset:65) (offset:65) + element: <testLibrary>::@mixin::A::@field::foo + previousFragment: #F3 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields synthetic hasInitializer foo - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo + reference: <testLibrary>::@mixin::A::@field::foo + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo#element + getter: <testLibrary>::@mixin::A::@getter::foo getters - get foo - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo + foo + reference: <testLibrary>::@mixin::A::@getter::foo + firstFragment: #F5 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo '''); } test_augmented_fields_add() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + int foo1 = 0; +} + augment mixin A { int foo2 = 0; } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A { - int foo1 = 0; -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - foo1 @31 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - shouldUseTypeForInitializerInference: true - id: field_0 - getter: getter_0 - setter: setter_0 - accessors - synthetic get foo1 @-1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - synthetic set foo1= @-1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _foo1 @-1 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo1 - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - accessors - <testLibraryFragment>::@mixin::A::@getter::foo1 - <testLibraryFragment>::@mixin::A::@setter::foo1 - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - fields - foo2 @45 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - type: int - shouldUseTypeForInitializerInference: true - id: field_1 - getter: getter_1 - setter: setter_1 - accessors - synthetic get foo2 @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: int - id: getter_1 - variable: field_1 - synthetic set foo2= @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - parameters - requiredPositional _foo2 @-1 - type: int - returnType: void - id: setter_1 - variable: field_1 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - hasInitializer foo1 @31 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - element: <testLibraryFragment>::@mixin::A::@field::foo1#element - getter2: <testLibraryFragment>::@mixin::A::@getter::foo1 - setter2: <testLibraryFragment>::@mixin::A::@setter::foo1 + #F3 hasInitializer foo1 (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::A::@field::foo1 getters - synthetic get foo1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo1 - element: <testLibraryFragment>::@mixin::A::@getter::foo1#element + #F4 synthetic foo1 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@getter::foo1 setters - synthetic set foo1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo1 - element: <testLibraryFragment>::@mixin::A::@setter::foo1#element + #F5 synthetic foo1 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo1 formalParameters - _foo1 - element: <testLibraryFragment>::@mixin::A::@setter::foo1::@parameter::_foo1#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F6 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo1::@formalParameter::value + #F2 mixin A (nameOffset:43) (firstTokenOffset:29) (offset:43) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 fields - hasInitializer foo2 @45 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2#element - getter2: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - setter2: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 + #F7 hasInitializer foo2 (nameOffset:53) (firstTokenOffset:53) (offset:53) + element: <testLibrary>::@mixin::A::@field::foo2 getters - synthetic get foo2 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2#element + #F8 synthetic foo2 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:53) + element: <testLibrary>::@mixin::A::@getter::foo2 setters - synthetic set foo2 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2#element + #F9 synthetic foo2 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:53) + element: <testLibrary>::@mixin::A::@setter::foo2 formalParameters - _foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2::@parameter::_foo2#element + #F10 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:53) + element: <testLibrary>::@mixin::A::@setter::foo2::@formalParameter::value mixins - mixin A + hasNonFinalField mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields hasInitializer foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo1 + reference: <testLibrary>::@mixin::A::@field::foo1 + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo1#element - setter: <testLibraryFragment>::@mixin::A::@setter::foo1#element + getter: <testLibrary>::@mixin::A::@getter::foo1 + setter: <testLibrary>::@mixin::A::@setter::foo1 hasInitializer foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 + reference: <testLibrary>::@mixin::A::@field::foo2 + firstFragment: #F7 type: int - getter: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2#element - setter: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2#element + getter: <testLibrary>::@mixin::A::@getter::foo2 + setter: <testLibrary>::@mixin::A::@setter::foo2 getters - synthetic get foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo1 - synthetic get foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 + synthetic foo1 + reference: <testLibrary>::@mixin::A::@getter::foo1 + firstFragment: #F4 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo1 + synthetic foo2 + reference: <testLibrary>::@mixin::A::@getter::foo2 + firstFragment: #F8 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo2 setters - synthetic set foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo1 + synthetic foo1 + reference: <testLibrary>::@mixin::A::@setter::foo1 + firstFragment: #F5 formalParameters - requiredPositional _foo1 + #E0 requiredPositional value + firstFragment: #F6 type: int - synthetic set foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo1 + synthetic foo2 + reference: <testLibrary>::@mixin::A::@setter::foo2 + firstFragment: #F9 formalParameters - requiredPositional _foo2 + #E1 requiredPositional value + firstFragment: #F10 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo2 '''); } test_augmented_fields_add_generic() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A<T1> { - T1 foo2; -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A<T1> { - T1 foo1; +mixin A<T> { + T foo1; +} + +augment mixin A<T> { + T foo2; } '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - typeParameters - covariant T1 @23 - defaultType: dynamic - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - foo1 @34 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - type: T1 - id: field_0 - getter: getter_0 - setter: setter_0 - accessors - synthetic get foo1 @-1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: T1 - id: getter_0 - variable: field_0 - synthetic set foo1= @-1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _foo1 @-1 - type: T1 - returnType: void - id: setter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo1 - FieldMember - base: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - augmentationSubstitution: {T1: T1} - accessors - <testLibraryFragment>::@mixin::A::@getter::foo1 - <testLibraryFragment>::@mixin::A::@setter::foo1 - GetterMember - base: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - augmentationSubstitution: {T1: T1} - SetterMember - base: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 - augmentationSubstitution: {T1: T1} - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - typeParameters - covariant T1 @37 - defaultType: dynamic - augmentationTarget: <testLibraryFragment>::@mixin::A - fields - foo2 @48 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - type: T1 - id: field_1 - getter: getter_1 - setter: setter_1 - accessors - synthetic get foo2 @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: T1 - id: getter_1 - variable: field_1 - synthetic set foo2= @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - parameters - requiredPositional _foo2 @-1 - type: T1 - returnType: void - id: setter_1 - variable: field_1 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 typeParameters - T1 @23 - element: <not-implemented> + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 fields - foo1 @34 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - element: <testLibraryFragment>::@mixin::A::@field::foo1#element - getter2: <testLibraryFragment>::@mixin::A::@getter::foo1 - setter2: <testLibraryFragment>::@mixin::A::@setter::foo1 + #F5 foo1 (nameOffset:17) (firstTokenOffset:17) (offset:17) + element: <testLibrary>::@mixin::A::@field::foo1 getters - synthetic get foo1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo1 - element: <testLibraryFragment>::@mixin::A::@getter::foo1#element + #F6 synthetic foo1 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:17) + element: <testLibrary>::@mixin::A::@getter::foo1 setters - synthetic set foo1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo1 - element: <testLibraryFragment>::@mixin::A::@setter::foo1#element + #F7 synthetic foo1 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:17) + element: <testLibrary>::@mixin::A::@setter::foo1 formalParameters - _foo1 - element: <testLibraryFragment>::@mixin::A::@setter::foo1::@parameter::_foo1#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F8 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:17) + element: <testLibrary>::@mixin::A::@setter::foo1::@formalParameter::value + #F2 mixin A (nameOffset:40) (firstTokenOffset:26) (offset:40) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 typeParameters - T1 @37 - element: <not-implemented> + #F4 T (nameOffset:42) (firstTokenOffset:42) (offset:42) + element: #E0 T + previousFragment: #F3 fields - foo2 @48 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2#element - getter2: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - setter2: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 + #F9 foo2 (nameOffset:51) (firstTokenOffset:51) (offset:51) + element: <testLibrary>::@mixin::A::@field::foo2 getters - synthetic get foo2 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2#element + #F10 synthetic foo2 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:51) + element: <testLibrary>::@mixin::A::@getter::foo2 setters - synthetic set foo2 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2#element + #F11 synthetic foo2 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:51) + element: <testLibrary>::@mixin::A::@setter::foo2 formalParameters - _foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2::@parameter::_foo2#element + #F12 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:51) + element: <testLibrary>::@mixin::A::@setter::foo2::@formalParameter::value mixins - mixin A + hasNonFinalField mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 typeParameters - T1 + #E0 T + firstFragment: #F3 superclassConstraints Object fields foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo1 - type: T1 - getter: <testLibraryFragment>::@mixin::A::@getter::foo1#element - setter: <testLibraryFragment>::@mixin::A::@setter::foo1#element + reference: <testLibrary>::@mixin::A::@field::foo1 + firstFragment: #F5 + hasEnclosingTypeParameterReference: true + type: T + getter: <testLibrary>::@mixin::A::@getter::foo1 + setter: <testLibrary>::@mixin::A::@setter::foo1 foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - type: T1 - getter: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2#element - setter: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2#element + reference: <testLibrary>::@mixin::A::@field::foo2 + firstFragment: #F9 + hasEnclosingTypeParameterReference: true + type: T + getter: <testLibrary>::@mixin::A::@getter::foo2 + setter: <testLibrary>::@mixin::A::@setter::foo2 getters - synthetic get foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo1 - synthetic get foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 + synthetic foo1 + reference: <testLibrary>::@mixin::A::@getter::foo1 + firstFragment: #F6 + hasEnclosingTypeParameterReference: true + returnType: T + variable: <testLibrary>::@mixin::A::@field::foo1 + synthetic foo2 + reference: <testLibrary>::@mixin::A::@getter::foo2 + firstFragment: #F10 + hasEnclosingTypeParameterReference: true + returnType: T + variable: <testLibrary>::@mixin::A::@field::foo2 setters - synthetic set foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo1 + synthetic foo1 + reference: <testLibrary>::@mixin::A::@setter::foo1 + firstFragment: #F7 + hasEnclosingTypeParameterReference: true formalParameters - requiredPositional _foo1 - type: T1 - synthetic set foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 + #E1 requiredPositional value + firstFragment: #F8 + type: T + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo1 + synthetic foo2 + reference: <testLibrary>::@mixin::A::@setter::foo2 + firstFragment: #F11 + hasEnclosingTypeParameterReference: true formalParameters - requiredPositional _foo2 - type: T1 + #E2 requiredPositional value + firstFragment: #F12 + type: T + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo2 '''); } test_augmented_getters_add() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + int get foo1 => 0; +} + augment mixin A { int get foo2 => 0; } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A { - int get foo1 => 0; -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - synthetic foo1 @-1 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - id: field_0 - getter: getter_0 - accessors - get foo1 @35 - reference: <testLibraryFragment>::@mixin::A::@getter::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo1 - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - accessors - <testLibraryFragment>::@mixin::A::@getter::foo1 - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - fields - synthetic foo2 @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - type: int - id: field_1 - getter: getter_1 - accessors - get foo2 @49 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: int - id: getter_1 - variable: field_1 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - synthetic foo1 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - element: <testLibraryFragment>::@mixin::A::@field::foo1#element - getter2: <testLibraryFragment>::@mixin::A::@getter::foo1 + #F3 synthetic foo1 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:6) + element: <testLibrary>::@mixin::A::@field::foo1 getters - get foo1 @35 - reference: <testLibraryFragment>::@mixin::A::@getter::foo1 - element: <testLibraryFragment>::@mixin::A::@getter::foo1#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F4 foo1 (nameOffset:20) (firstTokenOffset:12) (offset:20) + element: <testLibrary>::@mixin::A::@getter::foo1 + #F2 mixin A (nameOffset:48) (firstTokenOffset:34) (offset:48) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 fields - synthetic foo2 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2#element - getter2: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 + #F5 synthetic foo2 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:48) + element: <testLibrary>::@mixin::A::@field::foo2 getters - get foo2 @49 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2#element + #F6 foo2 (nameOffset:62) (firstTokenOffset:54) (offset:62) + element: <testLibrary>::@mixin::A::@getter::foo2 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields synthetic foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo1 + reference: <testLibrary>::@mixin::A::@field::foo1 + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo1#element + getter: <testLibrary>::@mixin::A::@getter::foo1 synthetic foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 + reference: <testLibrary>::@mixin::A::@field::foo2 + firstFragment: #F5 type: int - getter: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2#element + getter: <testLibrary>::@mixin::A::@getter::foo2 getters - get foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo1 - get foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 + foo1 + reference: <testLibrary>::@mixin::A::@getter::foo1 + firstFragment: #F4 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo1 + foo2 + reference: <testLibrary>::@mixin::A::@getter::foo2 + firstFragment: #F6 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo2 '''); } test_augmented_getters_add_generic() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A<T1> { - T1 get foo2; -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A<T1> { - T1 get foo1; +mixin A<T> { + T get foo1; +} + +augment mixin A<T> { + T get foo2; } '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - typeParameters - covariant T1 @23 - defaultType: dynamic - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - synthetic foo1 @-1 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - type: T1 - id: field_0 - getter: getter_0 - accessors - abstract get foo1 @38 - reference: <testLibraryFragment>::@mixin::A::@getter::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: T1 - id: getter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo1 - FieldMember - base: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - augmentationSubstitution: {T1: T1} - accessors - <testLibraryFragment>::@mixin::A::@getter::foo1 - GetterMember - base: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - augmentationSubstitution: {T1: T1} - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - typeParameters - covariant T1 @37 - defaultType: dynamic - augmentationTarget: <testLibraryFragment>::@mixin::A - fields - synthetic foo2 @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - type: T1 - id: field_1 - getter: getter_1 - accessors - abstract get foo2 @52 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: T1 - id: getter_1 - variable: field_1 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 typeParameters - T1 @23 - element: <not-implemented> + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 fields - synthetic foo1 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - element: <testLibraryFragment>::@mixin::A::@field::foo1#element - getter2: <testLibraryFragment>::@mixin::A::@getter::foo1 + #F5 synthetic foo1 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:6) + element: <testLibrary>::@mixin::A::@field::foo1 getters - get foo1 @38 - reference: <testLibraryFragment>::@mixin::A::@getter::foo1 - element: <testLibraryFragment>::@mixin::A::@getter::foo1#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F6 foo1 (nameOffset:21) (firstTokenOffset:15) (offset:21) + element: <testLibrary>::@mixin::A::@getter::foo1 + #F2 mixin A (nameOffset:44) (firstTokenOffset:30) (offset:44) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 typeParameters - T1 @37 - element: <not-implemented> + #F4 T (nameOffset:46) (firstTokenOffset:46) (offset:46) + element: #E0 T + previousFragment: #F3 fields - synthetic foo2 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2#element - getter2: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 + #F7 synthetic foo2 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:44) + element: <testLibrary>::@mixin::A::@field::foo2 getters - get foo2 @52 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2#element + #F8 foo2 (nameOffset:59) (firstTokenOffset:53) (offset:59) + element: <testLibrary>::@mixin::A::@getter::foo2 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 typeParameters - T1 + #E0 T + firstFragment: #F3 superclassConstraints Object fields synthetic foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo1 - type: T1 - getter: <testLibraryFragment>::@mixin::A::@getter::foo1#element + reference: <testLibrary>::@mixin::A::@field::foo1 + firstFragment: #F5 + hasEnclosingTypeParameterReference: true + type: T + getter: <testLibrary>::@mixin::A::@getter::foo1 synthetic foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - type: T1 - getter: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2#element + reference: <testLibrary>::@mixin::A::@field::foo2 + firstFragment: #F7 + hasEnclosingTypeParameterReference: true + type: T + getter: <testLibrary>::@mixin::A::@getter::foo2 getters - abstract get foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo1 - abstract get foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getter::foo2 + abstract foo1 + reference: <testLibrary>::@mixin::A::@getter::foo1 + firstFragment: #F6 + hasEnclosingTypeParameterReference: true + returnType: T + variable: <testLibrary>::@mixin::A::@field::foo1 + abstract foo2 + reference: <testLibrary>::@mixin::A::@getter::foo2 + firstFragment: #F8 + hasEnclosingTypeParameterReference: true + returnType: T + variable: <testLibrary>::@mixin::A::@field::foo2 '''); } test_augmented_getters_augment_field() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A { - augment int get foo => 0; -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A { int foo = 0; } + +augment mixin A { + augment int get foo => 0; +} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - foo @31 - reference: <testLibraryFragment>::@mixin::A::@field::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - shouldUseTypeForInitializerInference: true - id: field_0 - getter: getter_0 - setter: setter_0 - accessors - synthetic get foo @-1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - synthetic set foo= @-1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _foo @-1 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo - accessors - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - <testLibraryFragment>::@mixin::A::@setter::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - accessors - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: int - id: getter_1 - variable: <null> - augmentationTarget: <testLibraryFragment>::@mixin::A::@getter::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - hasInitializer foo @31 - reference: <testLibraryFragment>::@mixin::A::@field::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - getter2: <testLibraryFragment>::@mixin::A::@getter::foo - setter2: <testLibraryFragment>::@mixin::A::@setter::foo + #F3 hasInitializer foo (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::A::@field::foo getters - synthetic get foo - reference: <testLibraryFragment>::@mixin::A::@getter::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo + #F4 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@getter::foo + nextFragment: #F5 setters - synthetic set foo - reference: <testLibraryFragment>::@mixin::A::@setter::foo - element: <testLibraryFragment>::@mixin::A::@setter::foo#element + #F6 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo formalParameters - _foo - element: <testLibraryFragment>::@mixin::A::@setter::foo::@parameter::_foo#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F7 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo::@formalParameter::value + #F2 mixin A (nameOffset:42) (firstTokenOffset:28) (offset:42) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 getters - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@getter::foo + #F5 augment foo (nameOffset:64) (firstTokenOffset:48) (offset:64) + element: <testLibrary>::@mixin::A::@getter::foo + previousFragment: #F4 mixins - mixin A + hasNonFinalField mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields hasInitializer foo - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo + reference: <testLibrary>::@mixin::A::@field::foo + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo#element - setter: <testLibraryFragment>::@mixin::A::@setter::foo#element + getter: <testLibrary>::@mixin::A::@getter::foo + setter: <testLibrary>::@mixin::A::@setter::foo getters - synthetic get foo - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@getter::foo + firstFragment: #F4 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo setters - synthetic set foo - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@setter::foo + firstFragment: #F6 formalParameters - requiredPositional _foo + #E0 requiredPositional value + firstFragment: #F7 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo '''); } test_augmented_getters_augment_field2() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A { - augment int get foo => 0; -} -'''); - - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; -augment mixin A { - augment int get foo => 0; -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; -part 'b.dart'; mixin A { int foo = 0; } + +augment mixin A { + augment int get foo => 0; +} + +augment mixin A { + augment int get foo => 0; +} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @36 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - foo @46 - reference: <testLibraryFragment>::@mixin::A::@field::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - shouldUseTypeForInitializerInference: true - id: field_0 - getter: getter_0 - setter: setter_0 - accessors - synthetic get foo @-1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - synthetic set foo= @-1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _foo @-1 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo - accessors - <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@getterAugmentation::foo - <testLibraryFragment>::@mixin::A::@setter::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - accessors - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: int - id: getter_1 - variable: <null> - augmentationTarget: <testLibraryFragment>::@mixin::A::@getter::foo - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@getterAugmentation::foo - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - accessors - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@getterAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - returnType: int - id: getter_2 - variable: <null> - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @36 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - hasInitializer foo @46 - reference: <testLibraryFragment>::@mixin::A::@field::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - getter2: <testLibraryFragment>::@mixin::A::@getter::foo - setter2: <testLibraryFragment>::@mixin::A::@setter::foo + #F3 hasInitializer foo (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::A::@field::foo getters - synthetic get foo - reference: <testLibraryFragment>::@mixin::A::@getter::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo + #F4 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@getter::foo + nextFragment: #F5 setters - synthetic set foo - reference: <testLibraryFragment>::@mixin::A::@setter::foo - element: <testLibraryFragment>::@mixin::A::@setter::foo#element + #F6 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo formalParameters - _foo - element: <testLibraryFragment>::@mixin::A::@setter::foo::@parameter::_foo#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F7 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo::@formalParameter::value + #F2 mixin A (nameOffset:42) (firstTokenOffset:28) (offset:42) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + previousFragment: #F1 + nextFragment: #F8 getters - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@getter::foo - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@getterAugmentation::foo - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + #F5 augment foo (nameOffset:64) (firstTokenOffset:48) (offset:64) + element: <testLibrary>::@mixin::A::@getter::foo + previousFragment: #F4 + nextFragment: #F9 + #F8 mixin A (nameOffset:91) (firstTokenOffset:77) (offset:91) element: <testLibrary>::@mixin::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + previousFragment: #F2 getters - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@getterAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo + #F9 augment foo (nameOffset:113) (firstTokenOffset:97) (offset:113) + element: <testLibrary>::@mixin::A::@getter::foo + previousFragment: #F5 mixins - mixin A + hasNonFinalField mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields hasInitializer foo - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo + reference: <testLibrary>::@mixin::A::@field::foo + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo#element - setter: <testLibraryFragment>::@mixin::A::@setter::foo#element + getter: <testLibrary>::@mixin::A::@getter::foo + setter: <testLibrary>::@mixin::A::@setter::foo getters - synthetic get foo - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@getter::foo + firstFragment: #F4 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo setters - synthetic set foo - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@setter::foo + firstFragment: #F6 formalParameters - requiredPositional _foo + #E0 requiredPositional value + firstFragment: #F7 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo '''); } test_augmented_getters_augment_getter() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + int get foo1 => 0; + int get foo2 => 0; +} + augment mixin A { augment int get foo1 => 0; } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A { - int get foo1 => 0; - int get foo2 => 0; -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - synthetic foo1 @-1 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - id: field_0 - getter: getter_0 - synthetic foo2 @-1 - reference: <testLibraryFragment>::@mixin::A::@field::foo2 - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - id: field_1 - getter: getter_1 - accessors - get foo1 @35 - reference: <testLibraryFragment>::@mixin::A::@getter::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo1 - get foo2 @56 - reference: <testLibraryFragment>::@mixin::A::@getter::foo2 - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_1 - variable: field_1 - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo1 - <testLibraryFragment>::@mixin::A::@field::foo2 - accessors - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo1 - <testLibraryFragment>::@mixin::A::@getter::foo2 - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - accessors - augment get foo1 @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo1 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: int - id: getter_2 - variable: <null> - augmentationTarget: <testLibraryFragment>::@mixin::A::@getter::foo1 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - synthetic foo1 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - element: <testLibraryFragment>::@mixin::A::@field::foo1#element - getter2: <testLibraryFragment>::@mixin::A::@getter::foo1 - synthetic foo2 - reference: <testLibraryFragment>::@mixin::A::@field::foo2 - element: <testLibraryFragment>::@mixin::A::@field::foo2#element - getter2: <testLibraryFragment>::@mixin::A::@getter::foo2 + #F3 synthetic foo1 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:6) + element: <testLibrary>::@mixin::A::@field::foo1 + #F4 synthetic foo2 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:6) + element: <testLibrary>::@mixin::A::@field::foo2 getters - get foo1 @35 - reference: <testLibraryFragment>::@mixin::A::@getter::foo1 - element: <testLibraryFragment>::@mixin::A::@getter::foo1#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo1 - get foo2 @56 - reference: <testLibraryFragment>::@mixin::A::@getter::foo2 - element: <testLibraryFragment>::@mixin::A::@getter::foo2#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F5 foo1 (nameOffset:20) (firstTokenOffset:12) (offset:20) + element: <testLibrary>::@mixin::A::@getter::foo1 + nextFragment: #F6 + #F7 foo2 (nameOffset:41) (firstTokenOffset:33) (offset:41) + element: <testLibrary>::@mixin::A::@getter::foo2 + #F2 mixin A (nameOffset:69) (firstTokenOffset:55) (offset:69) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 getters - augment get foo1 @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo1 - element: <testLibraryFragment>::@mixin::A::@getter::foo1#element - previousFragment: <testLibraryFragment>::@mixin::A::@getter::foo1 + #F6 augment foo1 (nameOffset:91) (firstTokenOffset:75) (offset:91) + element: <testLibrary>::@mixin::A::@getter::foo1 + previousFragment: #F5 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields synthetic foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo1 + reference: <testLibrary>::@mixin::A::@field::foo1 + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo1#element + getter: <testLibrary>::@mixin::A::@getter::foo1 synthetic foo2 - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo2 + reference: <testLibrary>::@mixin::A::@field::foo2 + firstFragment: #F4 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo2#element + getter: <testLibrary>::@mixin::A::@getter::foo2 getters - get foo2 - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo2 - get foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo1 + foo1 + reference: <testLibrary>::@mixin::A::@getter::foo1 + firstFragment: #F5 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo1 + foo2 + reference: <testLibrary>::@mixin::A::@getter::foo2 + firstFragment: #F7 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo2 '''); } test_augmented_getters_augment_getter2() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A { - augment int get foo => 0; -} -'''); - - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; -augment mixin A { - augment int get foo => 0; -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; -part 'b.dart'; mixin A { int get foo => 0; } + +augment mixin A { + augment int get foo => 0; +} + +augment mixin A { + augment int get foo => 0; +} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @36 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - synthetic foo @-1 - reference: <testLibraryFragment>::@mixin::A::@field::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - id: field_0 - getter: getter_0 - accessors - get foo @50 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo - accessors - <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@getterAugmentation::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - accessors - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: int - id: getter_1 - variable: <null> - augmentationTarget: <testLibraryFragment>::@mixin::A::@getter::foo - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@getterAugmentation::foo - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - accessors - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@getterAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - returnType: int - id: getter_2 - variable: <null> - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @36 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - synthetic foo - reference: <testLibraryFragment>::@mixin::A::@field::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - getter2: <testLibraryFragment>::@mixin::A::@getter::foo + #F3 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:6) + element: <testLibrary>::@mixin::A::@field::foo getters - get foo @50 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F4 foo (nameOffset:20) (firstTokenOffset:12) (offset:20) + element: <testLibrary>::@mixin::A::@getter::foo + nextFragment: #F5 + #F2 mixin A (nameOffset:47) (firstTokenOffset:33) (offset:47) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + previousFragment: #F1 + nextFragment: #F6 getters - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@getter::foo - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@getterAugmentation::foo - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + #F5 augment foo (nameOffset:69) (firstTokenOffset:53) (offset:69) + element: <testLibrary>::@mixin::A::@getter::foo + previousFragment: #F4 + nextFragment: #F7 + #F6 mixin A (nameOffset:96) (firstTokenOffset:82) (offset:96) element: <testLibrary>::@mixin::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + previousFragment: #F2 getters - augment get foo @57 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@getterAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@getterAugmentation::foo + #F7 augment foo (nameOffset:118) (firstTokenOffset:102) (offset:118) + element: <testLibrary>::@mixin::A::@getter::foo + previousFragment: #F5 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields synthetic foo - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo + reference: <testLibrary>::@mixin::A::@field::foo + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo#element + getter: <testLibrary>::@mixin::A::@getter::foo getters - get foo - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo + foo + reference: <testLibrary>::@mixin::A::@getter::foo + firstFragment: #F4 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo '''); } test_augmented_interfaces() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A implements I2 {} -class I2 {} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A implements I1 {} class I1 {} + +augment mixin A implements I2 {} +class I2 {} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - classes - class I1 @46 - reference: <testLibraryFragment>::@class::I1 - enclosingElement3: <testLibraryFragment> - constructors - synthetic @-1 - reference: <testLibraryFragment>::@class::I1::@constructor::new - enclosingElement3: <testLibraryFragment>::@class::I1 - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - interfaces - I1 - augmented - superclassConstraints - Object - interfaces - I1 - I2 - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - classes - class I2 @60 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@class::I2 - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - interfaces - I2 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart classes - class I1 @46 - reference: <testLibraryFragment>::@class::I1 + #F1 class I1 (nameOffset:31) (firstTokenOffset:25) (offset:31) element: <testLibrary>::@class::I1 constructors - synthetic new - reference: <testLibraryFragment>::@class::I1::@constructor::new - element: <testLibraryFragment>::@class::I1::@constructor::new#element + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:31) + element: <testLibrary>::@class::I1::@constructor::new typeName: I1 - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - classes - class I2 @60 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2 + #F3 class I2 (nameOffset:77) (firstTokenOffset:71) (offset:77) element: <testLibrary>::@class::I2 constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new - element: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new#element + #F4 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:77) + element: <testLibrary>::@class::I2::@constructor::new typeName: I2 mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F5 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + nextFragment: #F6 + #F6 mixin A (nameOffset:52) (firstTokenOffset:38) (offset:52) + element: <testLibrary>::@mixin::A + previousFragment: #F5 classes class I1 reference: <testLibrary>::@class::I1 - firstFragment: <testLibraryFragment>::@class::I1 + firstFragment: #F1 constructors synthetic new - firstFragment: <testLibraryFragment>::@class::I1::@constructor::new + reference: <testLibrary>::@class::I1::@constructor::new + firstFragment: #F2 class I2 reference: <testLibrary>::@class::I2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::I2 + firstFragment: #F3 constructors synthetic new - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new + reference: <testLibrary>::@class::I2::@constructor::new + firstFragment: #F4 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F5 superclassConstraints Object interfaces @@ -5143,183 +3429,79 @@ } test_augmented_interfaces_chain() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -part 'b.dart'; -augment mixin A implements I2 {} -class I2 {} -'''); - - newFile('$testPackageLibPath/b.dart', r''' -part of 'a.dart'; -augment mixin A implements I3 {} -class I3 {} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A implements I1 {} class I1 {} + +augment mixin A implements I2 {} +class I2 {} + +augment mixin A implements I3 {} +class I3 {} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - classes - class I1 @46 - reference: <testLibraryFragment>::@class::I1 - enclosingElement3: <testLibraryFragment> - constructors - synthetic @-1 - reference: <testLibraryFragment>::@class::I1::@constructor::new - enclosingElement3: <testLibraryFragment>::@class::I1 - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - interfaces - I1 - augmented - superclassConstraints - Object - interfaces - I1 - I2 - I3 - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - parts - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - unit: <testLibrary>::@fragment::package:test/b.dart - classes - class I2 @75 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@class::I2 - mixins - augment mixin A @50 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - interfaces - I2 - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - classes - class I3 @57 - reference: <testLibrary>::@fragment::package:test/b.dart::@class::I3 - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/b.dart::@class::I3::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@class::I3 - mixins - augment mixin A @32 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - interfaces - I3 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart classes - class I1 @46 - reference: <testLibraryFragment>::@class::I1 + #F1 class I1 (nameOffset:31) (firstTokenOffset:25) (offset:31) element: <testLibrary>::@class::I1 constructors - synthetic new - reference: <testLibraryFragment>::@class::I1::@constructor::new - element: <testLibraryFragment>::@class::I1::@constructor::new#element + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:31) + element: <testLibrary>::@class::I1::@constructor::new typeName: I1 - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - classes - class I2 @75 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2 + #F3 class I2 (nameOffset:77) (firstTokenOffset:71) (offset:77) element: <testLibrary>::@class::I2 constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new - element: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new#element + #F4 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:77) + element: <testLibrary>::@class::I2::@constructor::new typeName: I2 - mixins - mixin A @50 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibrary>::@fragment::package:test/a.dart - previousFragment: <testLibrary>::@fragment::package:test/a.dart - classes - class I3 @57 - reference: <testLibrary>::@fragment::package:test/b.dart::@class::I3 + #F5 class I3 (nameOffset:123) (firstTokenOffset:117) (offset:123) element: <testLibrary>::@class::I3 constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/b.dart::@class::I3::@constructor::new - element: <testLibrary>::@fragment::package:test/b.dart::@class::I3::@constructor::new#element + #F6 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:123) + element: <testLibrary>::@class::I3::@constructor::new typeName: I3 mixins - mixin A @32 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + #F7 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F8 + #F8 mixin A (nameOffset:52) (firstTokenOffset:38) (offset:52) + element: <testLibrary>::@mixin::A + previousFragment: #F7 + nextFragment: #F9 + #F9 mixin A (nameOffset:98) (firstTokenOffset:84) (offset:98) + element: <testLibrary>::@mixin::A + previousFragment: #F8 classes class I1 reference: <testLibrary>::@class::I1 - firstFragment: <testLibraryFragment>::@class::I1 + firstFragment: #F1 constructors synthetic new - firstFragment: <testLibraryFragment>::@class::I1::@constructor::new + reference: <testLibrary>::@class::I1::@constructor::new + firstFragment: #F2 class I2 reference: <testLibrary>::@class::I2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::I2 + firstFragment: #F3 constructors synthetic new - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new + reference: <testLibrary>::@class::I2::@constructor::new + firstFragment: #F4 class I3 reference: <testLibrary>::@class::I3 - firstFragment: <testLibrary>::@fragment::package:test/b.dart::@class::I3 + firstFragment: #F5 constructors synthetic new - firstFragment: <testLibrary>::@fragment::package:test/b.dart::@class::I3::@constructor::new + reference: <testLibrary>::@class::I3::@constructor::new + firstFragment: #F6 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F7 superclassConstraints Object interfaces @@ -5330,1334 +3512,636 @@ } test_augmented_methods() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A { - void bar() {} -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A { void foo() {} } + +augment mixin A { + void bar() {} +} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - methods - foo @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: void - augmented - superclassConstraints - Object - methods - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::bar - <testLibraryFragment>::@mixin::A::@method::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - methods - bar @46 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::bar - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: void ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 methods - foo @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo - element: <testLibraryFragment>::@mixin::A::@method::foo#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + #F2 mixin A (nameOffset:43) (firstTokenOffset:29) (offset:43) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 methods - bar @46 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::bar - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::bar#element + #F4 bar (nameOffset:54) (firstTokenOffset:49) (offset:54) + element: <testLibrary>::@mixin::A::@method::bar mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object methods foo reference: <testLibrary>::@mixin::A::@method::foo - firstFragment: <testLibraryFragment>::@mixin::A::@method::foo + firstFragment: #F3 + returnType: void bar reference: <testLibrary>::@mixin::A::@method::bar - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::bar + firstFragment: #F4 + returnType: void '''); } test_augmented_methods_augment() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + void foo1() {} + void foo2() {} +} + augment mixin A { augment void foo1() {} } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A { - void foo1() {} - void foo2() {} -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - methods - foo1 @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: void - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo1 - foo2 @49 - reference: <testLibraryFragment>::@mixin::A::@method::foo2 - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: void - augmented - superclassConstraints - Object - methods - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo1 - <testLibraryFragment>::@mixin::A::@method::foo2 - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - methods - augment foo1 @54 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo1 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: void - augmentationTarget: <testLibraryFragment>::@mixin::A::@method::foo1 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 methods - foo1 @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo1 - element: <testLibraryFragment>::@mixin::A::@method::foo1#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo1 - foo2 @49 - reference: <testLibraryFragment>::@mixin::A::@method::foo2 - element: <testLibraryFragment>::@mixin::A::@method::foo2#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F3 foo1 (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo1 + nextFragment: #F4 + #F5 foo2 (nameOffset:34) (firstTokenOffset:29) (offset:34) + element: <testLibrary>::@mixin::A::@method::foo2 + #F2 mixin A (nameOffset:61) (firstTokenOffset:47) (offset:61) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 methods - augment foo1 @54 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo1 - element: <testLibraryFragment>::@mixin::A::@method::foo1#element - previousFragment: <testLibraryFragment>::@mixin::A::@method::foo1 + #F4 augment foo1 (nameOffset:80) (firstTokenOffset:67) (offset:80) + element: <testLibrary>::@mixin::A::@method::foo1 + previousFragment: #F3 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object methods foo1 reference: <testLibrary>::@mixin::A::@method::foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@method::foo1 + firstFragment: #F3 + returnType: void foo2 reference: <testLibrary>::@mixin::A::@method::foo2 - firstFragment: <testLibraryFragment>::@mixin::A::@method::foo2 + firstFragment: #F5 + returnType: void '''); } test_augmented_methods_augment2() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -part 'b.dart'; -augment mixin A { - augment void foo() {} -} -'''); - - newFile('$testPackageLibPath/b.dart', r''' -part of 'a.dart'; -augment mixin A { - augment void foo() {} -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A { void foo() {} } + +augment mixin A { + augment void foo() {} +} + +augment mixin A { + augment void foo() {} +} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - methods - foo @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: void - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - augmented - superclassConstraints - Object - methods - <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@methodAugmentation::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - parts - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - augment mixin A @50 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - methods - augment foo @69 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: void - augmentationTarget: <testLibraryFragment>::@mixin::A::@method::foo - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@methodAugmentation::foo - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - mixins - augment mixin A @32 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - methods - augment foo @51 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@methodAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - returnType: void - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 methods - foo @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo - element: <testLibraryFragment>::@mixin::A::@method::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @50 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F4 + #F2 mixin A (nameOffset:43) (firstTokenOffset:29) (offset:43) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + previousFragment: #F1 + nextFragment: #F5 methods - augment foo @69 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@method::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@method::foo - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@methodAugmentation::foo - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibrary>::@fragment::package:test/a.dart - previousFragment: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @32 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + #F4 augment foo (nameOffset:62) (firstTokenOffset:49) (offset:62) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F3 + nextFragment: #F6 + #F5 mixin A (nameOffset:88) (firstTokenOffset:74) (offset:88) element: <testLibrary>::@mixin::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + previousFragment: #F2 methods - augment foo @51 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A::@methodAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@method::foo#element - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo + #F6 augment foo (nameOffset:107) (firstTokenOffset:94) (offset:107) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F4 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object methods foo reference: <testLibrary>::@mixin::A::@method::foo - firstFragment: <testLibraryFragment>::@mixin::A::@method::foo + firstFragment: #F3 + returnType: void '''); } test_augmented_methods_generic() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A<T2> { - T2 bar() => throw 0; -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A<T> { T foo() => throw 0; } + +augment mixin A<T> { + T bar() => throw 0; +} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - typeParameters - covariant T @23 - defaultType: dynamic - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - methods - foo @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: T - augmented - superclassConstraints - Object - methods - MethodMember - base: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::bar - augmentationSubstitution: {T2: T} - <testLibraryFragment>::@mixin::A::@method::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - typeParameters - covariant T2 @37 - defaultType: dynamic - augmentationTarget: <testLibraryFragment>::@mixin::A - methods - bar @48 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::bar - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: T2 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 typeParameters - T @23 - element: <not-implemented> + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 methods - foo @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo - element: <testLibraryFragment>::@mixin::A::@method::foo#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F5 foo (nameOffset:17) (firstTokenOffset:15) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + #F2 mixin A (nameOffset:52) (firstTokenOffset:38) (offset:52) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 typeParameters - T2 @37 - element: <not-implemented> + #F4 T (nameOffset:54) (firstTokenOffset:54) (offset:54) + element: #E0 T + previousFragment: #F3 methods - bar @48 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::bar - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::bar#element + #F6 bar (nameOffset:63) (firstTokenOffset:61) (offset:63) + element: <testLibrary>::@mixin::A::@method::bar mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 typeParameters - T + #E0 T + firstFragment: #F3 superclassConstraints Object methods foo reference: <testLibrary>::@mixin::A::@method::foo - firstFragment: <testLibraryFragment>::@mixin::A::@method::foo + firstFragment: #F5 + hasEnclosingTypeParameterReference: true + returnType: T bar reference: <testLibrary>::@mixin::A::@method::bar - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@method::bar + firstFragment: #F6 + hasEnclosingTypeParameterReference: true + returnType: T '''); } test_augmented_methods_generic_augment() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A<T2> { - augment T2 foo() => throw 0; -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A<T> { T foo() => throw 0; } + +augment mixin A<T> { + augment T foo() => throw 0; +} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - typeParameters - covariant T @23 - defaultType: dynamic - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - methods - foo @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: T - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - augmented - superclassConstraints - Object - methods - MethodMember - base: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - augmentationSubstitution: {T2: T} - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - typeParameters - covariant T2 @37 - defaultType: dynamic - augmentationTarget: <testLibraryFragment>::@mixin::A - methods - augment foo @56 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: T2 - augmentationTarget: <testLibraryFragment>::@mixin::A::@method::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 typeParameters - T @23 - element: <not-implemented> + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 methods - foo @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo - element: <testLibraryFragment>::@mixin::A::@method::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F5 foo (nameOffset:17) (firstTokenOffset:15) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F6 + #F2 mixin A (nameOffset:52) (firstTokenOffset:38) (offset:52) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 typeParameters - T2 @37 - element: <not-implemented> + #F4 T (nameOffset:54) (firstTokenOffset:54) (offset:54) + element: #E0 T + previousFragment: #F3 methods - augment foo @56 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@method::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@method::foo + #F6 augment foo (nameOffset:71) (firstTokenOffset:61) (offset:71) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F5 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 typeParameters - T + #E0 T + firstFragment: #F3 superclassConstraints Object methods foo reference: <testLibrary>::@mixin::A::@method::foo - firstFragment: <testLibraryFragment>::@mixin::A::@method::foo + firstFragment: #F5 + hasEnclosingTypeParameterReference: true + returnType: T '''); } test_augmented_methods_typeParameterCountMismatch() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + void foo() {} + void bar() {} +} + augment mixin A<T> { augment void foo() {} } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A { - void foo() {} - void bar() {} -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - methods - foo @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: void - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - bar @48 - reference: <testLibraryFragment>::@mixin::A::@method::bar - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: void - augmented - superclassConstraints - Object - methods - <testLibraryFragment>::@mixin::A::@method::bar - MethodMember - base: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - augmentationSubstitution: {T: InvalidType} - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - typeParameters - covariant T @37 - defaultType: dynamic - augmentationTarget: <testLibraryFragment>::@mixin::A - methods - augment foo @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - returnType: void - augmentationTarget: <testLibraryFragment>::@mixin::A::@method::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 methods - foo @32 - reference: <testLibraryFragment>::@mixin::A::@method::foo - element: <testLibraryFragment>::@mixin::A::@method::foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - bar @48 - reference: <testLibraryFragment>::@mixin::A::@method::bar - element: <testLibraryFragment>::@mixin::A::@method::bar#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F4 + #F5 bar (nameOffset:33) (firstTokenOffset:28) (offset:33) + element: <testLibrary>::@mixin::A::@method::bar + #F2 mixin A (nameOffset:59) (firstTokenOffset:45) (offset:59) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A - typeParameters - T @37 - element: <not-implemented> + previousFragment: #F1 methods - augment foo @57 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@methodAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@method::foo#element - previousFragment: <testLibraryFragment>::@mixin::A::@method::foo + #F4 augment foo (nameOffset:81) (firstTokenOffset:68) (offset:81) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F3 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object methods foo reference: <testLibrary>::@mixin::A::@method::foo - firstFragment: <testLibraryFragment>::@mixin::A::@method::foo + firstFragment: #F3 + returnType: void bar reference: <testLibrary>::@mixin::A::@method::bar - firstFragment: <testLibraryFragment>::@mixin::A::@method::bar + firstFragment: #F5 + returnType: void '''); } test_augmented_setters_add() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A { - set foo2(int _) {} -} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A { set foo1(int _) {} } + +augment mixin A { + set foo2(int _) {} +} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - synthetic foo1 @-1 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - id: field_0 - setter: setter_0 - accessors - set foo1= @31 - reference: <testLibraryFragment>::@mixin::A::@setter::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _ @40 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo1 - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - accessors - <testLibraryFragment>::@mixin::A::@setter::foo1 - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - fields - synthetic foo2 @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - type: int - id: field_1 - setter: setter_1 - accessors - set foo2= @45 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - parameters - requiredPositional _ @54 - type: int - returnType: void - id: setter_1 - variable: field_1 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - synthetic foo1 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - element: <testLibraryFragment>::@mixin::A::@field::foo1#element - setter2: <testLibraryFragment>::@mixin::A::@setter::foo1 + #F3 synthetic foo1 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:6) + element: <testLibrary>::@mixin::A::@field::foo1 setters - set foo1 @31 - reference: <testLibraryFragment>::@mixin::A::@setter::foo1 - element: <testLibraryFragment>::@mixin::A::@setter::foo1#element + #F4 foo1 (nameOffset:16) (firstTokenOffset:12) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo1 formalParameters - _ @40 - element: <testLibraryFragment>::@mixin::A::@setter::foo1::@parameter::_#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F5 _ (nameOffset:25) (firstTokenOffset:21) (offset:25) + element: <testLibrary>::@mixin::A::@setter::foo1::@formalParameter::_ + #F2 mixin A (nameOffset:48) (firstTokenOffset:34) (offset:48) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 fields - synthetic foo2 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2#element - setter2: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 + #F6 synthetic foo2 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:48) + element: <testLibrary>::@mixin::A::@field::foo2 setters - set foo2 @45 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2#element + #F7 foo2 (nameOffset:58) (firstTokenOffset:54) (offset:58) + element: <testLibrary>::@mixin::A::@setter::foo2 formalParameters - _ @54 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2::@parameter::_#element + #F8 _ (nameOffset:67) (firstTokenOffset:63) (offset:67) + element: <testLibrary>::@mixin::A::@setter::foo2::@formalParameter::_ mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields synthetic foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo1 + reference: <testLibrary>::@mixin::A::@field::foo1 + firstFragment: #F3 type: int - setter: <testLibraryFragment>::@mixin::A::@setter::foo1#element + setter: <testLibrary>::@mixin::A::@setter::foo1 synthetic foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@field::foo2 + reference: <testLibrary>::@mixin::A::@field::foo2 + firstFragment: #F6 type: int - setter: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2#element + setter: <testLibrary>::@mixin::A::@setter::foo2 setters - set foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo1 + foo1 + reference: <testLibrary>::@mixin::A::@setter::foo1 + firstFragment: #F4 formalParameters - requiredPositional _ + #E0 requiredPositional _ + firstFragment: #F5 type: int - set foo2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setter::foo2 + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo1 + foo2 + reference: <testLibrary>::@mixin::A::@setter::foo2 + firstFragment: #F7 formalParameters - requiredPositional _ + #E1 requiredPositional _ + firstFragment: #F8 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo2 '''); } test_augmented_setters_augment_field() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + int foo = 0; +} + augment mixin A { augment set foo(int _) {} } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A { - int foo = 0; -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - foo @31 - reference: <testLibraryFragment>::@mixin::A::@field::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - shouldUseTypeForInitializerInference: true - id: field_0 - getter: getter_0 - setter: setter_0 - accessors - synthetic get foo @-1 - reference: <testLibraryFragment>::@mixin::A::@getter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - returnType: int - id: getter_0 - variable: field_0 - synthetic set foo= @-1 - reference: <testLibraryFragment>::@mixin::A::@setter::foo - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _foo @-1 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo - accessors - <testLibraryFragment>::@mixin::A::@getter::foo - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - accessors - augment set foo= @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - parameters - requiredPositional _ @61 - type: int - returnType: void - id: setter_1 - variable: <null> - augmentationTarget: <testLibraryFragment>::@mixin::A::@setter::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - hasInitializer foo @31 - reference: <testLibraryFragment>::@mixin::A::@field::foo - element: <testLibraryFragment>::@mixin::A::@field::foo#element - getter2: <testLibraryFragment>::@mixin::A::@getter::foo - setter2: <testLibraryFragment>::@mixin::A::@setter::foo + #F3 hasInitializer foo (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::A::@field::foo getters - synthetic get foo - reference: <testLibraryFragment>::@mixin::A::@getter::foo - element: <testLibraryFragment>::@mixin::A::@getter::foo#element + #F4 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@getter::foo setters - synthetic set foo - reference: <testLibraryFragment>::@mixin::A::@setter::foo - element: <testLibraryFragment>::@mixin::A::@setter::foo#element + #F5 synthetic foo (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo formalParameters - _foo - element: <testLibraryFragment>::@mixin::A::@setter::foo::@parameter::_foo#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F6 value (nameOffset:<null>) (firstTokenOffset:<null>) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo::@formalParameter::value + nextFragment: #F7 + #F2 mixin A (nameOffset:42) (firstTokenOffset:28) (offset:42) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 setters - augment set foo @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo - element: <testLibraryFragment>::@mixin::A::@setter::foo#element + #F7 augment foo (nameOffset:60) (firstTokenOffset:48) (offset:60) + element: <testLibrary>::@mixin::A::@setter::foo formalParameters - _ @61 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo::@parameter::_#element - previousFragment: <testLibraryFragment>::@mixin::A::@setter::foo + #F8 _ (nameOffset:68) (firstTokenOffset:64) (offset:68) + element: <testLibrary>::@mixin::A::@setter::foo::@formalParameter::_ + previousFragment: #F5 mixins - mixin A + hasNonFinalField mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields hasInitializer foo - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo + reference: <testLibrary>::@mixin::A::@field::foo + firstFragment: #F3 type: int - getter: <testLibraryFragment>::@mixin::A::@getter::foo#element - setter: <testLibraryFragment>::@mixin::A::@setter::foo#element + getter: <testLibrary>::@mixin::A::@getter::foo + setter: <testLibrary>::@mixin::A::@setter::foo getters - synthetic get foo - firstFragment: <testLibraryFragment>::@mixin::A::@getter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@getter::foo + firstFragment: #F4 + returnType: int + variable: <testLibrary>::@mixin::A::@field::foo setters - synthetic set foo - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo + synthetic foo + reference: <testLibrary>::@mixin::A::@setter::foo + firstFragment: #F5 formalParameters - requiredPositional _foo + #E0 requiredPositional value + firstFragment: #F6 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo '''); } test_augmented_setters_augment_setter() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A { + set foo1(int _) {} + set foo2(int _) {} +} + augment mixin A { augment set foo1(int _) {} } '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A { - set foo1(int _) {} - set foo2(int _) {} -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - fields - synthetic foo1 @-1 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - id: field_0 - setter: setter_0 - synthetic foo2 @-1 - reference: <testLibraryFragment>::@mixin::A::@field::foo2 - enclosingElement3: <testLibraryFragment>::@mixin::A - type: int - id: field_1 - setter: setter_1 - accessors - set foo1= @31 - reference: <testLibraryFragment>::@mixin::A::@setter::foo1 - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _ @40 - type: int - returnType: void - id: setter_0 - variable: field_0 - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo1 - set foo2= @52 - reference: <testLibraryFragment>::@mixin::A::@setter::foo2 - enclosingElement3: <testLibraryFragment>::@mixin::A - parameters - requiredPositional _ @61 - type: int - returnType: void - id: setter_1 - variable: field_1 - augmented - superclassConstraints - Object - fields - <testLibraryFragment>::@mixin::A::@field::foo1 - <testLibraryFragment>::@mixin::A::@field::foo2 - accessors - <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo1 - <testLibraryFragment>::@mixin::A::@setter::foo2 - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - accessors - augment set foo1= @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo1 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - parameters - requiredPositional _ @62 - type: int - returnType: void - id: setter_2 - variable: <null> - augmentationTarget: <testLibraryFragment>::@mixin::A::@setter::foo1 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 fields - synthetic foo1 - reference: <testLibraryFragment>::@mixin::A::@field::foo1 - element: <testLibraryFragment>::@mixin::A::@field::foo1#element - setter2: <testLibraryFragment>::@mixin::A::@setter::foo1 - synthetic foo2 - reference: <testLibraryFragment>::@mixin::A::@field::foo2 - element: <testLibraryFragment>::@mixin::A::@field::foo2#element - setter2: <testLibraryFragment>::@mixin::A::@setter::foo2 + #F3 synthetic foo1 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:6) + element: <testLibrary>::@mixin::A::@field::foo1 + #F4 synthetic foo2 (nameOffset:<null>) (firstTokenOffset:<null>) (offset:6) + element: <testLibrary>::@mixin::A::@field::foo2 setters - set foo1 @31 - reference: <testLibraryFragment>::@mixin::A::@setter::foo1 - element: <testLibraryFragment>::@mixin::A::@setter::foo1#element + #F5 foo1 (nameOffset:16) (firstTokenOffset:12) (offset:16) + element: <testLibrary>::@mixin::A::@setter::foo1 formalParameters - _ @40 - element: <testLibraryFragment>::@mixin::A::@setter::foo1::@parameter::_#element - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo1 - set foo2 @52 - reference: <testLibraryFragment>::@mixin::A::@setter::foo2 - element: <testLibraryFragment>::@mixin::A::@setter::foo2#element + #F6 _ (nameOffset:25) (firstTokenOffset:21) (offset:25) + element: <testLibrary>::@mixin::A::@setter::foo1::@formalParameter::_ + nextFragment: #F7 + #F8 foo2 (nameOffset:37) (firstTokenOffset:33) (offset:37) + element: <testLibrary>::@mixin::A::@setter::foo2 formalParameters - _ @61 - element: <testLibraryFragment>::@mixin::A::@setter::foo2::@parameter::_#element - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F9 _ (nameOffset:46) (firstTokenOffset:42) (offset:46) + element: <testLibrary>::@mixin::A::@setter::foo2::@formalParameter::_ + #F2 mixin A (nameOffset:69) (firstTokenOffset:55) (offset:69) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 setters - augment set foo1 @53 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo1 - element: <testLibraryFragment>::@mixin::A::@setter::foo1#element + #F7 augment foo1 (nameOffset:87) (firstTokenOffset:75) (offset:87) + element: <testLibrary>::@mixin::A::@setter::foo1 formalParameters - _ @62 - element: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A::@setterAugmentation::foo1::@parameter::_#element - previousFragment: <testLibraryFragment>::@mixin::A::@setter::foo1 + #F10 _ (nameOffset:96) (firstTokenOffset:92) (offset:96) + element: <testLibrary>::@mixin::A::@setter::foo1::@formalParameter::_ + previousFragment: #F5 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object fields synthetic foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo1 + reference: <testLibrary>::@mixin::A::@field::foo1 + firstFragment: #F3 type: int - setter: <testLibraryFragment>::@mixin::A::@setter::foo1#element + setter: <testLibrary>::@mixin::A::@setter::foo1 synthetic foo2 - firstFragment: <testLibraryFragment>::@mixin::A::@field::foo2 + reference: <testLibrary>::@mixin::A::@field::foo2 + firstFragment: #F4 type: int - setter: <testLibraryFragment>::@mixin::A::@setter::foo2#element + setter: <testLibrary>::@mixin::A::@setter::foo2 setters - set foo2 - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo2 + foo1 + reference: <testLibrary>::@mixin::A::@setter::foo1 + firstFragment: #F5 formalParameters - requiredPositional _ + #E0 requiredPositional _ + firstFragment: #F6 type: int - set foo1 - firstFragment: <testLibraryFragment>::@mixin::A::@setter::foo1 + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo1 + foo2 + reference: <testLibrary>::@mixin::A::@setter::foo2 + firstFragment: #F8 formalParameters - requiredPositional _ + #E1 requiredPositional _ + firstFragment: #F9 type: int + returnType: void + variable: <testLibrary>::@mixin::A::@field::foo2 '''); } test_augmented_superclassConstraints() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A on B2 {} -class B2 {} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A on B1 {} class B1 {} + +augment mixin A on B2 {} +class B2 {} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - classes - class B1 @38 - reference: <testLibraryFragment>::@class::B1 - enclosingElement3: <testLibraryFragment> - constructors - synthetic @-1 - reference: <testLibraryFragment>::@class::B1::@constructor::new - enclosingElement3: <testLibraryFragment>::@class::B1 - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - B1 - augmented - superclassConstraints - B1 - B2 - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - classes - class B2 @52 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::B2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::B2::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@class::B2 - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - superclassConstraints - B2 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart classes - class B1 @38 - reference: <testLibraryFragment>::@class::B1 + #F1 class B1 (nameOffset:23) (firstTokenOffset:17) (offset:23) element: <testLibrary>::@class::B1 constructors - synthetic new - reference: <testLibraryFragment>::@class::B1::@constructor::new - element: <testLibraryFragment>::@class::B1::@constructor::new#element + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:23) + element: <testLibrary>::@class::B1::@constructor::new typeName: B1 - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - classes - class B2 @52 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::B2 + #F3 class B2 (nameOffset:61) (firstTokenOffset:55) (offset:61) element: <testLibrary>::@class::B2 constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/a.dart::@class::B2::@constructor::new - element: <testLibrary>::@fragment::package:test/a.dart::@class::B2::@constructor::new#element + #F4 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:61) + element: <testLibrary>::@class::B2::@constructor::new typeName: B2 mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F5 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + nextFragment: #F6 + #F6 mixin A (nameOffset:44) (firstTokenOffset:30) (offset:44) + element: <testLibrary>::@mixin::A + previousFragment: #F5 classes class B1 reference: <testLibrary>::@class::B1 - firstFragment: <testLibraryFragment>::@class::B1 + firstFragment: #F1 constructors synthetic new - firstFragment: <testLibraryFragment>::@class::B1::@constructor::new + reference: <testLibrary>::@class::B1::@constructor::new + firstFragment: #F2 class B2 reference: <testLibrary>::@class::B2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::B2 + firstFragment: #F3 constructors synthetic new - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::B2::@constructor::new + reference: <testLibrary>::@class::B2::@constructor::new + firstFragment: #F4 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F5 superclassConstraints B1 B2 @@ -6665,179 +4149,79 @@ } test_augmented_superclassConstraints_chain() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -part 'b.dart'; -augment mixin A on I2 {} -class I2 {} -'''); - - newFile('$testPackageLibPath/b.dart', r''' -part of 'a.dart'; -augment mixin A on I3 {} -class I3 {} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A on I1 {} class I1 {} + +augment mixin A on I2 {} +class I2 {} + +augment mixin A on I3 {} +class I3 {} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - classes - class I1 @38 - reference: <testLibraryFragment>::@class::I1 - enclosingElement3: <testLibraryFragment> - constructors - synthetic @-1 - reference: <testLibraryFragment>::@class::I1::@constructor::new - enclosingElement3: <testLibraryFragment>::@class::I1 - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - I1 - augmented - superclassConstraints - I1 - I2 - I3 - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - parts - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - unit: <testLibrary>::@fragment::package:test/b.dart - classes - class I2 @67 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@class::I2 - mixins - augment mixin A @50 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - superclassConstraints - I2 - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - classes - class I3 @49 - reference: <testLibrary>::@fragment::package:test/b.dart::@class::I3 - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/b.dart::@class::I3::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@class::I3 - mixins - augment mixin A @32 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - I3 ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart classes - class I1 @38 - reference: <testLibraryFragment>::@class::I1 + #F1 class I1 (nameOffset:23) (firstTokenOffset:17) (offset:23) element: <testLibrary>::@class::I1 constructors - synthetic new - reference: <testLibraryFragment>::@class::I1::@constructor::new - element: <testLibraryFragment>::@class::I1::@constructor::new#element + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:23) + element: <testLibrary>::@class::I1::@constructor::new typeName: I1 - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - classes - class I2 @67 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2 + #F3 class I2 (nameOffset:61) (firstTokenOffset:55) (offset:61) element: <testLibrary>::@class::I2 constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new - element: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new#element + #F4 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:61) + element: <testLibrary>::@class::I2::@constructor::new typeName: I2 - mixins - mixin A @50 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibrary>::@fragment::package:test/a.dart - previousFragment: <testLibrary>::@fragment::package:test/a.dart - classes - class I3 @49 - reference: <testLibrary>::@fragment::package:test/b.dart::@class::I3 + #F5 class I3 (nameOffset:99) (firstTokenOffset:93) (offset:99) element: <testLibrary>::@class::I3 constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/b.dart::@class::I3::@constructor::new - element: <testLibrary>::@fragment::package:test/b.dart::@class::I3::@constructor::new#element + #F6 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:99) + element: <testLibrary>::@class::I3::@constructor::new typeName: I3 mixins - mixin A @32 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + #F7 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F8 + #F8 mixin A (nameOffset:44) (firstTokenOffset:30) (offset:44) + element: <testLibrary>::@mixin::A + previousFragment: #F7 + nextFragment: #F9 + #F9 mixin A (nameOffset:82) (firstTokenOffset:68) (offset:82) + element: <testLibrary>::@mixin::A + previousFragment: #F8 classes class I1 reference: <testLibrary>::@class::I1 - firstFragment: <testLibraryFragment>::@class::I1 + firstFragment: #F1 constructors synthetic new - firstFragment: <testLibraryFragment>::@class::I1::@constructor::new + reference: <testLibrary>::@class::I1::@constructor::new + firstFragment: #F2 class I2 reference: <testLibrary>::@class::I2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::I2 + firstFragment: #F3 constructors synthetic new - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new + reference: <testLibrary>::@class::I2::@constructor::new + firstFragment: #F4 class I3 reference: <testLibrary>::@class::I3 - firstFragment: <testLibrary>::@fragment::package:test/b.dart::@class::I3 + firstFragment: #F5 constructors synthetic new - firstFragment: <testLibrary>::@fragment::package:test/b.dart::@class::I3::@constructor::new + reference: <testLibrary>::@class::I3::@constructor::new + firstFragment: #F6 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F7 superclassConstraints I1 I2 @@ -6846,239 +4230,121 @@ } test_augmented_superclassConstraints_fromAugmentation() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A {} + augment mixin A on B {} class B {} '''); - var library = await buildLibrary(r''' -part 'a.dart'; -mixin A {} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - augmented - superclassConstraints - B - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - classes - class B @51 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::B - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::B::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@class::B - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A - superclassConstraints - B ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> classes - class B @51 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::B + #F1 class B (nameOffset:42) (firstTokenOffset:36) (offset:42) element: <testLibrary>::@class::B constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/a.dart::@class::B::@constructor::new - element: <testLibrary>::@fragment::package:test/a.dart::@class::B::@constructor::new#element + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:42) + element: <testLibrary>::@class::B::@constructor::new typeName: B mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F3 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + nextFragment: #F4 + #F4 mixin A (nameOffset:26) (firstTokenOffset:12) (offset:26) + element: <testLibrary>::@mixin::A + previousFragment: #F3 classes class B reference: <testLibrary>::@class::B - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::B + firstFragment: #F1 constructors synthetic new - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::B::@constructor::new + reference: <testLibrary>::@class::B::@constructor::new + firstFragment: #F2 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F3 superclassConstraints B '''); } test_augmented_superclassConstraints_generic() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A<T2> on I2<T2> {} -class I2<E> {} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A<T> on I1 {} class I1 {} + +augment mixin A<T> on I2<T> {} +class I2<E> {} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - classes - class I1 @41 - reference: <testLibraryFragment>::@class::I1 - enclosingElement3: <testLibraryFragment> - constructors - synthetic @-1 - reference: <testLibraryFragment>::@class::I1::@constructor::new - enclosingElement3: <testLibraryFragment>::@class::I1 - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - typeParameters - covariant T @23 - defaultType: dynamic - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - I1 - augmented - superclassConstraints - I1 - I2<T> - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - classes - class I2 @60 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2 - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - typeParameters - covariant E @63 - defaultType: dynamic - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@class::I2 - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - typeParameters - covariant T2 @37 - defaultType: dynamic - augmentationTarget: <testLibraryFragment>::@mixin::A - superclassConstraints - I2<T2> ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart classes - class I1 @41 - reference: <testLibraryFragment>::@class::I1 + #F1 class I1 (nameOffset:26) (firstTokenOffset:20) (offset:26) element: <testLibrary>::@class::I1 constructors - synthetic new - reference: <testLibraryFragment>::@class::I1::@constructor::new - element: <testLibraryFragment>::@class::I1::@constructor::new#element + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:26) + element: <testLibrary>::@class::I1::@constructor::new typeName: I1 - mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A - element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - typeParameters - T @23 - element: <not-implemented> - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - classes - class I2 @60 - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2 + #F3 class I2 (nameOffset:70) (firstTokenOffset:64) (offset:70) element: <testLibrary>::@class::I2 typeParameters - E @63 - element: <not-implemented> + #F4 E (nameOffset:73) (firstTokenOffset:73) (offset:73) + element: #E0 E constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new - element: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new#element + #F5 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:70) + element: <testLibrary>::@class::I2::@constructor::new typeName: I2 mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F6 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + nextFragment: #F7 typeParameters - T2 @37 - element: <not-implemented> + #F8 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E1 T + nextFragment: #F9 + #F7 mixin A (nameOffset:47) (firstTokenOffset:33) (offset:47) + element: <testLibrary>::@mixin::A + previousFragment: #F6 + typeParameters + #F9 T (nameOffset:49) (firstTokenOffset:49) (offset:49) + element: #E1 T + previousFragment: #F8 classes class I1 reference: <testLibrary>::@class::I1 - firstFragment: <testLibraryFragment>::@class::I1 + firstFragment: #F1 constructors synthetic new - firstFragment: <testLibraryFragment>::@class::I1::@constructor::new + reference: <testLibrary>::@class::I1::@constructor::new + firstFragment: #F2 class I2 reference: <testLibrary>::@class::I2 - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::I2 + firstFragment: #F3 typeParameters - E + #E0 E + firstFragment: #F4 constructors synthetic new - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@class::I2::@constructor::new + reference: <testLibrary>::@class::I2::@constructor::new + firstFragment: #F5 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F6 typeParameters - T + #E1 T + firstFragment: #F8 superclassConstraints I1 I2<T> @@ -7086,433 +4352,236 @@ } test_augmentedBy_class2() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; - -augment class A {} -'''); - - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; - -augment class A {} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; -part 'b.dart'; - mixin A {} +augment class A {} +augment class A {} '''); configuration.withConstructors = false; checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @37 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - superclassConstraints - Object - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - classes - augment class A @36 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTargetAny: <testLibraryFragment>::@mixin::A - augmentation: <testLibrary>::@fragment::package:test/b.dart::@classAugmentation::A - augmented - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - classes - augment class A @36 - reference: <testLibrary>::@fragment::package:test/b.dart::@classAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart + classes + #F1 class A (nameOffset:25) (firstTokenOffset:11) (offset:25) + element: <testLibrary>::@class::A + nextFragment: #F2 + #F2 class A (nameOffset:44) (firstTokenOffset:30) (offset:44) + element: <testLibrary>::@class::A + previousFragment: #F1 mixins - mixin A @37 - reference: <testLibraryFragment>::@mixin::A + #F3 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - classes - class A @36 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A - element: <testLibrary>::@class::A - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@classAugmentation::A - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibrary>::@fragment::package:test/a.dart - classes - class A @36 - reference: <testLibrary>::@fragment::package:test/b.dart::@classAugmentation::A - element: <testLibrary>::@class::A - previousFragment: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A classes class A reference: <testLibrary>::@class::A - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A + firstFragment: #F1 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F3 superclassConstraints Object '''); } test_augmentedBy_class_mixin() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; + var library = await buildLibrary(r''' +mixin A {} augment class A {} -'''); - - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; - augment mixin A {} '''); - var library = await buildLibrary(r''' -part 'a.dart'; -part 'b.dart'; - -mixin A {} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - part_1 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin A @37 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - superclassConstraints - Object - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - classes - augment class A @36 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTargetAny: <testLibraryFragment>::@mixin::A - constructors - synthetic @-1 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@constructor::new - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @36 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTargetAny: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A - superclassConstraints - Object ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart - mixins - mixin A @37 - reference: <testLibraryFragment>::@mixin::A - element: <testLibrary>::@mixin::A::@def::0 - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - nextFragment: <testLibrary>::@fragment::package:test/b.dart classes - class A @36 - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A + #F1 class A (nameOffset:26) (firstTokenOffset:12) (offset:26) element: <testLibrary>::@class::A constructors - synthetic new - reference: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@constructor::new - element: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@constructor::new#element + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:26) + element: <testLibrary>::@class::A::@constructor::new typeName: A - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @36 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + #F3 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A::@def::0 + #F4 mixin A (nameOffset:45) (firstTokenOffset:31) (offset:45) element: <testLibrary>::@mixin::A::@def::1 classes class A reference: <testLibrary>::@class::A - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A + firstFragment: #F1 constructors synthetic new - firstFragment: <testLibrary>::@fragment::package:test/a.dart::@classAugmentation::A::@constructor::new + reference: <testLibrary>::@class::A::@constructor::new + firstFragment: #F2 mixins mixin A reference: <testLibrary>::@mixin::A::@def::0 - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F3 superclassConstraints Object mixin A reference: <testLibrary>::@mixin::A::@def::1 - firstFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::A + firstFragment: #F4 superclassConstraints Object '''); } test_inferTypes_method_ofAugment() async { - newFile('$testPackageLibPath/a.dart', r''' + var library = await buildLibrary(r''' +mixin B on A {} + class A { int foo(String a) => 0; } -'''); - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; augment mixin B { foo(a) => 0; } '''); - var library = await buildLibrary(r''' -import 'a.dart'; -part 'b.dart'; - -mixin B on A {} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - libraryImports - package:test/a.dart - enclosingElement3: <testLibraryFragment> - parts - part_0 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin B @39 - reference: <testLibraryFragment>::@mixin::B - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - superclassConstraints - A - augmented - superclassConstraints - A - methods - <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@method::foo - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin B @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibraryFragment>::@mixin::B - methods - foo @41 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@method::foo - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - parameters - requiredPositional hasImplicitType a @45 - type: String - returnType: int ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - libraryImports - package:test/a.dart - mixins - mixin B @39 - reference: <testLibraryFragment>::@mixin::B - element: <testLibrary>::@mixin::B - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin B @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - element: <testLibrary>::@mixin::B - previousFragment: <testLibraryFragment>::@mixin::B + classes + #F1 class A (nameOffset:23) (firstTokenOffset:17) (offset:23) + element: <testLibrary>::@class::A + constructors + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:23) + element: <testLibrary>::@class::A::@constructor::new + typeName: A methods - foo @41 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@method::foo - element: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@method::foo#element + #F3 foo (nameOffset:33) (firstTokenOffset:29) (offset:33) + element: <testLibrary>::@class::A::@method::foo formalParameters - a @45 - element: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@method::foo::@parameter::a#element + #F4 a (nameOffset:44) (firstTokenOffset:37) (offset:44) + element: <testLibrary>::@class::A::@method::foo::@formalParameter::a + mixins + #F5 mixin B (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::B + nextFragment: #F6 + #F6 mixin B (nameOffset:70) (firstTokenOffset:56) (offset:70) + element: <testLibrary>::@mixin::B + previousFragment: #F5 + methods + #F7 foo (nameOffset:76) (firstTokenOffset:76) (offset:76) + element: <testLibrary>::@mixin::B::@method::foo + formalParameters + #F8 a (nameOffset:80) (firstTokenOffset:80) (offset:80) + element: <testLibrary>::@mixin::B::@method::foo::@formalParameter::a + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + constructors + synthetic new + reference: <testLibrary>::@class::A::@constructor::new + firstFragment: #F2 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + formalParameters + #E0 requiredPositional a + firstFragment: #F4 + type: String + returnType: int mixins mixin B reference: <testLibrary>::@mixin::B - firstFragment: <testLibraryFragment>::@mixin::B + firstFragment: #F5 superclassConstraints A methods foo reference: <testLibrary>::@mixin::B::@method::foo - firstFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@method::foo + firstFragment: #F7 formalParameters - requiredPositional hasImplicitType a + #E1 requiredPositional hasImplicitType a + firstFragment: #F8 type: String + returnType: int '''); } test_inferTypes_method_usingAugmentation_interface() async { - newFile('$testPackageLibPath/a.dart', r''' -class A { - int foo(String a) => 0; -} -'''); - - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; -import 'a.dart'; -augment mixin B implements A {} -'''); - var library = await buildLibrary(r''' -part 'b.dart'; - mixin B { foo(a) => 0; } + +class A { + int foo(String a) => 0; +} + +augment mixin B implements A {} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin B @22 - reference: <testLibraryFragment>::@mixin::B - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - superclassConstraints - Object - methods - foo @28 - reference: <testLibraryFragment>::@mixin::B::@method::foo - enclosingElement3: <testLibraryFragment>::@mixin::B - parameters - requiredPositional hasImplicitType a @32 - type: String - returnType: int - augmented - superclassConstraints - Object - interfaces - A - methods - <testLibraryFragment>::@mixin::B::@method::foo - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - libraryImports - package:test/a.dart - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - mixins - augment mixin B @52 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibraryFragment>::@mixin::B - interfaces - A ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin B @22 - reference: <testLibraryFragment>::@mixin::B - element: <testLibrary>::@mixin::B - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B + classes + #F1 class A (nameOffset:34) (firstTokenOffset:28) (offset:34) + element: <testLibrary>::@class::A + constructors + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:34) + element: <testLibrary>::@class::A::@constructor::new + typeName: A methods - foo @28 - reference: <testLibraryFragment>::@mixin::B::@method::foo - element: <testLibraryFragment>::@mixin::B::@method::foo#element + #F3 foo (nameOffset:44) (firstTokenOffset:40) (offset:44) + element: <testLibrary>::@class::A::@method::foo formalParameters - a @32 - element: <testLibraryFragment>::@mixin::B::@method::foo::@parameter::a#element - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - libraryImports - package:test/a.dart + #F4 a (nameOffset:55) (firstTokenOffset:48) (offset:55) + element: <testLibrary>::@class::A::@method::foo::@formalParameter::a mixins - mixin B @52 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B + #F5 mixin B (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::B - previousFragment: <testLibraryFragment>::@mixin::B + nextFragment: #F6 + methods + #F7 foo (nameOffset:12) (firstTokenOffset:12) (offset:12) + element: <testLibrary>::@mixin::B::@method::foo + formalParameters + #F8 a (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::B::@method::foo::@formalParameter::a + #F6 mixin B (nameOffset:81) (firstTokenOffset:67) (offset:81) + element: <testLibrary>::@mixin::B + previousFragment: #F5 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + constructors + synthetic new + reference: <testLibrary>::@class::A::@constructor::new + firstFragment: #F2 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + formalParameters + #E0 requiredPositional a + firstFragment: #F4 + type: String + returnType: int mixins mixin B reference: <testLibrary>::@mixin::B - firstFragment: <testLibraryFragment>::@mixin::B + firstFragment: #F5 superclassConstraints Object interfaces @@ -7520,317 +4589,739 @@ methods foo reference: <testLibrary>::@mixin::B::@method::foo - firstFragment: <testLibraryFragment>::@mixin::B::@method::foo + firstFragment: #F7 formalParameters - requiredPositional hasImplicitType a + #E1 requiredPositional hasImplicitType a + firstFragment: #F8 type: String + returnType: int '''); } test_inferTypes_method_usingAugmentation_superclassConstraint() async { - newFile('$testPackageLibPath/a.dart', r''' -class A { - int foo(String a) => 0; -} -'''); - - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; -import 'a.dart'; -augment mixin B on A {} -'''); - var library = await buildLibrary(r''' -part 'b.dart'; - mixin B { foo(a) => 0; } + +class A { + int foo(String a) => 0; +} + +augment mixin B on A {} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin B @22 - reference: <testLibraryFragment>::@mixin::B - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - methods - foo @28 - reference: <testLibraryFragment>::@mixin::B::@method::foo - enclosingElement3: <testLibraryFragment>::@mixin::B - parameters - requiredPositional hasImplicitType a @32 - type: String - returnType: int - augmented - superclassConstraints - A - methods - <testLibraryFragment>::@mixin::B::@method::foo - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - libraryImports - package:test/a.dart - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - mixins - augment mixin B @52 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibraryFragment>::@mixin::B - superclassConstraints - A ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin B @22 - reference: <testLibraryFragment>::@mixin::B - element: <testLibrary>::@mixin::B - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B + classes + #F1 class A (nameOffset:34) (firstTokenOffset:28) (offset:34) + element: <testLibrary>::@class::A + constructors + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:34) + element: <testLibrary>::@class::A::@constructor::new + typeName: A methods - foo @28 - reference: <testLibraryFragment>::@mixin::B::@method::foo - element: <testLibraryFragment>::@mixin::B::@method::foo#element + #F3 foo (nameOffset:44) (firstTokenOffset:40) (offset:44) + element: <testLibrary>::@class::A::@method::foo formalParameters - a @32 - element: <testLibraryFragment>::@mixin::B::@method::foo::@parameter::a#element - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - libraryImports - package:test/a.dart + #F4 a (nameOffset:55) (firstTokenOffset:48) (offset:55) + element: <testLibrary>::@class::A::@method::foo::@formalParameter::a mixins - mixin B @52 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B + #F5 mixin B (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::B - previousFragment: <testLibraryFragment>::@mixin::B + nextFragment: #F6 + methods + #F7 foo (nameOffset:12) (firstTokenOffset:12) (offset:12) + element: <testLibrary>::@mixin::B::@method::foo + formalParameters + #F8 a (nameOffset:16) (firstTokenOffset:16) (offset:16) + element: <testLibrary>::@mixin::B::@method::foo::@formalParameter::a + #F6 mixin B (nameOffset:81) (firstTokenOffset:67) (offset:81) + element: <testLibrary>::@mixin::B + previousFragment: #F5 + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + constructors + synthetic new + reference: <testLibrary>::@class::A::@constructor::new + firstFragment: #F2 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + formalParameters + #E0 requiredPositional a + firstFragment: #F4 + type: String + returnType: int mixins mixin B reference: <testLibrary>::@mixin::B - firstFragment: <testLibraryFragment>::@mixin::B + firstFragment: #F5 superclassConstraints A methods foo reference: <testLibrary>::@mixin::B::@method::foo - firstFragment: <testLibraryFragment>::@mixin::B::@method::foo + firstFragment: #F7 formalParameters - requiredPositional hasImplicitType a + #E1 requiredPositional hasImplicitType a + firstFragment: #F8 type: String + returnType: int '''); } test_inferTypes_method_withAugment() async { - newFile('$testPackageLibPath/a.dart', r''' + var library = await buildLibrary(r''' +mixin B on A { + foo(a) => 0; +} + class A { int foo(String a) => 0; } -'''); - newFile('$testPackageLibPath/b.dart', r''' -part of 'test.dart'; augment mixin B { augment foo(a) => 0; } '''); - var library = await buildLibrary(r''' -import 'a.dart'; -part 'b.dart'; - -mixin B on A { - foo(a) => 0; -} -'''); - checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - libraryImports - package:test/a.dart - enclosingElement3: <testLibraryFragment> - parts - part_0 - uri: package:test/b.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/b.dart - mixins - mixin B @39 - reference: <testLibraryFragment>::@mixin::B - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - superclassConstraints - A - methods - foo @50 - reference: <testLibraryFragment>::@mixin::B::@method::foo - enclosingElement3: <testLibraryFragment>::@mixin::B - parameters - requiredPositional hasImplicitType a @54 - type: String - returnType: int - augmentation: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@methodAugmentation::foo - augmented - superclassConstraints - A - methods - <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@methodAugmentation::foo - <testLibrary>::@fragment::package:test/b.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin B @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart - augmentationTarget: <testLibraryFragment>::@mixin::B - methods - augment foo @49 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@methodAugmentation::foo - enclosingElement3: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B - parameters - requiredPositional hasImplicitType a @53 - type: String - returnType: int - augmentationTarget: <testLibraryFragment>::@mixin::B::@method::foo ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/b.dart - libraryImports - package:test/a.dart - mixins - mixin B @39 - reference: <testLibraryFragment>::@mixin::B - element: <testLibrary>::@mixin::B - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B + classes + #F1 class A (nameOffset:39) (firstTokenOffset:33) (offset:39) + element: <testLibrary>::@class::A + constructors + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:39) + element: <testLibrary>::@class::A::@constructor::new + typeName: A methods - foo @50 - reference: <testLibraryFragment>::@mixin::B::@method::foo - element: <testLibraryFragment>::@mixin::B::@method::foo#element - nextFragment: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@methodAugmentation::foo + #F3 foo (nameOffset:49) (firstTokenOffset:45) (offset:49) + element: <testLibrary>::@class::A::@method::foo formalParameters - a @54 - element: <testLibraryFragment>::@mixin::B::@method::foo::@parameter::a#element - <testLibrary>::@fragment::package:test/b.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> + #F4 a (nameOffset:60) (firstTokenOffset:53) (offset:60) + element: <testLibrary>::@class::A::@method::foo::@formalParameter::a mixins - mixin B @35 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B + #F5 mixin B (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::B - previousFragment: <testLibraryFragment>::@mixin::B + nextFragment: #F6 methods - augment foo @49 - reference: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@methodAugmentation::foo - element: <testLibraryFragment>::@mixin::B::@method::foo#element - previousFragment: <testLibraryFragment>::@mixin::B::@method::foo + #F7 foo (nameOffset:17) (firstTokenOffset:17) (offset:17) + element: <testLibrary>::@mixin::B::@method::foo + nextFragment: #F8 formalParameters - a @53 - element: <testLibrary>::@fragment::package:test/b.dart::@mixinAugmentation::B::@methodAugmentation::foo::@parameter::a#element + #F9 a (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: <testLibrary>::@mixin::B::@method::foo::@formalParameter::a + #F6 mixin B (nameOffset:86) (firstTokenOffset:72) (offset:86) + element: <testLibrary>::@mixin::B + previousFragment: #F5 + methods + #F8 augment foo (nameOffset:100) (firstTokenOffset:92) (offset:100) + element: <testLibrary>::@mixin::B::@method::foo + previousFragment: #F7 + formalParameters + #F10 a (nameOffset:104) (firstTokenOffset:104) (offset:104) + element: <testLibrary>::@mixin::B::@method::foo::@formalParameter::a + classes + class A + reference: <testLibrary>::@class::A + firstFragment: #F1 + constructors + synthetic new + reference: <testLibrary>::@class::A::@constructor::new + firstFragment: #F2 + methods + foo + reference: <testLibrary>::@class::A::@method::foo + firstFragment: #F3 + formalParameters + #E0 requiredPositional a + firstFragment: #F4 + type: String + returnType: int mixins mixin B reference: <testLibrary>::@mixin::B - firstFragment: <testLibraryFragment>::@mixin::B + firstFragment: #F5 superclassConstraints A methods foo reference: <testLibrary>::@mixin::B::@method::foo - firstFragment: <testLibraryFragment>::@mixin::B::@method::foo + firstFragment: #F7 formalParameters - requiredPositional hasImplicitType a + #E1 requiredPositional hasImplicitType a + firstFragment: #F9 type: String + returnType: int +'''); + } + + test_method_typeParameters_111() async { + var library = await buildLibrary(r''' +mixin A { + void foo<T>(){} +} +augment mixin A { + augment void foo<T>(){} +} +augment mixin A { + augment void foo<T>(){} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 mixin A (nameOffset:44) (firstTokenOffset:30) (offset:44) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + nextFragment: #F7 + methods + #F4 augment foo (nameOffset:63) (firstTokenOffset:50) (offset:63) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F3 + nextFragment: #F8 + typeParameters + #F6 T (nameOffset:67) (firstTokenOffset:67) (offset:67) + element: #E0 T + previousFragment: #F5 + nextFragment: #F9 + #F7 mixin A (nameOffset:90) (firstTokenOffset:76) (offset:90) + element: <testLibrary>::@mixin::A + previousFragment: #F2 + methods + #F8 augment foo (nameOffset:109) (firstTokenOffset:96) (offset:109) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F4 + typeParameters + #F9 T (nameOffset:113) (firstTokenOffset:113) (offset:113) + element: #E0 T + previousFragment: #F6 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + superclassConstraints + Object + methods + foo + reference: <testLibrary>::@mixin::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + returnType: void +'''); + } + + test_method_typeParameters_121() async { + var library = await buildLibrary(r''' +mixin A { + void foo<T>(){} +} +augment mixin A { + augment void foo<T, U>(){} +} +augment mixin A { + augment void foo<T>(){} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 mixin A (nameOffset:44) (firstTokenOffset:30) (offset:44) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + nextFragment: #F7 + methods + #F4 augment foo (nameOffset:63) (firstTokenOffset:50) (offset:63) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F3 + nextFragment: #F8 + typeParameters + #F6 T (nameOffset:67) (firstTokenOffset:67) (offset:67) + element: #E0 T + previousFragment: #F5 + nextFragment: #F9 + #F7 mixin A (nameOffset:93) (firstTokenOffset:79) (offset:93) + element: <testLibrary>::@mixin::A + previousFragment: #F2 + methods + #F8 augment foo (nameOffset:112) (firstTokenOffset:99) (offset:112) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F4 + typeParameters + #F9 T (nameOffset:116) (firstTokenOffset:116) (offset:116) + element: #E0 T + previousFragment: #F6 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + superclassConstraints + Object + methods + foo + reference: <testLibrary>::@mixin::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + returnType: void +'''); + } + + test_method_typeParameters_212() async { + var library = await buildLibrary(r''' +mixin A { + void foo<T, U>(){} +} +augment mixin A { + augment void foo<T>(){} +} +augment mixin A { + augment void foo<T, U>(){} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F7 U (nameOffset:24) (firstTokenOffset:24) (offset:24) + element: #E1 U + nextFragment: #F8 + #F2 mixin A (nameOffset:47) (firstTokenOffset:33) (offset:47) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + nextFragment: #F9 + methods + #F4 augment foo (nameOffset:66) (firstTokenOffset:53) (offset:66) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F3 + nextFragment: #F10 + typeParameters + #F6 T (nameOffset:70) (firstTokenOffset:70) (offset:70) + element: #E0 T + previousFragment: #F5 + nextFragment: #F11 + #F8 U (nameOffset:<null>) (firstTokenOffset:<null>) (offset:66) + element: #E1 U + previousFragment: #F7 + nextFragment: #F12 + #F9 mixin A (nameOffset:93) (firstTokenOffset:79) (offset:93) + element: <testLibrary>::@mixin::A + previousFragment: #F2 + methods + #F10 augment foo (nameOffset:112) (firstTokenOffset:99) (offset:112) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F4 + typeParameters + #F11 T (nameOffset:116) (firstTokenOffset:116) (offset:116) + element: #E0 T + previousFragment: #F6 + #F12 U (nameOffset:119) (firstTokenOffset:119) (offset:119) + element: #E1 U + previousFragment: #F8 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + superclassConstraints + Object + methods + foo + reference: <testLibrary>::@mixin::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + #E1 U + firstFragment: #F7 + returnType: void +'''); + } + + test_method_typeParameters_bounds_bounds_int_int() async { + var library = await buildLibrary(r''' +mixin A { + void foo<T extends int>() {} +} +augment mixin A { + augment void foo<T extends int>() {} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 mixin A (nameOffset:57) (firstTokenOffset:43) (offset:57) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + methods + #F4 augment foo (nameOffset:76) (firstTokenOffset:63) (offset:76) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F3 + typeParameters + #F6 T (nameOffset:80) (firstTokenOffset:80) (offset:80) + element: #E0 T + previousFragment: #F5 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + superclassConstraints + Object + methods + foo + reference: <testLibrary>::@mixin::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + bound: int + returnType: void +'''); + } + + test_method_typeParameters_bounds_int_nothing() async { + var library = await buildLibrary(r''' +mixin A { + void foo<T extends int>() {} +} +augment mixin A { + augment void foo<T>() {} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 mixin A (nameOffset:57) (firstTokenOffset:43) (offset:57) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + methods + #F4 augment foo (nameOffset:76) (firstTokenOffset:63) (offset:76) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F3 + typeParameters + #F6 T (nameOffset:80) (firstTokenOffset:80) (offset:80) + element: #E0 T + previousFragment: #F5 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + superclassConstraints + Object + methods + foo + reference: <testLibrary>::@mixin::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + bound: int + returnType: void +'''); + } + + test_method_typeParameters_bounds_int_string() async { + var library = await buildLibrary(r''' +mixin A { + void foo<T extends int>() {} +} +augment mixin A { + augment void foo<T extends String>() {} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 mixin A (nameOffset:57) (firstTokenOffset:43) (offset:57) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + methods + #F4 augment foo (nameOffset:76) (firstTokenOffset:63) (offset:76) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F3 + typeParameters + #F6 T (nameOffset:80) (firstTokenOffset:80) (offset:80) + element: #E0 T + previousFragment: #F5 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + superclassConstraints + Object + methods + foo + reference: <testLibrary>::@mixin::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + bound: int + returnType: void +'''); + } + + test_method_typeParameters_bounds_nothing_int() async { + var library = await buildLibrary(r''' +mixin A { + void foo<T>() {} +} +augment mixin A { + augment void foo<T extends int>() {} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F2 mixin A (nameOffset:45) (firstTokenOffset:31) (offset:45) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + methods + #F4 augment foo (nameOffset:64) (firstTokenOffset:51) (offset:64) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F3 + typeParameters + #F6 T (nameOffset:68) (firstTokenOffset:68) (offset:68) + element: #E0 T + previousFragment: #F5 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + superclassConstraints + Object + methods + foo + reference: <testLibrary>::@mixin::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + returnType: void +'''); + } + + test_method_typeParameters_differentNames() async { + var library = await buildLibrary(r''' +mixin A { + void foo<T, U>() {} +} + +augment mixin A { + augment void foo<U, T>() {} +} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + methods + #F3 foo (nameOffset:17) (firstTokenOffset:12) (offset:17) + element: <testLibrary>::@mixin::A::@method::foo + nextFragment: #F4 + typeParameters + #F5 T (nameOffset:21) (firstTokenOffset:21) (offset:21) + element: #E0 T + nextFragment: #F6 + #F7 U (nameOffset:24) (firstTokenOffset:24) (offset:24) + element: #E1 U + nextFragment: #F8 + #F2 mixin A (nameOffset:49) (firstTokenOffset:35) (offset:49) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + methods + #F4 augment foo (nameOffset:68) (firstTokenOffset:55) (offset:68) + element: <testLibrary>::@mixin::A::@method::foo + previousFragment: #F3 + typeParameters + #F6 U (nameOffset:72) (firstTokenOffset:72) (offset:72) + element: #E0 T + previousFragment: #F5 + #F8 T (nameOffset:75) (firstTokenOffset:75) (offset:75) + element: #E1 U + previousFragment: #F7 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + superclassConstraints + Object + methods + foo + reference: <testLibrary>::@mixin::A::@method::foo + firstFragment: #F3 + typeParameters + #E0 T + firstFragment: #F5 + #E1 U + firstFragment: #F7 + returnType: void '''); } test_modifiers_base() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment base mixin A {} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; base mixin A {} +augment base mixin A {} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - base mixin A @26 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - augmented - superclassConstraints - Object - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment base mixin A @40 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - augmentationTarget: <testLibraryFragment>::@mixin::A ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @26 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:11) (firstTokenOffset:0) (offset:11) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @40 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 + #F2 mixin A (nameOffset:35) (firstTokenOffset:16) (offset:35) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 mixins base mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 superclassConstraints Object '''); @@ -7845,64 +5336,31 @@ checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - classes - class I @30 - reference: <testLibraryFragment>::@class::I - enclosingElement3: <testLibraryFragment> - constructors - synthetic @-1 - reference: <testLibraryFragment>::@class::I::@constructor::new - enclosingElement3: <testLibraryFragment>::@class::I - augmented - constructors - <testLibraryFragment>::@class::I::@constructor::new - mixins - mixin A @6 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - superclassConstraints - Object - interfaces - I - augmented - superclassConstraints - Object - interfaces - I ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> classes - class I @30 - reference: <testLibraryFragment>::@class::I + #F1 class I (nameOffset:30) (firstTokenOffset:24) (offset:30) element: <testLibrary>::@class::I constructors - synthetic new - reference: <testLibraryFragment>::@class::I::@constructor::new - element: <testLibraryFragment>::@class::I::@constructor::new#element + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:30) + element: <testLibrary>::@class::I::@constructor::new typeName: I mixins - mixin A @6 - reference: <testLibraryFragment>::@mixin::A + #F3 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A classes class I reference: <testLibrary>::@class::I - firstFragment: <testLibraryFragment>::@class::I + firstFragment: #F1 constructors synthetic new - firstFragment: <testLibraryFragment>::@class::I::@constructor::new + reference: <testLibrary>::@class::I::@constructor::new + firstFragment: #F2 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F3 superclassConstraints Object interfaces @@ -7919,151 +5377,401 @@ checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - classes - class B @22 - reference: <testLibraryFragment>::@class::B - enclosingElement3: <testLibraryFragment> - constructors - synthetic @-1 - reference: <testLibraryFragment>::@class::B::@constructor::new - enclosingElement3: <testLibraryFragment>::@class::B - augmented - constructors - <testLibraryFragment>::@class::B::@constructor::new - mixins - mixin A @6 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - superclassConstraints - B - augmented - superclassConstraints - B ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> classes - class B @22 - reference: <testLibraryFragment>::@class::B + #F1 class B (nameOffset:22) (firstTokenOffset:16) (offset:22) element: <testLibrary>::@class::B constructors - synthetic new - reference: <testLibraryFragment>::@class::B::@constructor::new - element: <testLibraryFragment>::@class::B::@constructor::new#element + #F2 synthetic new (nameOffset:<null>) (firstTokenOffset:<null>) (offset:22) + element: <testLibrary>::@class::B::@constructor::new typeName: B mixins - mixin A @6 - reference: <testLibraryFragment>::@mixin::A + #F3 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A classes class B reference: <testLibrary>::@class::B - firstFragment: <testLibraryFragment>::@class::B + firstFragment: #F1 constructors synthetic new - firstFragment: <testLibraryFragment>::@class::B::@constructor::new + reference: <testLibrary>::@class::B::@constructor::new + firstFragment: #F2 mixins mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F3 superclassConstraints B '''); } test_notSimplyBounded_self() async { - newFile('$testPackageLibPath/a.dart', r''' -part of 'test.dart'; -augment mixin A<T extends A> {} -'''); - var library = await buildLibrary(r''' -part 'a.dart'; mixin A<T extends A> {} + +augment mixin A<T extends A> {} '''); checkElementText(library, r''' library reference: <testLibrary> - definingUnit: <testLibraryFragment> - units - <testLibraryFragment> - enclosingElement3: <null> - parts - part_0 - uri: package:test/a.dart - enclosingElement3: <testLibraryFragment> - unit: <testLibrary>::@fragment::package:test/a.dart - mixins - notSimplyBounded mixin A @21 - reference: <testLibraryFragment>::@mixin::A - enclosingElement3: <testLibraryFragment> - typeParameters - covariant T @23 - bound: A<dynamic> - defaultType: dynamic - augmentation: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - superclassConstraints - Object - augmented - superclassConstraints - Object - <testLibrary>::@fragment::package:test/a.dart - enclosingElement3: <testLibraryFragment> - mixins - augment mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A - enclosingElement3: <testLibrary>::@fragment::package:test/a.dart - typeParameters - covariant T @37 - bound: A<dynamic> - defaultType: dynamic - augmentationTarget: <testLibraryFragment>::@mixin::A ----------------------------------------- -library - reference: <testLibrary> fragments - <testLibraryFragment> + #F0 <testLibraryFragment> element: <testLibrary> - nextFragment: <testLibrary>::@fragment::package:test/a.dart mixins - mixin A @21 - reference: <testLibraryFragment>::@mixin::A + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) element: <testLibrary>::@mixin::A - nextFragment: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + nextFragment: #F2 typeParameters - T @23 - element: <not-implemented> - <testLibrary>::@fragment::package:test/a.dart - element: <testLibrary> - enclosingFragment: <testLibraryFragment> - previousFragment: <testLibraryFragment> - mixins - mixin A @35 - reference: <testLibrary>::@fragment::package:test/a.dart::@mixinAugmentation::A + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 + #F2 mixin A (nameOffset:39) (firstTokenOffset:25) (offset:39) element: <testLibrary>::@mixin::A - previousFragment: <testLibraryFragment>::@mixin::A + previousFragment: #F1 typeParameters - T @37 - element: <not-implemented> + #F4 T (nameOffset:41) (firstTokenOffset:41) (offset:41) + element: #E0 T + previousFragment: #F3 mixins notSimplyBounded mixin A reference: <testLibrary>::@mixin::A - firstFragment: <testLibraryFragment>::@mixin::A + firstFragment: #F1 typeParameters - T + #E0 T + firstFragment: #F3 bound: A<dynamic> superclassConstraints Object '''); } + + test_typeParameters_111() async { + var library = await buildLibrary(r''' +mixin A<T> {} +augment mixin A<T> {} +augment mixin A<T> {} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + typeParameters + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 + #F2 mixin A (nameOffset:28) (firstTokenOffset:14) (offset:28) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + nextFragment: #F5 + typeParameters + #F4 T (nameOffset:30) (firstTokenOffset:30) (offset:30) + element: #E0 T + previousFragment: #F3 + nextFragment: #F6 + #F5 mixin A (nameOffset:50) (firstTokenOffset:36) (offset:50) + element: <testLibrary>::@mixin::A + previousFragment: #F2 + typeParameters + #F6 T (nameOffset:52) (firstTokenOffset:52) (offset:52) + element: #E0 T + previousFragment: #F4 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + typeParameters + #E0 T + firstFragment: #F3 + superclassConstraints + Object +'''); + } + + test_typeParameters_121() async { + var library = await buildLibrary(r''' +mixin A<T> {} +augment mixin A<T, U> {} +augment mixin A<T> {} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + typeParameters + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 + #F2 mixin A (nameOffset:28) (firstTokenOffset:14) (offset:28) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + nextFragment: #F5 + typeParameters + #F4 T (nameOffset:30) (firstTokenOffset:30) (offset:30) + element: #E0 T + previousFragment: #F3 + nextFragment: #F6 + #F5 mixin A (nameOffset:53) (firstTokenOffset:39) (offset:53) + element: <testLibrary>::@mixin::A + previousFragment: #F2 + typeParameters + #F6 T (nameOffset:55) (firstTokenOffset:55) (offset:55) + element: #E0 T + previousFragment: #F4 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + typeParameters + #E0 T + firstFragment: #F3 + superclassConstraints + Object +'''); + } + + test_typeParameters_212() async { + var library = await buildLibrary(r''' +mixin A<T, U> {} +augment mixin A<T> {} +augment mixin A<T, U> {} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + typeParameters + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 + #F5 U (nameOffset:11) (firstTokenOffset:11) (offset:11) + element: #E1 U + nextFragment: #F6 + #F2 mixin A (nameOffset:31) (firstTokenOffset:17) (offset:31) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + nextFragment: #F7 + typeParameters + #F4 T (nameOffset:33) (firstTokenOffset:33) (offset:33) + element: #E0 T + previousFragment: #F3 + nextFragment: #F8 + #F6 U (nameOffset:<null>) (firstTokenOffset:<null>) (offset:31) + element: #E1 U + previousFragment: #F5 + nextFragment: #F9 + #F7 mixin A (nameOffset:53) (firstTokenOffset:39) (offset:53) + element: <testLibrary>::@mixin::A + previousFragment: #F2 + typeParameters + #F8 T (nameOffset:55) (firstTokenOffset:55) (offset:55) + element: #E0 T + previousFragment: #F4 + #F9 U (nameOffset:58) (firstTokenOffset:58) (offset:58) + element: #E1 U + previousFragment: #F6 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + typeParameters + #E0 T + firstFragment: #F3 + #E1 U + firstFragment: #F5 + superclassConstraints + Object +'''); + } + + test_typeParameters_bounds_int_int() async { + var library = await buildLibrary(r''' +mixin A<T extends int> {} +augment mixin A<T extends int> {} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + typeParameters + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 + #F2 mixin A (nameOffset:40) (firstTokenOffset:26) (offset:40) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + typeParameters + #F4 T (nameOffset:42) (firstTokenOffset:42) (offset:42) + element: #E0 T + previousFragment: #F3 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + typeParameters + #E0 T + firstFragment: #F3 + bound: int + superclassConstraints + Object +'''); + } + + test_typeParameters_bounds_int_nothing() async { + var library = await buildLibrary(r''' +mixin A<T extends int> {} +augment mixin A<T> {} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + typeParameters + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 + #F2 mixin A (nameOffset:40) (firstTokenOffset:26) (offset:40) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + typeParameters + #F4 T (nameOffset:42) (firstTokenOffset:42) (offset:42) + element: #E0 T + previousFragment: #F3 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + typeParameters + #E0 T + firstFragment: #F3 + bound: int + superclassConstraints + Object +'''); + } + + test_typeParameters_bounds_int_string() async { + var library = await buildLibrary(r''' +mixin A<T extends int> {} +augment mixin A<T extends String> {} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + typeParameters + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 + #F2 mixin A (nameOffset:40) (firstTokenOffset:26) (offset:40) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + typeParameters + #F4 T (nameOffset:42) (firstTokenOffset:42) (offset:42) + element: #E0 T + previousFragment: #F3 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + typeParameters + #E0 T + firstFragment: #F3 + bound: int + superclassConstraints + Object +'''); + } + + test_typeParameters_bounds_nothing_int() async { + var library = await buildLibrary(r''' +mixin A<T> {} +augment mixin A<T extends int> {} +'''); + + configuration.withConstructors = false; + checkElementText(library, r''' +library + reference: <testLibrary> + fragments + #F0 <testLibraryFragment> + element: <testLibrary> + mixins + #F1 mixin A (nameOffset:6) (firstTokenOffset:0) (offset:6) + element: <testLibrary>::@mixin::A + nextFragment: #F2 + typeParameters + #F3 T (nameOffset:8) (firstTokenOffset:8) (offset:8) + element: #E0 T + nextFragment: #F4 + #F2 mixin A (nameOffset:28) (firstTokenOffset:14) (offset:28) + element: <testLibrary>::@mixin::A + previousFragment: #F1 + typeParameters + #F4 T (nameOffset:30) (firstTokenOffset:30) (offset:30) + element: #E0 T + previousFragment: #F3 + mixins + mixin A + reference: <testLibrary>::@mixin::A + firstFragment: #F1 + typeParameters + #E0 T + firstFragment: #F3 + superclassConstraints + Object +'''); + } } @reflectiveTest
diff --git a/tools/VERSION b/tools/VERSION index 8139009..dd943b7 100644 --- a/tools/VERSION +++ b/tools/VERSION
@@ -27,5 +27,5 @@ MAJOR 3 MINOR 10 PATCH 0 -PRERELEASE 187 +PRERELEASE 188 PRERELEASE_PATCH 0