Version 2.19.0-144.0.dev Merge commit 'c6576e4bc9ca08e8a3830b7681086efd87d98319' into 'dev'
diff --git a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart index 7af7a81..8ed8068 100644 --- a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart +++ b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
@@ -8463,12 +8463,51 @@ const Template< Message Function( String + name)> templateNonAugmentationClassConflict = const Template< + Message Function(String name)>( + problemMessageTemplate: + r"""Class '#name' conflicts with an existing class of the same name in the augmented library.""", + correctionMessageTemplate: + r"""Try changing the name of the class or adding an 'augment' modifier.""", + withArguments: _withArgumentsNonAugmentationClassConflict); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Message Function(String name)> codeNonAugmentationClassConflict = + const Code<Message Function(String name)>( + "NonAugmentationClassConflict", +); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +Message _withArgumentsNonAugmentationClassConflict(String name) { + if (name.isEmpty) throw 'No name provided'; + name = demangleMixinApplicationName(name); + return new Message(codeNonAugmentationClassConflict, + problemMessage: + """Class '${name}' conflicts with an existing class of the same name in the augmented library.""", + correctionMessage: """Try changing the name of the class or adding an 'augment' modifier.""", + arguments: {'name': name}); +} + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Null> codeNonAugmentationClassConflictCause = + messageNonAugmentationClassConflictCause; + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const MessageCode messageNonAugmentationClassConflictCause = const MessageCode( + "NonAugmentationClassConflictCause", + severity: Severity.context, + problemMessage: r"""This is the existing class."""); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Template< + Message Function( + String name)> templateNonAugmentationClassMemberConflict = const Template< Message Function(String name)>( problemMessageTemplate: r"""Member '#name' conflicts with an existing member of the same name in the augmented class.""", correctionMessageTemplate: - r"""Try changing the name to an existing member or adding an 'augment' modifier.""", + r"""Try changing the name of the member or adding an 'augment' modifier.""", withArguments: _withArgumentsNonAugmentationClassMemberConflict); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. @@ -8485,19 +8524,127 @@ return new Message(codeNonAugmentationClassMemberConflict, problemMessage: """Member '${name}' conflicts with an existing member of the same name in the augmented class.""", - correctionMessage: """Try changing the name to an existing member or adding an 'augment' modifier.""", + correctionMessage: """Try changing the name of the member or adding an 'augment' modifier.""", arguments: {'name': name}); } // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. -const Code<Null> codeNonAugmentationClassMemberConflictCause = - messageNonAugmentationClassMemberConflictCause; +const Template< + Message Function( + String + name)> templateNonAugmentationConstructorConflict = const Template< + Message Function(String name)>( + problemMessageTemplate: + r"""Constructor '#name' conflicts with an existing constructor of the same name in the augmented class.""", + correctionMessageTemplate: + r"""Try changing the name of the constructor or adding an 'augment' modifier.""", + withArguments: _withArgumentsNonAugmentationConstructorConflict); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. -const MessageCode messageNonAugmentationClassMemberConflictCause = - const MessageCode("NonAugmentationClassMemberConflictCause", +const Code<Message Function(String name)> + codeNonAugmentationConstructorConflict = + const Code<Message Function(String name)>( + "NonAugmentationConstructorConflict", +); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +Message _withArgumentsNonAugmentationConstructorConflict(String name) { + if (name.isEmpty) throw 'No name provided'; + name = demangleMixinApplicationName(name); + return new Message(codeNonAugmentationConstructorConflict, + problemMessage: + """Constructor '${name}' conflicts with an existing constructor of the same name in the augmented class.""", + correctionMessage: """Try changing the name of the constructor or adding an 'augment' modifier.""", + arguments: {'name': name}); +} + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Null> codeNonAugmentationConstructorConflictCause = + messageNonAugmentationConstructorConflictCause; + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const MessageCode messageNonAugmentationConstructorConflictCause = + const MessageCode("NonAugmentationConstructorConflictCause", severity: Severity.context, - problemMessage: r"""This is the existing member."""); + problemMessage: r"""This is the existing constructor."""); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Null> codeNonAugmentationDeclarationConflictCause = + messageNonAugmentationDeclarationConflictCause; + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const MessageCode messageNonAugmentationDeclarationConflictCause = + const MessageCode("NonAugmentationDeclarationConflictCause", + severity: Severity.context, + problemMessage: r"""This is the existing declaration."""); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Template< + Message Function( + String + name)> templateNonAugmentationLibraryConflict = const Template< + Message Function(String name)>( + problemMessageTemplate: + r"""Declaration '#name' conflicts with an existing declaration of the same name in the augmented library.""", + correctionMessageTemplate: r"""Try changing the name of the declaration.""", + withArguments: _withArgumentsNonAugmentationLibraryConflict); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Message Function(String name)> codeNonAugmentationLibraryConflict = + const Code<Message Function(String name)>( + "NonAugmentationLibraryConflict", +); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +Message _withArgumentsNonAugmentationLibraryConflict(String name) { + if (name.isEmpty) throw 'No name provided'; + name = demangleMixinApplicationName(name); + return new Message(codeNonAugmentationLibraryConflict, + problemMessage: + """Declaration '${name}' conflicts with an existing declaration of the same name in the augmented library.""", + correctionMessage: """Try changing the name of the declaration.""", + arguments: {'name': name}); +} + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Template< + Message Function( + String + name)> templateNonAugmentationLibraryMemberConflict = const Template< + Message Function(String name)>( + problemMessageTemplate: + r"""Member '#name' conflicts with an existing member of the same name in the augmented library.""", + correctionMessageTemplate: + r"""Try changing the name of the member or adding an 'augment' modifier.""", + withArguments: _withArgumentsNonAugmentationLibraryMemberConflict); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Message Function(String name)> + codeNonAugmentationLibraryMemberConflict = + const Code<Message Function(String name)>( + "NonAugmentationLibraryMemberConflict", +); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +Message _withArgumentsNonAugmentationLibraryMemberConflict(String name) { + if (name.isEmpty) throw 'No name provided'; + name = demangleMixinApplicationName(name); + return new Message(codeNonAugmentationLibraryMemberConflict, + problemMessage: + """Member '${name}' conflicts with an existing member of the same name in the augmented library.""", + correctionMessage: """Try changing the name of the member or adding an 'augment' modifier.""", + arguments: {'name': name}); +} + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Null> codeNonAugmentationMemberConflictCause = + messageNonAugmentationMemberConflictCause; + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const MessageCode messageNonAugmentationMemberConflictCause = const MessageCode( + "NonAugmentationMemberConflictCause", + severity: Severity.context, + problemMessage: r"""This is the existing member."""); // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Code<Null> codeNonConstConstructor = messageNonConstConstructor; @@ -11131,6 +11278,35 @@ const Template< Message Function( String + name)> templateUnmatchedAugmentationClass = const Template< + Message Function(String name)>( + problemMessageTemplate: + r"""Augmentation class '#name' doesn't match a class in the augmented library.""", + correctionMessageTemplate: + r"""Try changing the name to an existing class or removing the 'augment' modifier.""", + withArguments: _withArgumentsUnmatchedAugmentationClass); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Message Function(String name)> codeUnmatchedAugmentationClass = + const Code<Message Function(String name)>( + "UnmatchedAugmentationClass", +); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +Message _withArgumentsUnmatchedAugmentationClass(String name) { + if (name.isEmpty) throw 'No name provided'; + name = demangleMixinApplicationName(name); + return new Message(codeUnmatchedAugmentationClass, + problemMessage: + """Augmentation class '${name}' doesn't match a class in the augmented library.""", + correctionMessage: """Try changing the name to an existing class or removing the 'augment' modifier.""", + arguments: {'name': name}); +} + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Template< + Message Function( + String name)> templateUnmatchedAugmentationClassMember = const Template< Message Function(String name)>( problemMessageTemplate: @@ -11157,6 +11333,94 @@ } // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Template< + Message Function( + String + name)> templateUnmatchedAugmentationConstructor = const Template< + Message Function(String name)>( + problemMessageTemplate: + r"""Augmentation constructor '#name' doesn't match a constructor in the augmented class.""", + correctionMessageTemplate: + r"""Try changing the name to an existing constructor or removing the 'augment' modifier.""", + withArguments: _withArgumentsUnmatchedAugmentationConstructor); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Message Function(String name)> codeUnmatchedAugmentationConstructor = + const Code<Message Function(String name)>( + "UnmatchedAugmentationConstructor", +); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +Message _withArgumentsUnmatchedAugmentationConstructor(String name) { + if (name.isEmpty) throw 'No name provided'; + name = demangleMixinApplicationName(name); + return new Message(codeUnmatchedAugmentationConstructor, + problemMessage: + """Augmentation constructor '${name}' doesn't match a constructor in the augmented class.""", + correctionMessage: """Try changing the name to an existing constructor or removing the 'augment' modifier.""", + arguments: {'name': name}); +} + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Template< + Message Function( + String + name)> templateUnmatchedAugmentationDeclaration = const Template< + Message Function(String name)>( + problemMessageTemplate: + r"""Augmentation '#name' doesn't match a declaration in the augmented library.""", + correctionMessageTemplate: + r"""Try changing the name to an existing declaration or removing the 'augment' modifier.""", + withArguments: _withArgumentsUnmatchedAugmentationDeclaration); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Message Function(String name)> codeUnmatchedAugmentationDeclaration = + const Code<Message Function(String name)>( + "UnmatchedAugmentationDeclaration", +); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +Message _withArgumentsUnmatchedAugmentationDeclaration(String name) { + if (name.isEmpty) throw 'No name provided'; + name = demangleMixinApplicationName(name); + return new Message(codeUnmatchedAugmentationDeclaration, + problemMessage: + """Augmentation '${name}' doesn't match a declaration in the augmented library.""", + correctionMessage: """Try changing the name to an existing declaration or removing the 'augment' modifier.""", + arguments: {'name': name}); +} + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Template< + Message Function( + String + name)> templateUnmatchedAugmentationLibraryMember = const Template< + Message Function(String name)>( + problemMessageTemplate: + r"""Augmentation member '#name' doesn't match a member in the augmented library.""", + correctionMessageTemplate: + r"""Try changing the name to an existing member or removing the 'augment' modifier.""", + withArguments: _withArgumentsUnmatchedAugmentationLibraryMember); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +const Code<Message Function(String name)> + codeUnmatchedAugmentationLibraryMember = + const Code<Message Function(String name)>( + "UnmatchedAugmentationLibraryMember", +); + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. +Message _withArgumentsUnmatchedAugmentationLibraryMember(String name) { + if (name.isEmpty) throw 'No name provided'; + name = demangleMixinApplicationName(name); + return new Message(codeUnmatchedAugmentationLibraryMember, + problemMessage: + """Augmentation member '${name}' doesn't match a member in the augmented library.""", + correctionMessage: """Try changing the name to an existing member or removing the 'augment' modifier.""", + arguments: {'name': name}); +} + +// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE. const Template<Message Function(String string, Token token)> templateUnmatchedToken = const Template<Message Function(String string, Token token)>(
diff --git a/pkg/front_end/lib/src/fasta/builder/builder.dart b/pkg/front_end/lib/src/fasta/builder/builder.dart index 347694c..e420b7f 100644 --- a/pkg/front_end/lib/src/fasta/builder/builder.dart +++ b/pkg/front_end/lib/src/fasta/builder/builder.dart
@@ -294,3 +294,22 @@ @override bool get isDuplicate => next != null; } + +extension BuilderExtension on Builder { + /// Returns the 'duplicate index' for this builder, which is the number of + /// builders declared prior this. + /// + /// For a non-duplicate builder, this is 0. + int get duplicateIndex { + if (next != null) { + int count = 0; + Builder? current = next; + while (current != null) { + count++; + current = current.next; + } + return count; + } + return 0; + } +}
diff --git a/pkg/front_end/lib/src/fasta/builder/library_builder.dart b/pkg/front_end/lib/src/fasta/builder/library_builder.dart index 605d859..fe0a730 100644 --- a/pkg/front_end/lib/src/fasta/builder/library_builder.dart +++ b/pkg/front_end/lib/src/fasta/builder/library_builder.dart
@@ -10,7 +10,7 @@ import '../combinator.dart' show CombinatorBuilder; -import '../problems.dart' show internalProblem, unsupported; +import '../problems.dart' show internalProblem; import '../export.dart' show Export; @@ -140,9 +140,6 @@ Builder? lookup(String name, int charOffset, Uri fileUri); - /// If this is a patch library, apply its patches to [origin]. - void applyPatches(); - void recordAccess(int charOffset, int length, Uri fileUri); bool get isNonNullableByDefault; @@ -334,12 +331,6 @@ } @override - void applyPatches() { - if (!isPatch) return; - unsupported("${runtimeType}.applyPatches", -1, fileUri); - } - - @override void recordAccess(int charOffset, int length, Uri fileUri) {} @override
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart index c2b5ede..b3077f0 100644 --- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart +++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -3987,41 +3987,39 @@ // Pop all elements. This will put them in evaluation order. List<Object?>? elements = const FixedNullableList<Object>().pop(stack, count); - if (elements == null) { - push(new ParserRecovery(token.charOffset)); - return; - } List<Object> originalElementOrder = []; List<Expression> positional = []; List<NamedExpression> named = []; Map<String, NamedExpression>? namedElements; - for (Object? element in elements) { - if (element is NamedExpression) { - namedElements ??= {}; - NamedExpression? existingExpression = namedElements[element.name]; - if (existingExpression != null) { - existingExpression.value = buildProblem( - templateDuplicatedRecordLiteralFieldName - .withArguments(element.name), - element.fileOffset, - element.name.length, - context: [ - templateDuplicatedRecordLiteralFieldNameContext - .withArguments(element.name) - .withLocation( - uri, existingExpression.fileOffset, element.name.length) - ]) - ..parent = existingExpression; + if (elements != null) { + for (Object? element in elements) { + if (element is NamedExpression) { + namedElements ??= {}; + NamedExpression? existingExpression = namedElements[element.name]; + if (existingExpression != null) { + existingExpression.value = buildProblem( + templateDuplicatedRecordLiteralFieldName + .withArguments(element.name), + element.fileOffset, + element.name.length, + context: [ + templateDuplicatedRecordLiteralFieldNameContext + .withArguments(element.name) + .withLocation(uri, existingExpression.fileOffset, + element.name.length) + ]) + ..parent = existingExpression; + } else { + originalElementOrder.add(element); + namedElements[element.name] = element; + named.add(element); + } } else { - originalElementOrder.add(element); - namedElements[element.name] = element; - named.add(element); + Expression expression = toValue(element); + positional.add(expression); + originalElementOrder.add(expression); } - } else { - Expression expression = toValue(element); - positional.add(expression); - originalElementOrder.add(expression); } } push(new InternalRecordLiteral(
diff --git a/pkg/front_end/lib/src/fasta/scope.dart b/pkg/front_end/lib/src/fasta/scope.dart index 3b448ea..8f6be1e 100644 --- a/pkg/front_end/lib/src/fasta/scope.dart +++ b/pkg/front_end/lib/src/fasta/scope.dart
@@ -15,14 +15,7 @@ import 'builder/member_builder.dart'; import 'builder/name_iterator.dart'; import 'builder/type_variable_builder.dart'; -import 'fasta_codes.dart' - show - LocatedMessage, - Message, - messageInternalProblemExtendingUnmodifiableScope, - templateAccessError, - templateDuplicatedDeclarationUse, - templateDuplicatedNamePreviouslyUsedCause; +import 'fasta_codes.dart'; import 'kernel/body_builder.dart' show JumpTarget; import 'kernel/hierarchy/class_member.dart' show ClassMember; import 'kernel/kernel_helper.dart'; @@ -1211,6 +1204,14 @@ f(current); } } + + List<T> toList() { + List<T> list = []; + while (moveNext()) { + list.add(current); + } + return list; + } } extension NameIteratorExtension<T extends Builder> on NameIterator<T> { @@ -1220,3 +1221,308 @@ } } } + +abstract class MergedScope<T extends Builder> { + final T _origin; + final Scope _originScope; + Map<T, Scope> _augmentationScopes = {}; + + MergedScope(this._origin, this._originScope); + + SourceLibraryBuilder get originLibrary; + + void _addBuilderToMergedScope(T parentBuilder, String name, + Builder newBuilder, Builder? existingBuilder, + {required bool setter}) { + if (parentBuilder.isAugmentation) { + if (existingBuilder != null) { + if (newBuilder.isAugmentation) { + existingBuilder.applyPatch(newBuilder); + } else { + newBuilder.isConflictingAugmentationMember = true; + Message message; + Message context; + if (newBuilder is SourceMemberBuilder && + existingBuilder is SourceMemberBuilder) { + if (_origin is SourceLibraryBuilder) { + message = templateNonAugmentationLibraryMemberConflict + .withArguments(name); + } else { + message = templateNonAugmentationClassMemberConflict + .withArguments(name); + } + context = messageNonAugmentationMemberConflictCause; + } else if (newBuilder is SourceClassBuilder && + existingBuilder is SourceClassBuilder) { + message = templateNonAugmentationClassConflict.withArguments(name); + context = messageNonAugmentationClassConflictCause; + } else { + if (_origin is SourceLibraryBuilder) { + message = + templateNonAugmentationLibraryConflict.withArguments(name); + } else { + message = templateNonAugmentationClassMemberConflict + .withArguments(name); + } + context = messageNonAugmentationMemberConflictCause; + } + originLibrary.addProblem( + message, newBuilder.charOffset, name.length, newBuilder.fileUri, + context: [ + context.withLocation(existingBuilder.fileUri!, + existingBuilder.charOffset, name.length) + ]); + } + } else { + if (newBuilder.isAugmentation) { + Message message; + if (newBuilder is SourceMemberBuilder) { + if (_origin is SourceLibraryBuilder) { + message = templateUnmatchedAugmentationLibraryMember + .withArguments(name); + } else { + message = + templateUnmatchedAugmentationClassMember.withArguments(name); + } + } else if (newBuilder is SourceClassBuilder) { + message = templateUnmatchedAugmentationClass.withArguments(name); + } else { + message = + templateUnmatchedAugmentationDeclaration.withArguments(name); + } + originLibrary.addProblem( + message, newBuilder.charOffset, name.length, newBuilder.fileUri); + } else { + _originScope.addLocalMember(name, newBuilder, setter: setter); + for (Scope augmentationScope in _augmentationScopes.values) { + _addBuilderToAugmentationScope(augmentationScope, name, newBuilder, + setter: setter); + } + } + } + } else { + if (existingBuilder != null) { + // Patch libraries implicitly assume matching members are patch + // members. + existingBuilder.applyPatch(newBuilder); + } else { + _addInjectedPatchMember(name, newBuilder); + } + } + } + + void _addBuilderToAugmentationScope( + Scope augmentationScope, String name, Builder member, + {required bool setter}) { + Builder? augmentationMember = + augmentationScope.lookupLocalMember(name, setter: setter); + if (augmentationMember == null) { + augmentationScope.addLocalMember(name, member, setter: setter); + } + } + + void _addAugmentationScope(T parentBuilder, Scope scope) { + // Include all augmentation scope members to the origin scope. + scope.forEachLocalMember((String name, Builder member) { + _addBuilderToMergedScope(parentBuilder, name, member, + _originScope.lookupLocalMember(name, setter: false), + setter: false); + }); + scope.forEachLocalSetter((String name, Builder member) { + _addBuilderToMergedScope(parentBuilder, name, member, + _originScope.lookupLocalMember(name, setter: true), + setter: true); + }); + + // Include all origin scope members in the augmentation scope. + _originScope.forEachLocalMember((String name, Builder originMember) { + _addBuilderToAugmentationScope(scope, name, originMember, setter: false); + }); + _originScope.forEachLocalSetter((String name, Builder originMember) { + _addBuilderToAugmentationScope(scope, name, originMember, setter: true); + }); + + _augmentationScopes[parentBuilder] = scope; + } + + void _addInjectedPatchMember(String name, Builder newBuilder); +} + +class MergedLibraryScope extends MergedScope<SourceLibraryBuilder> { + MergedLibraryScope(SourceLibraryBuilder origin) : super(origin, origin.scope); + + @override + SourceLibraryBuilder get originLibrary => _origin; + + void addAugmentationScope(SourceLibraryBuilder builder) { + _addAugmentationScope(builder, builder.scope); + } + + @override + void _addInjectedPatchMember(String name, Builder newBuilder) { + if (name.startsWith('_')) { + injectMemberFromPatch(name, newBuilder); + } else { + exportMemberFromPatch(name, newBuilder); + } + } + + void injectMemberFromPatch(String name, Builder member) { + if (member.isSetter) { + assert( + _originScope.lookupLocalMember(name, setter: true) == null, + "Setter $name already bound to " + "${_originScope.lookupLocalMember(name, setter: true)}, " + "trying to add $member."); + _originScope.addLocalMember(name, member as MemberBuilder, setter: true); + } else { + assert( + _originScope.lookupLocalMember(name, setter: false) == null, + "Member $name already bound to " + "${_originScope.lookupLocalMember(name, setter: false)}, " + "trying to add $member."); + _originScope.addLocalMember(name, member, setter: false); + } + } + + void exportMemberFromPatch(String name, Builder member) { + if (!originLibrary.importUri.isScheme("dart") || + !originLibrary.importUri.path.startsWith("_")) { + originLibrary.addProblem( + templatePatchInjectionFailed.withArguments( + name, originLibrary.importUri), + member.charOffset, + noLength, + member.fileUri); + } + // Platform-private libraries, such as "dart:_internal" have special + // semantics: public members are injected into the origin library. + // TODO(ahe): See if we can remove this special case. + + // If this member already exist in the origin library scope, it should + // have been marked as patch. + assert((member.isSetter && + _originScope.lookupLocalMember(name, setter: true) == null) || + (!member.isSetter && + _originScope.lookupLocalMember(name, setter: false) == null)); + originLibrary.addToExportScope(name, member); + } +} + +class MergedClassMemberScope extends MergedScope<SourceClassBuilder> { + final ConstructorScope _originConstructorScope; + Map<SourceClassBuilder, ConstructorScope> _augmentationConstructorScopes = {}; + + MergedClassMemberScope(SourceClassBuilder origin) + : _originConstructorScope = origin.constructorScope, + super(origin, origin.scope); + + @override + SourceLibraryBuilder get originLibrary => _origin.libraryBuilder; + + void _addAugmentationConstructorScope( + SourceClassBuilder classBuilder, ConstructorScope constructorScope) { + constructorScope.forEach((String name, MemberBuilder newConstructor) { + MemberBuilder? existingConstructor = + _originConstructorScope.lookupLocalMember(name); + if (classBuilder.isAugmentation) { + if (existingConstructor != null) { + if (newConstructor.isAugmentation) { + existingConstructor.applyPatch(newConstructor); + } else { + newConstructor.isConflictingAugmentationMember = true; + originLibrary.addProblem( + templateNonAugmentationConstructorConflict + .withArguments(newConstructor.fullNameForErrors), + newConstructor.charOffset, + noLength, + newConstructor.fileUri, + context: [ + messageNonAugmentationConstructorConflictCause.withLocation( + existingConstructor.fileUri!, + existingConstructor.charOffset, + noLength) + ]); + } + } else { + if (newConstructor.isAugmentation) { + originLibrary.addProblem( + templateUnmatchedAugmentationConstructor + .withArguments(newConstructor.fullNameForErrors), + newConstructor.charOffset, + noLength, + newConstructor.fileUri); + } else { + _originConstructorScope.addLocalMember(name, newConstructor); + for (ConstructorScope augmentationConstructorScope + in _augmentationConstructorScopes.values) { + _addConstructorToAugmentationScope( + augmentationConstructorScope, name, newConstructor); + } + } + } + } else { + if (existingConstructor != null) { + // Patch libraries implicitly assume matching members are patch + // members. + existingConstructor.applyPatch(newConstructor); + } else { + // Members injected into patch are not part of the origin scope. + } + } + }); + _originConstructorScope + .forEach((String name, MemberBuilder originConstructor) { + _addConstructorToAugmentationScope( + constructorScope, name, originConstructor); + }); + } + + void _addConstructorToAugmentationScope( + ConstructorScope augmentationConstructorScope, + String name, + MemberBuilder constructor) { + Builder? augmentationConstructor = + augmentationConstructorScope.lookupLocalMember(name); + if (augmentationConstructor == null) { + augmentationConstructorScope.addLocalMember(name, constructor); + } + } + + // TODO(johnniwinther): Check for conflicts between constructors and class + // members. + void addAugmentationScope(SourceClassBuilder builder) { + _addAugmentationScope(builder, builder.scope); + _addAugmentationConstructorScope(builder, builder.constructorScope); + } + + @override + void _addInjectedPatchMember(String name, Builder newBuilder) { + // Members injected into patch are not part of the origin scope. + } +} + +extension on Builder { + bool get isAugmentation { + Builder self = this; + if (self is SourceLibraryBuilder) { + return self.isAugmentation; + } else if (self is SourceClassBuilder) { + return self.isAugmentation; + } else if (self is SourceMemberBuilder) { + return self.isAugmentation; + } else { + return false; + } + } + + void set isConflictingAugmentationMember(bool value) { + Builder self = this; + if (self is SourceMemberBuilder) { + self.isConflictingAugmentationMember = value; + } else if (self is SourceClassBuilder) { + self.isConflictingAugmentationMember = value; + } + // TODO(johnniwinther): Handle all cases here. + } +}
diff --git a/pkg/front_end/lib/src/fasta/source/source_class_builder.dart b/pkg/front_end/lib/src/fasta/source/source_class_builder.dart index 07ba74e..c3f7b04 100644 --- a/pkg/front_end/lib/src/fasta/source/source_class_builder.dart +++ b/pkg/front_end/lib/src/fasta/source/source_class_builder.dart
@@ -113,8 +113,24 @@ @override final bool isAugmentation; + bool? _isConflictingAugmentationMember; + + /// Returns `true` if this class is a class declared in an augmentation + /// library that conflicts with a declaration in the origin library. + bool get isConflictingAugmentationMember { + return _isConflictingAugmentationMember ??= false; + } + + void set isConflictingAugmentationMember(bool value) { + assert(_isConflictingAugmentationMember == null, + '$this.isConflictingAugmentationMember has already been fixed.'); + _isConflictingAugmentationMember = value; + } + List<SourceClassBuilder>? _patches; + MergedClassMemberScope? _mergedScope; + SourceClassBuilder( List<MetadataBuilder>? metadata, int modifiers, @@ -144,6 +160,9 @@ actualCls.hasConstConstructor = declaresConstConstructor; } + MergedClassMemberScope get mergedScope => _mergedScope ??= + isPatch ? origin.mergedScope : new MergedClassMemberScope(this); + List<SourceClassBuilder>? get patchesForTesting => _patches; SourceClassBuilder? actualOrigin; @@ -167,7 +186,7 @@ void buildBuilders(Builder declaration) { if (declaration.parent != this) { - if (declaration.parent?.origin != this) { + if (declaration.parent?.origin != origin) { if (fileUri != declaration.parent?.fileUri) { unexpected("$fileUri", "${declaration.parent?.fileUri}", charOffset, fileUri); @@ -183,24 +202,7 @@ SourceMemberBuilder memberBuilder = declaration; memberBuilder .buildOutlineNodes((Member member, BuiltMemberKind memberKind) { - member.parent = cls; - if (!memberBuilder.isPatch && - !memberBuilder.isDuplicate && - !memberBuilder.isConflictingSetter && - !memberBuilder.isConflictingAugmentationMember) { - if (member is Procedure) { - cls.addProcedure(member); - } else if (member is Field) { - cls.addField(member); - } else if (member is Constructor) { - cls.addConstructor(member); - } else if (member is RedirectingFactory) { - cls.addRedirectingFactory(member); - } else { - unhandled("${member.runtimeType}", "getMember", member.fileOffset, - member.fileUri); - } - } + _addMemberToClass(declaration, member, memberKind); }); } else { unhandled("${declaration.runtimeType}", "buildBuilders", @@ -386,16 +388,24 @@ // and from the patch don't intersect. assert( _patches == null || - _patches!.every((patchClass) => patchClass.scope.localMembers - .where((b) => b is SourceFieldBuilder) - .map((b) => (b as SourceFieldBuilder).name) + _patches!.every((patchClass) => patchClass.scope + .filteredIterator<SourceFieldBuilder>( + parent: patchClass, + includeDuplicates: false, + includeAugmentations: false) + .toList() + .map((b) => b.name) .toSet() - .intersection(scope.localMembers - .where((b) => b is SourceFieldBuilder) - .map((b) => (b as SourceFieldBuilder).name) + .intersection(scope + .filteredIterator<SourceFieldBuilder>( + parent: this, + includeDuplicates: false, + includeAugmentations: false) + .toList() + .map((b) => b.name) .toSet()) .isEmpty), - "Detected an attempt to patch a field."); + "Detected an attempt to patch a field"); new ClassMemberNameIterator<SourceFieldBuilder>(this, includeDuplicates: false) .forEach(callback); @@ -575,85 +585,7 @@ patch.actualOrigin = this; (_patches ??= []).add(patch); - void applyAugmentation(String name, SourceMemberBuilder patchMember, - {required bool setter}) { - Builder? originMember = scope.lookupLocalMember(name, setter: setter); - if (patch.isAugmentation) { - if (originMember != null) { - if (patchMember.isAugmentation) { - originMember.applyPatch(patchMember); - } else { - patchMember.isConflictingAugmentationMember = true; - libraryBuilder.addProblem( - templateNonAugmentationClassMemberConflict - .withArguments(name), - patchMember.charOffset, - name.length, - patchMember.fileUri, - context: [ - messageNonAugmentationClassMemberConflictCause.withLocation( - originMember.fileUri!, - originMember.charOffset, - name.length) - ]); - } - } else { - if (patchMember.isAugmentation) { - libraryBuilder.addProblem( - templateUnmatchedAugmentationClassMember.withArguments(name), - patchMember.charOffset, - name.length, - patchMember.fileUri); - } else { - scope.addLocalMember(name, patchMember, setter: setter); - } - } - } else { - if (originMember != null) { - // Patch class implicitly assume matching members are patch - // members. - originMember.applyPatch(patchMember); - } else { - // Members injected into patch are not part of the origin scope. - } - } - } - - patch.scope.forEachLocalMember((String name, Builder patchMember) { - if (patchMember is SourceMemberBuilder) { - applyAugmentation(name, patchMember, setter: false); - } else { - assert(false, - "Unexpected member ${patchMember} (${patchMember.runtimeType})"); - } - }); - - patch.scope.forEachLocalSetter((String name, Builder patchMember) { - if (patchMember is SourceMemberBuilder) { - applyAugmentation(name, patchMember, setter: true); - } else { - assert(false, - "Unexpected member ${patchMember} (${patchMember.runtimeType})"); - } - }); - - patch.constructorScope.local - .forEach((String name, MemberBuilder patchConstructor) { - MemberBuilder? originConstructor = constructorScope.local[name]; - if (patch.isAugmentation) { - if (originConstructor != null) { - // TODO(johnniwinther): Should we support constructor augmentation? - // Currently the syntax doesn't allow it. - originConstructor.applyPatch(patchConstructor); - } else { - constructorScope.addLocalMember(name, patchConstructor); - } - } else { - if (originConstructor != null) { - originConstructor.applyPatch(patchConstructor); - } - } - }); + mergedScope.addAugmentationScope(patch); int originLength = typeVariables?.length ?? 0; int patchLength = patch.typeVariables?.length ?? 0; @@ -1134,14 +1066,13 @@ } void checkRedirectingFactories(TypeEnvironment typeEnvironment) { - Map<String, MemberBuilder> constructors = this.constructorScope.local; - for (Builder? constructor in constructors.values) { - do { - if (constructor is RedirectingFactoryBuilder) { - _checkRedirectingFactory(constructor, typeEnvironment); - } - constructor = constructor!.next; - } while (constructor != null); + Iterator<MemberBuilder> iterator = constructorScope.filteredIterator( + parent: this, includeDuplicates: true, includeAugmentations: true); + while (iterator.moveNext()) { + Builder constructor = iterator.current; + if (constructor is RedirectingFactoryBuilder) { + _checkRedirectingFactory(constructor, typeEnvironment); + } } } @@ -1355,7 +1286,7 @@ } if (builder is SourceMemberBuilder) { count += builder.buildBodyNodes((Member member, BuiltMemberKind kind) { - _buildMember(builder, member, kind); + _addMemberToClass(builder, member, kind); }); } } @@ -1371,12 +1302,23 @@ return count; } - void _buildMember(SourceMemberBuilder memberBuilder, Member member, + void _addMemberToClass(SourceMemberBuilder memberBuilder, Member member, BuiltMemberKind memberKind) { member.parent = cls; - if (!memberBuilder.isDuplicate && - !memberBuilder.isConflictingSetter && - !memberBuilder.isConflictingAugmentationMember) { + if (!memberBuilder.isPatch && + !memberBuilder.isDuplicate && + !memberBuilder.isConflictingSetter) { + if (memberBuilder.isConflictingAugmentationMember) { + if (member is Field && member.isStatic || + member is Procedure && member.isStatic) { + member.name = new Name( + '${member.name}#${memberBuilder.libraryBuilder.patchIndex}', + member.name.library); + } else { + return; + } + } + if (member is Procedure) { cls.addProcedure(member); } else if (member is Field) { @@ -1732,129 +1674,125 @@ } int count = constructorReferences!.length; if (count != 0) { - Map<String, MemberBuilder> constructors = this.constructorScope.local; - // Copy keys to avoid concurrent modification error. - for (MapEntry<String, MemberBuilder> entry in constructors.entries) { - Builder? declaration = entry.value; - while (declaration != null) { - if (declaration.parent != this) { - unexpected("$fileUri", "${declaration.parent!.fileUri}", charOffset, - fileUri); - } - if (declaration is RedirectingFactoryBuilder) { - // Compute the immediate redirection target, not the effective. - - ConstructorReferenceBuilder redirectionTarget = - declaration.redirectionTarget; - List<TypeBuilder>? typeArguments = redirectionTarget.typeArguments; - Builder? target = redirectionTarget.target; - if (typeArguments != null && target is MemberBuilder) { - Object? redirectionTargetName = redirectionTarget.name; - if (redirectionTargetName is String) { - // Do nothing. This is the case of an identifier followed by - // type arguments, such as the following: - // B<T> - // B<T>.named - } else if (redirectionTargetName is QualifiedName) { - if (target.name.isEmpty) { - // Do nothing. This is the case of a qualified - // non-constructor prefix (for example, with a library - // qualifier) followed by type arguments, such as the - // following: - // lib.B<T> - } else if (target.name != redirectionTargetName.suffix.lexeme) { - // Do nothing. This is the case of a qualified - // non-constructor prefix followed by type arguments followed - // by a constructor name, such as the following: - // lib.B<T>.named - } else { - // TODO(cstefantsova,johnniwinther): Handle this in case in - // ConstructorReferenceBuilder.resolveIn and unify with other - // cases of handling of type arguments after constructor - // names. - addProblem( - messageConstructorWithTypeArguments, - redirectionTargetName.charOffset, - redirectionTargetName.name.length); - } - } - } - - // ignore: unnecessary_null_comparison - if (redirectionTarget != null) { - Builder? targetBuilder = redirectionTarget.target; - if (declaration.next == null) { - // Only the first one (that is, the last on in the linked list) - // is actually in the kernel tree. This call creates a StaticGet - // to [declaration.target] in a field `_redirecting#` which is - // only legal to do to things in the kernel tree. - Reference? fieldReference; - Reference? getterReference; - if (referencesFromIndexed != null) { - Name name = - new Name(redirectingName, referencesFromIndexed!.library); - fieldReference = - referencesFromIndexed!.lookupFieldReference(name); - getterReference = - referencesFromIndexed!.lookupGetterReference(name); - } - _addRedirectingConstructor( - declaration, library, fieldReference, getterReference); - } - Member? targetNode; - if (targetBuilder is FunctionBuilder) { - targetNode = targetBuilder.member; - } else if (targetBuilder is DillMemberBuilder) { - targetNode = targetBuilder.member; - } else if (targetBuilder is AmbiguousBuilder) { - _addProblemForRedirectingFactory( - declaration, - templateDuplicatedDeclarationUse - .withArguments(redirectionTarget.fullNameForErrors), - redirectionTarget.charOffset, - noLength); - } else { - _addProblemForRedirectingFactory( - declaration, - templateRedirectionTargetNotFound - .withArguments(redirectionTarget.fullNameForErrors), - redirectionTarget.charOffset, - noLength); - } - if (targetNode != null && - targetNode is Constructor && - targetNode.enclosingClass.isAbstract) { - _addProblemForRedirectingFactory( - declaration, - templateAbstractRedirectedClassInstantiation - .withArguments(redirectionTarget.fullNameForErrors), - redirectionTarget.charOffset, - noLength); - targetNode = null; - } - if (targetNode != null && - targetNode is Constructor && - targetNode.enclosingClass.isEnum) { - _addProblemForRedirectingFactory( - declaration, - messageEnumFactoryRedirectsToConstructor, - redirectionTarget.charOffset, - noLength); - targetNode = null; - } - if (targetNode != null) { - List<DartType> typeArguments = declaration.typeArguments ?? - new List<DartType>.filled( - targetNode.enclosingClass!.typeParameters.length, - const UnknownType()); - declaration.setRedirectingFactoryBody( - targetNode, typeArguments); - } - } - } - declaration = declaration.next; + constructorScope + .filteredIterator( + parent: this, includeDuplicates: true, includeAugmentations: true) + .forEach((MemberBuilder declaration) { + if (declaration.parent?.origin != origin) { + unexpected("$fileUri", "${declaration.parent!.fileUri}", charOffset, + fileUri); } - } + if (declaration is RedirectingFactoryBuilder) { + // Compute the immediate redirection target, not the effective. + + ConstructorReferenceBuilder redirectionTarget = + declaration.redirectionTarget; + List<TypeBuilder>? typeArguments = redirectionTarget.typeArguments; + Builder? target = redirectionTarget.target; + if (typeArguments != null && target is MemberBuilder) { + Object? redirectionTargetName = redirectionTarget.name; + if (redirectionTargetName is String) { + // Do nothing. This is the case of an identifier followed by + // type arguments, such as the following: + // B<T> + // B<T>.named + } else if (redirectionTargetName is QualifiedName) { + if (target.name.isEmpty) { + // Do nothing. This is the case of a qualified + // non-constructor prefix (for example, with a library + // qualifier) followed by type arguments, such as the + // following: + // lib.B<T> + } else if (target.name != redirectionTargetName.suffix.lexeme) { + // Do nothing. This is the case of a qualified + // non-constructor prefix followed by type arguments followed + // by a constructor name, such as the following: + // lib.B<T>.named + } else { + // TODO(cstefantsova,johnniwinther): Handle this in case in + // ConstructorReferenceBuilder.resolveIn and unify with other + // cases of handling of type arguments after constructor + // names. + addProblem( + messageConstructorWithTypeArguments, + redirectionTargetName.charOffset, + redirectionTargetName.name.length); + } + } + } + + // ignore: unnecessary_null_comparison + if (redirectionTarget != null) { + Builder? targetBuilder = redirectionTarget.target; + if (declaration.next == null) { + // Only the first one (that is, the last on in the linked list) + // is actually in the kernel tree. This call creates a StaticGet + // to [declaration.target] in a field `_redirecting#` which is + // only legal to do to things in the kernel tree. + Reference? fieldReference; + Reference? getterReference; + if (referencesFromIndexed != null) { + Name name = + new Name(redirectingName, referencesFromIndexed!.library); + fieldReference = + referencesFromIndexed!.lookupFieldReference(name); + getterReference = + referencesFromIndexed!.lookupGetterReference(name); + } + _addRedirectingConstructor( + declaration, library, fieldReference, getterReference); + } + Member? targetNode; + if (targetBuilder is FunctionBuilder) { + targetNode = targetBuilder.member; + } else if (targetBuilder is DillMemberBuilder) { + targetNode = targetBuilder.member; + } else if (targetBuilder is AmbiguousBuilder) { + _addProblemForRedirectingFactory( + declaration, + templateDuplicatedDeclarationUse + .withArguments(redirectionTarget.fullNameForErrors), + redirectionTarget.charOffset, + noLength); + } else { + _addProblemForRedirectingFactory( + declaration, + templateRedirectionTargetNotFound + .withArguments(redirectionTarget.fullNameForErrors), + redirectionTarget.charOffset, + noLength); + } + if (targetNode != null && + targetNode is Constructor && + targetNode.enclosingClass.isAbstract) { + _addProblemForRedirectingFactory( + declaration, + templateAbstractRedirectedClassInstantiation + .withArguments(redirectionTarget.fullNameForErrors), + redirectionTarget.charOffset, + noLength); + targetNode = null; + } + if (targetNode != null && + targetNode is Constructor && + targetNode.enclosingClass.isEnum) { + _addProblemForRedirectingFactory( + declaration, + messageEnumFactoryRedirectsToConstructor, + redirectionTarget.charOffset, + noLength); + targetNode = null; + } + if (targetNode != null) { + List<DartType> typeArguments = declaration.typeArguments ?? + new List<DartType>.filled( + targetNode.enclosingClass!.typeParameters.length, + const UnknownType()); + declaration.setRedirectingFactoryBody(targetNode, typeArguments); + } + } + } + }); } return count; }
diff --git a/pkg/front_end/lib/src/fasta/source/source_extension_builder.dart b/pkg/front_end/lib/src/fasta/source/source_extension_builder.dart index 9ed08c9..8c6fbad 100644 --- a/pkg/front_end/lib/src/fasta/source/source_extension_builder.dart +++ b/pkg/front_end/lib/src/fasta/source/source_extension_builder.dart
@@ -39,6 +39,8 @@ SourceExtensionBuilder? _origin; SourceExtensionBuilder? patchForTesting; + MergedClassMemberScope? _mergedScope; + @override final List<TypeVariableBuilder>? typeParameters; @@ -78,6 +80,11 @@ @override SourceExtensionBuilder get origin => _origin ?? this; + // TODO(johnniwinther): Add merged scope for extensions. + MergedClassMemberScope get mergedScope => _mergedScope ??= isPatch + ? origin.mergedScope + : throw new UnimplementedError("SourceExtensionBuilder.mergedScope"); + @override Extension get extension => isPatch ? origin._extension : _extension;
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart index 9534775..80d2746 100644 --- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart +++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -250,6 +250,8 @@ List<SourceLibraryBuilder>? _patchLibraries; + int patchIndex = 0; + /// `true` if this is an augmentation library. final bool isAugmentation; @@ -260,6 +262,8 @@ /// inferred types in the original code. final Map<String, Builder>? _omittedTypeDeclarationBuilders; + MergedLibraryScope? _mergedScope; + SourceLibraryBuilder.internal( SourceLoader loader, Uri fileUri, @@ -326,6 +330,11 @@ "'${importUri}'."); } + MergedLibraryScope get mergedScope { + return _mergedScope ??= + isPatch ? origin.mergedScope : new MergedLibraryScope(this); + } + TypeParameterScopeBuilder get libraryTypeParameterScopeBuilderForTesting => _libraryTypeParameterScopeBuilder; @@ -447,6 +456,7 @@ assert(!patchLibrary.isPart, "Patch library ${patchLibrary} cannot be a part ."); (_patchLibraries ??= []).add(patchLibrary); + patchLibrary.patchIndex = _patchLibraries!.length; } /// Creates a synthesized augmentation library for the [source] code and @@ -3074,23 +3084,15 @@ /// Builds the core AST structures for [declaration] needed for the outline. void _buildOutlineNodes(Builder declaration, LibraryBuilder coreLibrary) { - String findDuplicateSuffix(Builder declaration) { - if (declaration.next != null) { - int count = 0; - Builder? current = declaration.next; - while (current != null) { - count++; - current = current.next; - } - return "#$count"; - } - return ""; - } - if (declaration is SourceClassBuilder) { Class cls = declaration.build(coreLibrary); if (!declaration.isPatch) { - cls.name += findDuplicateSuffix(declaration); + if (declaration.isDuplicate || + declaration.isConflictingAugmentationMember) { + cls.name = '${cls.name}' + '#${declaration.duplicateIndex}' + '#${declaration.libraryBuilder.patchIndex}'; + } library.addClass(cls); } } else if (declaration is SourceExtensionBuilder) { @@ -3126,6 +3128,11 @@ if (member is Field) { member.isStatic = true; if (!declaration.isPatch && !declaration.isDuplicate) { + if (declaration.isConflictingAugmentationMember) { + member.name = new Name( + '${member.name.text}#${declaration.libraryBuilder.patchIndex}', + member.name.library); + } library.addField(member); } } else if (member is Procedure) { @@ -3133,6 +3140,11 @@ if (!declaration.isPatch && !declaration.isDuplicate && !declaration.isConflictingSetter) { + if (declaration.isConflictingAugmentationMember) { + member.name = new Name( + '${member.name.text}#${declaration.libraryBuilder.patchIndex}', + member.name.library); + } library.addProcedure(member); } } else { @@ -3184,8 +3196,9 @@ if (import.deferred && import.prefixBuilder?.dependency != null) { library.addDependency(import.prefixBuilder!.dependency!); } else { - library.addDependency(new LibraryDependency.import( - import.imported!.library, + LibraryBuilder imported = import.imported!.origin; + Library targetLibrary = imported.library; + library.addDependency(new LibraryDependency.import(targetLibrary, name: import.prefix, combinators: toKernelCombinators(import.combinators)) ..fileOffset = import.charOffset); @@ -3897,7 +3910,7 @@ return count; } - @override + /// If this is a patch library, apply its patches to [origin]. void applyPatches() { if (!isPatch) return; @@ -3923,44 +3936,8 @@ } } - NameIterator originDeclarations = origin.localMembersNameIterator; - while (originDeclarations.moveNext()) { - String name = originDeclarations.name; - Builder member = originDeclarations.current; - bool isSetter = member.isSetter; - Builder? patch = scope.lookupLocalMember(name, setter: isSetter); - if (patch != null) { - // [patch] has the same name as a [member] in [origin] library, so it - // must be a patch to [member]. - member.applyPatch(patch); - // TODO(ahe): Verify that patch has the @patch annotation. - } else { - // No member with [name] exists in this library already. So we need to - // import it into the patch library. This ensures that the origin - // library is in scope of the patch library. - if (isSetter) { - scope.addLocalMember(name, member as MemberBuilder, setter: true); - } else { - scope.addLocalMember(name, member, setter: false); - } - } - } - NameIterator patchDeclarations = localMembersNameIterator; - while (patchDeclarations.moveNext()) { - String name = patchDeclarations.name; - Builder member = patchDeclarations.current; - // We need to inject all non-patch members into the origin library. This - // should only apply to private members. - // For augmentation libraries, all members are injected into the origin - // library, regardless of privacy. - if (member.isPatch) { - // Ignore patches. - } else if (name.startsWith("_") || isAugmentation) { - origin.injectMemberFromPatch(name, member); - } else { - origin.exportMemberFromPatch(name, member); - } - } + mergedScope.addAugmentationScope(this); + return; } /// Builds the AST nodes needed for the full compilation. @@ -4005,42 +3982,6 @@ return count; } - void injectMemberFromPatch(String name, Builder member) { - if (member.isSetter) { - assert( - scope.lookupLocalMember(name, setter: true) == null, - "Setter $name already bound to " - "${scope.lookupLocalMember(name, setter: true)}, " - "trying to add $member."); - scope.addLocalMember(name, member as MemberBuilder, setter: true); - } else { - assert( - scope.lookupLocalMember(name, setter: false) == null, - "Member $name already bound to " - "${scope.lookupLocalMember(name, setter: false)}, " - "trying to add $member."); - scope.addLocalMember(name, member, setter: false); - } - } - - void exportMemberFromPatch(String name, Builder member) { - if (!importUri.isScheme("dart") || !importUri.path.startsWith("_")) { - addProblem(templatePatchInjectionFailed.withArguments(name, importUri), - member.charOffset, noLength, member.fileUri); - } - // Platform-private libraries, such as "dart:_internal" have special - // semantics: public members are injected into the origin library. - // TODO(ahe): See if we can remove this special case. - - // If this member already exist in the origin library scope, it should - // have been marked as patch. - assert((member.isSetter && - scope.lookupLocalMember(name, setter: true) == null) || - (!member.isSetter && - scope.lookupLocalMember(name, setter: false) == null)); - addToExportScope(name, member); - } - void _reportTypeArgumentIssues( Iterable<TypeArgumentIssue> issues, Uri fileUri, int offset, {bool? inferred,
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart index b8510a2..7e46fcd 100644 --- a/pkg/front_end/lib/src/fasta/source/source_loader.dart +++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -1289,14 +1289,10 @@ } ticker.logMs("Resolved parts"); - for (LibraryBuilder library in libraryBuilders) { - if (library.loader == this) { - library.applyPatches(); - } - } for (SourceLibraryBuilder patchLibrary in patchLibraries) { _builders.remove(patchLibrary.fileUri); patchLibrary.origin.addPatchLibrary(patchLibrary); + patchLibrary.applyPatches(); } _sourceLibraryBuilders = sourceLibraries; assert(
diff --git a/pkg/front_end/lib/src/fasta/source/source_member_builder.dart b/pkg/front_end/lib/src/fasta/source/source_member_builder.dart index 725eae1..f2140a0 100644 --- a/pkg/front_end/lib/src/fasta/source/source_member_builder.dart +++ b/pkg/front_end/lib/src/fasta/source/source_member_builder.dart
@@ -54,7 +54,7 @@ bool get isAugmentation; /// Returns `true` if this member is a member declared in an augmentation - /// library that conflicts with a member in the origin library. + /// library that conflicts with a declaration in the origin library. bool get isConflictingAugmentationMember; void set isConflictingAugmentationMember(bool value);
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status index 8de489e7..3fa0012 100644 --- a/pkg/front_end/messages.status +++ b/pkg/front_end/messages.status
@@ -664,11 +664,11 @@ NeverValueWarning/example: Fail NewAsSelector/analyzerCode: Fail NoAugmentSuperInvokeTarget/analyzerCode: Fail -NoAugmentSuperInvokeTarget/example: Fail +NoAugmentSuperInvokeTarget/part_wrapped_script: Fail # Uses imports NoAugmentSuperReadTarget/analyzerCode: Fail -NoAugmentSuperReadTarget/example: Fail +NoAugmentSuperReadTarget/part_wrapped_script: Fail # Uses imports NoAugmentSuperWriteTarget/analyzerCode: Fail -NoAugmentSuperWriteTarget/example: Fail +NoAugmentSuperWriteTarget/part_wrapped_script: Fail # Uses imports NoFormals/example: Fail NoSuchNamedParameter/example: Fail NoUnnamedConstructorInObject/analyzerCode: Fail @@ -677,8 +677,16 @@ NonAgnosticConstant/example: Fail NonAsciiIdentifier/expression: Fail NonAsciiIdentifier/part_wrapped_expression: Fail +NonAugmentationClassConflict/analyzerCode: Fail +NonAugmentationClassConflict/part_wrapped_script: Crash # TODO(johnniwinther): Investigate this. NonAugmentationClassMemberConflict/analyzerCode: Fail -NonAugmentationClassMemberConflict/example: Fail +NonAugmentationClassMemberConflict/part_wrapped_script: Fail # Uses imports +NonAugmentationConstructorConflict/analyzerCode: Fail +NonAugmentationConstructorConflict/part_wrapped_script: Fail # Uses imports +NonAugmentationLibraryConflict/analyzerCode: Fail +NonAugmentationLibraryConflict/part_wrapped_script: Crash # TODO(johnniwinther): Investigate this. +NonAugmentationLibraryMemberConflict/analyzerCode: Fail +NonAugmentationLibraryMemberConflict/part_wrapped_script: Fail # Uses imports NonConstConstructor/example: Fail NonConstFactory/example: Fail NonInstanceTypeVariableUse/example: Fail @@ -893,8 +901,16 @@ UndefinedExtensionSetter/example: Fail UnexpectedToken/part_wrapped_script1: Fail UnexpectedToken/script1: Fail +UnmatchedAugmentationClass/analyzerCode: Fail +UnmatchedAugmentationClass/part_wrapped_script: Crash # TODO(johnniwinther): Investigate this. UnmatchedAugmentationClassMember/analyzerCode: Fail UnmatchedAugmentationClassMember/part_wrapped_script: Fail # Uses imports +UnmatchedAugmentationConstructor/analyzerCode: Fail +UnmatchedAugmentationConstructor/part_wrapped_script: Fail # Uses imports +UnmatchedAugmentationDeclaration/analyzerCode: Fail +UnmatchedAugmentationDeclaration/example: Fail +UnmatchedAugmentationLibraryMember/analyzerCode: Fail +UnmatchedAugmentationLibraryMember/part_wrapped_script: Fail # Uses imports UnmatchedToken/part_wrapped_script1: Fail UnmatchedToken/part_wrapped_script3: Fail UnmatchedToken/script1: Fail
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml index 83517cb..49add4f 100644 --- a/pkg/front_end/messages.yaml +++ b/pkg/front_end/messages.yaml
@@ -5640,14 +5640,126 @@ augment void method() {} } +UnmatchedAugmentationLibraryMember: + problemMessage: "Augmentation member '#name' doesn't match a member in the augmented library." + correctionMessage: "Try changing the name to an existing member or removing the 'augment' modifier." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + lib.dart: + augment void method() {} + +UnmatchedAugmentationClass: + problemMessage: "Augmentation class '#name' doesn't match a class in the augmented library." + correctionMessage: "Try changing the name to an existing class or removing the 'augment' modifier." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + lib.dart: + augment class Class {} + +UnmatchedAugmentationDeclaration: + problemMessage: "Augmentation '#name' doesn't match a declaration in the augmented library." + correctionMessage: "Try changing the name to an existing declaration or removing the 'augment' modifier." + experiments: macros + +UnmatchedAugmentationConstructor: + problemMessage: "Augmentation constructor '#name' doesn't match a constructor in the augmented class." + correctionMessage: "Try changing the name to an existing constructor or removing the 'augment' modifier." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + class Class { + Class.name1(); + } + lib.dart: + augment class Class { + augment Class.name2(); + } + + NonAugmentationClassMemberConflict: problemMessage: "Member '#name' conflicts with an existing member of the same name in the augmented class." - correctionMessage: "Try changing the name to an existing member or adding an 'augment' modifier." + correctionMessage: "Try changing the name of the member or adding an 'augment' modifier." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + class Class { + void method() {} + } + lib.dart: + augment class Class { + void method() {} + } -NonAugmentationClassMemberConflictCause: +NonAugmentationLibraryMemberConflict: + problemMessage: "Member '#name' conflicts with an existing member of the same name in the augmented library." + correctionMessage: "Try changing the name of the member or adding an 'augment' modifier." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + void method() {} + lib.dart: + void method() {} + +NonAugmentationLibraryConflict: + problemMessage: "Declaration '#name' conflicts with an existing declaration of the same name in the augmented library." + correctionMessage: "Try changing the name of the declaration." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + void method() {} + lib.dart: + class method {} + +NonAugmentationClassConflict: + problemMessage: "Class '#name' conflicts with an existing class of the same name in the augmented library." + correctionMessage: "Try changing the name of the class or adding an 'augment' modifier." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + class Class {} + lib.dart: + class Class {} + +NonAugmentationConstructorConflict: + problemMessage: "Constructor '#name' conflicts with an existing constructor of the same name in the augmented class." + correctionMessage: "Try changing the name of the constructor or adding an 'augment' modifier." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + class Class { + Class.name(); + } + lib.dart: + augment class Class { + Class.name(); + } + +NonAugmentationMemberConflictCause: problemMessage: "This is the existing member." severity: CONTEXT +NonAugmentationClassConflictCause: + problemMessage: "This is the existing class." + severity: CONTEXT + +NonAugmentationDeclarationConflictCause: + problemMessage: "This is the existing declaration." + severity: CONTEXT + +NonAugmentationConstructorConflictCause: + problemMessage: "This is the existing constructor." + severity: CONTEXT + OptionalSuperParameterWithoutInitializer: problemMessage: "Type '#type' of the optional super-initializer parameter '#name' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor." @@ -5719,12 +5831,39 @@ NoAugmentSuperReadTarget: problemMessage: "Cannot read from 'augment super'." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + void set setter(value) {} + lib.dart: + augment void set setter(value) { + augment super; + } NoAugmentSuperWriteTarget: problemMessage: "Cannot write to 'augment super'." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + void method() {} + lib.dart: + augment void method() { + augment super = 42; + } NoAugmentSuperInvokeTarget: problemMessage: "Cannot call 'augment super'." + experiments: macros + script: + main.dart: + import augment 'lib.dart'; + void set setter(value) {} + lib.dart: + augment void set setter(value) { + augment super(); + } IndexOutOfBoundInRecordIndexGet: problemMessage: "Index #count is out of range 0..#count2 of positional fields of records #type."
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt index 247f5ab..d8c0214 100644 --- a/pkg/front_end/test/spell_checking_list_tests.txt +++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -330,6 +330,7 @@ hosting hot hotreload +hover hunk hurray i'm @@ -648,6 +649,7 @@ tinv tk told +tooltip touch tpt transitively
diff --git a/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.expect b/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.expect index 6ec750c..77986b3 100644 --- a/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.expect +++ b/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.expect
@@ -27,8 +27,8 @@ import "org-dartlang-testcase:///duplicated_bad_prefix_lib1.dart" as dupe; import "org-dartlang-testcase:///duplicated_bad_prefix_lib2.dart" as dupe; -class Dupe#1 extends core::Object { - synthetic constructor •() → self::Dupe#1 +class Dupe#1#0 extends core::Object { + synthetic constructor •() → self::Dupe#1#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.modular.expect b/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.modular.expect index 6ec750c..77986b3 100644 --- a/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.modular.expect +++ b/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.modular.expect
@@ -27,8 +27,8 @@ import "org-dartlang-testcase:///duplicated_bad_prefix_lib1.dart" as dupe; import "org-dartlang-testcase:///duplicated_bad_prefix_lib2.dart" as dupe; -class Dupe#1 extends core::Object { - synthetic constructor •() → self::Dupe#1 +class Dupe#1#0 extends core::Object { + synthetic constructor •() → self::Dupe#1#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.outline.expect b/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.outline.expect index 86c7446..765e2db 100644 --- a/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.outline.expect +++ b/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.outline.expect
@@ -23,8 +23,8 @@ import "org-dartlang-testcase:///duplicated_bad_prefix_lib1.dart" as dupe; import "org-dartlang-testcase:///duplicated_bad_prefix_lib2.dart" as dupe; -class Dupe#1 extends core::Object { - synthetic constructor •() → self::Dupe#1 +class Dupe#1#0 extends core::Object { + synthetic constructor •() → self::Dupe#1#0 ; } class Dupe extends core::Object {
diff --git a/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.transformed.expect b/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.transformed.expect index 6ec750c..77986b3 100644 --- a/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/duplicated_bad_prefix.dart.weak.transformed.expect
@@ -27,8 +27,8 @@ import "org-dartlang-testcase:///duplicated_bad_prefix_lib1.dart" as dupe; import "org-dartlang-testcase:///duplicated_bad_prefix_lib2.dart" as dupe; -class Dupe#1 extends core::Object { - synthetic constructor •() → self::Dupe#1 +class Dupe#1#0 extends core::Object { + synthetic constructor •() → self::Dupe#1#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.expect b/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.expect index 251178e..a97af90 100644 --- a/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.expect +++ b/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.expect
@@ -363,19 +363,19 @@ part duplicated_declarations_part.dart; typedef Typedef = () → void; typedef OldTypedef = () → void; -class C#4 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart - constructor _() → self::C#4 +class C#4#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart + constructor _() → self::C#4#0 : super core::Object::•() ; } -class C#3 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart - constructor _() → self::C#3 +class C#3#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart + constructor _() → self::C#3#0 : super core::Object::•() ; } -class C#2 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart +class C#2#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart field core::String field = null; - constructor •(dynamic a) → self::C#2 + constructor •(dynamic a) → self::C#2#0 : super core::Object::•() ; method m() → dynamic { @@ -389,8 +389,8 @@ static f() => s; ^"; } -class C#1 extends core::Object { - constructor _() → self::C#1 +class C#1#0 extends core::Object { + constructor _() → self::C#1#0 : super core::Object::•() ; } @@ -422,47 +422,47 @@ m() => super.m(); ^"; } -class Enum#4 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#4> values = #C4; - enum-element static const field self::Enum#4 a = #C3; - const constructor •(core::int #index, core::String #name) → self::Enum#4 +class Enum#4#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#4#0> values = #C4; + enum-element static const field self::Enum#4#0 a = #C3; + const constructor •(core::int #index, core::String #name) → self::Enum#4#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#4.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#4#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#3 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#3> values = #C12; - enum-element static const field self::Enum#3 a = #C5; - enum-element static const field self::Enum#3 b = #C8; - enum-element static const field self::Enum#3 c = #C11; - const constructor •(core::int #index, core::String #name) → self::Enum#3 +class Enum#3#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#3#0> values = #C12; + enum-element static const field self::Enum#3#0 a = #C5; + enum-element static const field self::Enum#3#0 b = #C8; + enum-element static const field self::Enum#3#0 c = #C11; + const constructor •(core::int #index, core::String #name) → self::Enum#3#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#3.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#3#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#2 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#2> values = #C17; - enum-element static const field self::Enum#2 Enum = #C14; - enum-element static const field self::Enum#2 a = #C15; - enum-element static const field self::Enum#2 b = #C16; - const constructor •(core::int #index, core::String #name) → self::Enum#2 +class Enum#2#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#2#0> values = #C17; + enum-element static const field self::Enum#2#0 Enum = #C14; + enum-element static const field self::Enum#2#0 a = #C15; + enum-element static const field self::Enum#2#0 b = #C16; + const constructor •(core::int #index, core::String #name) → self::Enum#2#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#2.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#2#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#1 extends core::_Enum /*isEnum*/ { - static const field core::List<self::Enum#1> values = #C21; - enum-element static const field self::Enum#1 a = #C18; - enum-element static const field self::Enum#1 b = #C19; - enum-element static const field self::Enum#1 c = #C20; - const constructor •(core::int #index, core::String #name) → self::Enum#1 +class Enum#1#0 extends core::_Enum /*isEnum*/ { + static const field core::List<self::Enum#1#0> values = #C21; + enum-element static const field self::Enum#1#0 a = #C18; + enum-element static const field self::Enum#1#0 b = #C19; + enum-element static const field self::Enum#1#0 c = #C20; + const constructor •(core::int #index, core::String #name) → self::Enum#1#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#1.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#1#0.${this.{core::_Enum::_name}{core::String}}"; } class Enum extends core::_Enum /*isEnum*/ { static const field core::List<self::Enum> values = #C25; @@ -525,25 +525,25 @@ constants { #C1 = 0 #C2 = "a" - #C3 = self::Enum#4 {index:#C1, _name:#C2} - #C4 = <self::Enum#4*>[#C3] - #C5 = self::Enum#3 {index:#C1, _name:#C2} + #C3 = self::Enum#4#0 {index:#C1, _name:#C2} + #C4 = <self::Enum#4#0*>[#C3] + #C5 = self::Enum#3#0 {index:#C1, _name:#C2} #C6 = 1 #C7 = "b" - #C8 = self::Enum#3 {index:#C6, _name:#C7} + #C8 = self::Enum#3#0 {index:#C6, _name:#C7} #C9 = 2 #C10 = "c" - #C11 = self::Enum#3 {index:#C9, _name:#C10} - #C12 = <self::Enum#3*>[#C5, #C8, #C11] + #C11 = self::Enum#3#0 {index:#C9, _name:#C10} + #C12 = <self::Enum#3#0*>[#C5, #C8, #C11] #C13 = "Enum" - #C14 = self::Enum#2 {index:#C1, _name:#C13} - #C15 = self::Enum#2 {index:#C6, _name:#C2} - #C16 = self::Enum#2 {index:#C9, _name:#C7} - #C17 = <self::Enum#2*>[#C14, #C15, #C16] - #C18 = self::Enum#1 {index:#C1, _name:#C2} - #C19 = self::Enum#1 {index:#C6, _name:#C7} - #C20 = self::Enum#1 {index:#C9, _name:#C10} - #C21 = <self::Enum#1*>[#C18, #C19, #C20] + #C14 = self::Enum#2#0 {index:#C1, _name:#C13} + #C15 = self::Enum#2#0 {index:#C6, _name:#C2} + #C16 = self::Enum#2#0 {index:#C9, _name:#C7} + #C17 = <self::Enum#2#0*>[#C14, #C15, #C16] + #C18 = self::Enum#1#0 {index:#C1, _name:#C2} + #C19 = self::Enum#1#0 {index:#C6, _name:#C7} + #C20 = self::Enum#1#0 {index:#C9, _name:#C10} + #C21 = <self::Enum#1#0*>[#C18, #C19, #C20] #C22 = self::Enum {index:#C1, _name:#C13} #C23 = self::Enum {index:#C6, _name:#C2} #C24 = self::Enum {index:#C9, _name:#C7} @@ -563,7 +563,7 @@ Constructor coverage from constants: org-dartlang-testcase:///duplicated_declarations.dart: -- Enum#1. (from org-dartlang-testcase:///duplicated_declarations.dart:85:6) +- Enum#1#0. (from org-dartlang-testcase:///duplicated_declarations.dart:85:6) - _Enum. (from org-dartlang-sdk:///sdk/lib/core/enum.dart) - Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart) - Enum. (from org-dartlang-testcase:///duplicated_declarations.dart:78:6)
diff --git a/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.modular.expect b/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.modular.expect index 251178e..a97af90 100644 --- a/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.modular.expect +++ b/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.modular.expect
@@ -363,19 +363,19 @@ part duplicated_declarations_part.dart; typedef Typedef = () → void; typedef OldTypedef = () → void; -class C#4 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart - constructor _() → self::C#4 +class C#4#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart + constructor _() → self::C#4#0 : super core::Object::•() ; } -class C#3 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart - constructor _() → self::C#3 +class C#3#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart + constructor _() → self::C#3#0 : super core::Object::•() ; } -class C#2 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart +class C#2#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart field core::String field = null; - constructor •(dynamic a) → self::C#2 + constructor •(dynamic a) → self::C#2#0 : super core::Object::•() ; method m() → dynamic { @@ -389,8 +389,8 @@ static f() => s; ^"; } -class C#1 extends core::Object { - constructor _() → self::C#1 +class C#1#0 extends core::Object { + constructor _() → self::C#1#0 : super core::Object::•() ; } @@ -422,47 +422,47 @@ m() => super.m(); ^"; } -class Enum#4 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#4> values = #C4; - enum-element static const field self::Enum#4 a = #C3; - const constructor •(core::int #index, core::String #name) → self::Enum#4 +class Enum#4#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#4#0> values = #C4; + enum-element static const field self::Enum#4#0 a = #C3; + const constructor •(core::int #index, core::String #name) → self::Enum#4#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#4.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#4#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#3 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#3> values = #C12; - enum-element static const field self::Enum#3 a = #C5; - enum-element static const field self::Enum#3 b = #C8; - enum-element static const field self::Enum#3 c = #C11; - const constructor •(core::int #index, core::String #name) → self::Enum#3 +class Enum#3#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#3#0> values = #C12; + enum-element static const field self::Enum#3#0 a = #C5; + enum-element static const field self::Enum#3#0 b = #C8; + enum-element static const field self::Enum#3#0 c = #C11; + const constructor •(core::int #index, core::String #name) → self::Enum#3#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#3.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#3#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#2 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#2> values = #C17; - enum-element static const field self::Enum#2 Enum = #C14; - enum-element static const field self::Enum#2 a = #C15; - enum-element static const field self::Enum#2 b = #C16; - const constructor •(core::int #index, core::String #name) → self::Enum#2 +class Enum#2#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#2#0> values = #C17; + enum-element static const field self::Enum#2#0 Enum = #C14; + enum-element static const field self::Enum#2#0 a = #C15; + enum-element static const field self::Enum#2#0 b = #C16; + const constructor •(core::int #index, core::String #name) → self::Enum#2#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#2.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#2#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#1 extends core::_Enum /*isEnum*/ { - static const field core::List<self::Enum#1> values = #C21; - enum-element static const field self::Enum#1 a = #C18; - enum-element static const field self::Enum#1 b = #C19; - enum-element static const field self::Enum#1 c = #C20; - const constructor •(core::int #index, core::String #name) → self::Enum#1 +class Enum#1#0 extends core::_Enum /*isEnum*/ { + static const field core::List<self::Enum#1#0> values = #C21; + enum-element static const field self::Enum#1#0 a = #C18; + enum-element static const field self::Enum#1#0 b = #C19; + enum-element static const field self::Enum#1#0 c = #C20; + const constructor •(core::int #index, core::String #name) → self::Enum#1#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#1.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#1#0.${this.{core::_Enum::_name}{core::String}}"; } class Enum extends core::_Enum /*isEnum*/ { static const field core::List<self::Enum> values = #C25; @@ -525,25 +525,25 @@ constants { #C1 = 0 #C2 = "a" - #C3 = self::Enum#4 {index:#C1, _name:#C2} - #C4 = <self::Enum#4*>[#C3] - #C5 = self::Enum#3 {index:#C1, _name:#C2} + #C3 = self::Enum#4#0 {index:#C1, _name:#C2} + #C4 = <self::Enum#4#0*>[#C3] + #C5 = self::Enum#3#0 {index:#C1, _name:#C2} #C6 = 1 #C7 = "b" - #C8 = self::Enum#3 {index:#C6, _name:#C7} + #C8 = self::Enum#3#0 {index:#C6, _name:#C7} #C9 = 2 #C10 = "c" - #C11 = self::Enum#3 {index:#C9, _name:#C10} - #C12 = <self::Enum#3*>[#C5, #C8, #C11] + #C11 = self::Enum#3#0 {index:#C9, _name:#C10} + #C12 = <self::Enum#3#0*>[#C5, #C8, #C11] #C13 = "Enum" - #C14 = self::Enum#2 {index:#C1, _name:#C13} - #C15 = self::Enum#2 {index:#C6, _name:#C2} - #C16 = self::Enum#2 {index:#C9, _name:#C7} - #C17 = <self::Enum#2*>[#C14, #C15, #C16] - #C18 = self::Enum#1 {index:#C1, _name:#C2} - #C19 = self::Enum#1 {index:#C6, _name:#C7} - #C20 = self::Enum#1 {index:#C9, _name:#C10} - #C21 = <self::Enum#1*>[#C18, #C19, #C20] + #C14 = self::Enum#2#0 {index:#C1, _name:#C13} + #C15 = self::Enum#2#0 {index:#C6, _name:#C2} + #C16 = self::Enum#2#0 {index:#C9, _name:#C7} + #C17 = <self::Enum#2#0*>[#C14, #C15, #C16] + #C18 = self::Enum#1#0 {index:#C1, _name:#C2} + #C19 = self::Enum#1#0 {index:#C6, _name:#C7} + #C20 = self::Enum#1#0 {index:#C9, _name:#C10} + #C21 = <self::Enum#1#0*>[#C18, #C19, #C20] #C22 = self::Enum {index:#C1, _name:#C13} #C23 = self::Enum {index:#C6, _name:#C2} #C24 = self::Enum {index:#C9, _name:#C7} @@ -563,7 +563,7 @@ Constructor coverage from constants: org-dartlang-testcase:///duplicated_declarations.dart: -- Enum#1. (from org-dartlang-testcase:///duplicated_declarations.dart:85:6) +- Enum#1#0. (from org-dartlang-testcase:///duplicated_declarations.dart:85:6) - _Enum. (from org-dartlang-sdk:///sdk/lib/core/enum.dart) - Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart) - Enum. (from org-dartlang-testcase:///duplicated_declarations.dart:78:6)
diff --git a/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.outline.expect b/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.outline.expect index 6216348..799b8f2 100644 --- a/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.outline.expect +++ b/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.outline.expect
@@ -312,17 +312,17 @@ part duplicated_declarations_part.dart; typedef Typedef = () → void; typedef OldTypedef = () → void; -class C#4 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart - constructor _() → self::C#4 +class C#4#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart + constructor _() → self::C#4#0 ; } -class C#3 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart - constructor _() → self::C#3 +class C#3#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart + constructor _() → self::C#3#0 ; } -class C#2 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart +class C#2#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart field core::String field; - constructor •(dynamic a) → self::C#2 + constructor •(dynamic a) → self::C#2#0 ; method m() → dynamic ; @@ -331,8 +331,8 @@ static method f() → dynamic ; } -class C#1 extends core::Object { - constructor _() → self::C#1 +class C#1#0 extends core::Object { + constructor _() → self::C#1#0 ; } class C extends core::Object { @@ -352,47 +352,47 @@ method m() → dynamic ; } -class Enum#4 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#4> values = const <self::Enum#4>[self::Enum#4::a]; - enum-element static const field self::Enum#4 a = const self::Enum#4::•(0, "a"); - const constructor •(core::int #index, core::String #name) → self::Enum#4 +class Enum#4#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#4#0> values = const <self::Enum#4#0>[self::Enum#4#0::a]; + enum-element static const field self::Enum#4#0 a = const self::Enum#4#0::•(0, "a"); + const constructor •(core::int #index, core::String #name) → self::Enum#4#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#4.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#4#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#3 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#3> values = const <self::Enum#3>[self::Enum#3::a, self::Enum#3::b, self::Enum#3::c]; - enum-element static const field self::Enum#3 a = const self::Enum#3::•(0, "a"); - enum-element static const field self::Enum#3 b = const self::Enum#3::•(1, "b"); - enum-element static const field self::Enum#3 c = const self::Enum#3::•(2, "c"); - const constructor •(core::int #index, core::String #name) → self::Enum#3 +class Enum#3#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#3#0> values = const <self::Enum#3#0>[self::Enum#3#0::a, self::Enum#3#0::b, self::Enum#3#0::c]; + enum-element static const field self::Enum#3#0 a = const self::Enum#3#0::•(0, "a"); + enum-element static const field self::Enum#3#0 b = const self::Enum#3#0::•(1, "b"); + enum-element static const field self::Enum#3#0 c = const self::Enum#3#0::•(2, "c"); + const constructor •(core::int #index, core::String #name) → self::Enum#3#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#3.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#3#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#2 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#2> values = const <self::Enum#2>[self::Enum#2::Enum, self::Enum#2::a, self::Enum#2::b]; - enum-element static const field self::Enum#2 Enum = const self::Enum#2::•(0, "Enum"); - enum-element static const field self::Enum#2 a = const self::Enum#2::•(1, "a"); - enum-element static const field self::Enum#2 b = const self::Enum#2::•(2, "b"); - const constructor •(core::int #index, core::String #name) → self::Enum#2 +class Enum#2#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#2#0> values = const <self::Enum#2#0>[self::Enum#2#0::Enum, self::Enum#2#0::a, self::Enum#2#0::b]; + enum-element static const field self::Enum#2#0 Enum = const self::Enum#2#0::•(0, "Enum"); + enum-element static const field self::Enum#2#0 a = const self::Enum#2#0::•(1, "a"); + enum-element static const field self::Enum#2#0 b = const self::Enum#2#0::•(2, "b"); + const constructor •(core::int #index, core::String #name) → self::Enum#2#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#2.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#2#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#1 extends core::_Enum /*isEnum*/ { - static const field core::List<self::Enum#1> values = const <self::Enum#1>[self::Enum#1::a, self::Enum#1::b, self::Enum#1::c]; - enum-element static const field self::Enum#1 a = const self::Enum#1::•(0, "a"); - enum-element static const field self::Enum#1 b = const self::Enum#1::•(1, "b"); - enum-element static const field self::Enum#1 c = const self::Enum#1::•(2, "c"); - const constructor •(core::int #index, core::String #name) → self::Enum#1 +class Enum#1#0 extends core::_Enum /*isEnum*/ { + static const field core::List<self::Enum#1#0> values = const <self::Enum#1#0>[self::Enum#1#0::a, self::Enum#1#0::b, self::Enum#1#0::c]; + enum-element static const field self::Enum#1#0 a = const self::Enum#1#0::•(0, "a"); + enum-element static const field self::Enum#1#0 b = const self::Enum#1#0::•(1, "b"); + enum-element static const field self::Enum#1#0 c = const self::Enum#1#0::•(2, "c"); + const constructor •(core::int #index, core::String #name) → self::Enum#1#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#1.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#1#0.${this.{core::_Enum::_name}{core::String}}"; } class Enum extends core::_Enum /*isEnum*/ { static const field core::List<self::Enum> values = const <self::Enum>[self::Enum::Enum, self::Enum::a, self::Enum::b]; @@ -432,20 +432,20 @@ Extra constant evaluation status: -Evaluated: ListLiteral @ org-dartlang-testcase:///duplicated_declarations_part.dart:88:6 -> ListConstant(const <Enum#4*>[const Enum#4{_Enum.index: 0, _Enum._name: "a"}]) -Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:89:3 -> InstanceConstant(const Enum#4{_Enum.index: 0, _Enum._name: "a"}) -Evaluated: ListLiteral @ org-dartlang-testcase:///duplicated_declarations_part.dart:82:6 -> ListConstant(const <Enum#3*>[const Enum#3{_Enum.index: 0, _Enum._name: "a"}, const Enum#3{_Enum.index: 1, _Enum._name: "b"}, const Enum#3{_Enum.index: 2, _Enum._name: "c"}]) -Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:83:3 -> InstanceConstant(const Enum#3{_Enum.index: 0, _Enum._name: "a"}) -Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:84:3 -> InstanceConstant(const Enum#3{_Enum.index: 1, _Enum._name: "b"}) -Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:85:3 -> InstanceConstant(const Enum#3{_Enum.index: 2, _Enum._name: "c"}) -Evaluated: ListLiteral @ org-dartlang-testcase:///duplicated_declarations_part.dart:75:6 -> ListConstant(const <Enum#2*>[const Enum#2{_Enum.index: 0, _Enum._name: "Enum"}, const Enum#2{_Enum.index: 1, _Enum._name: "a"}, const Enum#2{_Enum.index: 2, _Enum._name: "b"}]) -Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:76:3 -> InstanceConstant(const Enum#2{_Enum.index: 0, _Enum._name: "Enum"}) -Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:77:3 -> InstanceConstant(const Enum#2{_Enum.index: 1, _Enum._name: "a"}) -Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:79:3 -> InstanceConstant(const Enum#2{_Enum.index: 2, _Enum._name: "b"}) -Evaluated: ListLiteral @ org-dartlang-testcase:///duplicated_declarations.dart:85:6 -> ListConstant(const <Enum#1*>[const Enum#1{_Enum.index: 0, _Enum._name: "a"}, const Enum#1{_Enum.index: 1, _Enum._name: "b"}, const Enum#1{_Enum.index: 2, _Enum._name: "c"}]) -Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations.dart:86:3 -> InstanceConstant(const Enum#1{_Enum.index: 0, _Enum._name: "a"}) -Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations.dart:87:3 -> InstanceConstant(const Enum#1{_Enum.index: 1, _Enum._name: "b"}) -Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations.dart:88:3 -> InstanceConstant(const Enum#1{_Enum.index: 2, _Enum._name: "c"}) +Evaluated: ListLiteral @ org-dartlang-testcase:///duplicated_declarations_part.dart:88:6 -> ListConstant(const <Enum#4#0*>[const Enum#4#0{_Enum.index: 0, _Enum._name: "a"}]) +Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:89:3 -> InstanceConstant(const Enum#4#0{_Enum.index: 0, _Enum._name: "a"}) +Evaluated: ListLiteral @ org-dartlang-testcase:///duplicated_declarations_part.dart:82:6 -> ListConstant(const <Enum#3#0*>[const Enum#3#0{_Enum.index: 0, _Enum._name: "a"}, const Enum#3#0{_Enum.index: 1, _Enum._name: "b"}, const Enum#3#0{_Enum.index: 2, _Enum._name: "c"}]) +Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:83:3 -> InstanceConstant(const Enum#3#0{_Enum.index: 0, _Enum._name: "a"}) +Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:84:3 -> InstanceConstant(const Enum#3#0{_Enum.index: 1, _Enum._name: "b"}) +Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:85:3 -> InstanceConstant(const Enum#3#0{_Enum.index: 2, _Enum._name: "c"}) +Evaluated: ListLiteral @ org-dartlang-testcase:///duplicated_declarations_part.dart:75:6 -> ListConstant(const <Enum#2#0*>[const Enum#2#0{_Enum.index: 0, _Enum._name: "Enum"}, const Enum#2#0{_Enum.index: 1, _Enum._name: "a"}, const Enum#2#0{_Enum.index: 2, _Enum._name: "b"}]) +Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:76:3 -> InstanceConstant(const Enum#2#0{_Enum.index: 0, _Enum._name: "Enum"}) +Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:77:3 -> InstanceConstant(const Enum#2#0{_Enum.index: 1, _Enum._name: "a"}) +Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations_part.dart:79:3 -> InstanceConstant(const Enum#2#0{_Enum.index: 2, _Enum._name: "b"}) +Evaluated: ListLiteral @ org-dartlang-testcase:///duplicated_declarations.dart:85:6 -> ListConstant(const <Enum#1#0*>[const Enum#1#0{_Enum.index: 0, _Enum._name: "a"}, const Enum#1#0{_Enum.index: 1, _Enum._name: "b"}, const Enum#1#0{_Enum.index: 2, _Enum._name: "c"}]) +Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations.dart:86:3 -> InstanceConstant(const Enum#1#0{_Enum.index: 0, _Enum._name: "a"}) +Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations.dart:87:3 -> InstanceConstant(const Enum#1#0{_Enum.index: 1, _Enum._name: "b"}) +Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations.dart:88:3 -> InstanceConstant(const Enum#1#0{_Enum.index: 2, _Enum._name: "c"}) Evaluated: ListLiteral @ org-dartlang-testcase:///duplicated_declarations.dart:78:6 -> ListConstant(const <Enum*>[const Enum{_Enum.index: 0, _Enum._name: "Enum"}, const Enum{_Enum.index: 1, _Enum._name: "a"}, const Enum{_Enum.index: 2, _Enum._name: "b"}]) Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations.dart:79:3 -> InstanceConstant(const Enum{_Enum.index: 0, _Enum._name: "Enum"}) Evaluated: ConstructorInvocation @ org-dartlang-testcase:///duplicated_declarations.dart:80:3 -> InstanceConstant(const Enum{_Enum.index: 1, _Enum._name: "a"})
diff --git a/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.transformed.expect b/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.transformed.expect index 251178e..a97af90 100644 --- a/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/duplicated_declarations.dart.weak.transformed.expect
@@ -363,19 +363,19 @@ part duplicated_declarations_part.dart; typedef Typedef = () → void; typedef OldTypedef = () → void; -class C#4 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart - constructor _() → self::C#4 +class C#4#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart + constructor _() → self::C#4#0 : super core::Object::•() ; } -class C#3 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart - constructor _() → self::C#3 +class C#3#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart + constructor _() → self::C#3#0 : super core::Object::•() ; } -class C#2 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart +class C#2#0 extends core::Object { // from org-dartlang-testcase:///duplicated_declarations_part.dart field core::String field = null; - constructor •(dynamic a) → self::C#2 + constructor •(dynamic a) → self::C#2#0 : super core::Object::•() ; method m() → dynamic { @@ -389,8 +389,8 @@ static f() => s; ^"; } -class C#1 extends core::Object { - constructor _() → self::C#1 +class C#1#0 extends core::Object { + constructor _() → self::C#1#0 : super core::Object::•() ; } @@ -422,47 +422,47 @@ m() => super.m(); ^"; } -class Enum#4 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#4> values = #C4; - enum-element static const field self::Enum#4 a = #C3; - const constructor •(core::int #index, core::String #name) → self::Enum#4 +class Enum#4#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#4#0> values = #C4; + enum-element static const field self::Enum#4#0 a = #C3; + const constructor •(core::int #index, core::String #name) → self::Enum#4#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#4.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#4#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#3 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#3> values = #C12; - enum-element static const field self::Enum#3 a = #C5; - enum-element static const field self::Enum#3 b = #C8; - enum-element static const field self::Enum#3 c = #C11; - const constructor •(core::int #index, core::String #name) → self::Enum#3 +class Enum#3#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#3#0> values = #C12; + enum-element static const field self::Enum#3#0 a = #C5; + enum-element static const field self::Enum#3#0 b = #C8; + enum-element static const field self::Enum#3#0 c = #C11; + const constructor •(core::int #index, core::String #name) → self::Enum#3#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#3.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#3#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#2 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart - static const field core::List<self::Enum#2> values = #C17; - enum-element static const field self::Enum#2 Enum = #C14; - enum-element static const field self::Enum#2 a = #C15; - enum-element static const field self::Enum#2 b = #C16; - const constructor •(core::int #index, core::String #name) → self::Enum#2 +class Enum#2#0 extends core::_Enum /*isEnum*/ { // from org-dartlang-testcase:///duplicated_declarations_part.dart + static const field core::List<self::Enum#2#0> values = #C17; + enum-element static const field self::Enum#2#0 Enum = #C14; + enum-element static const field self::Enum#2#0 a = #C15; + enum-element static const field self::Enum#2#0 b = #C16; + const constructor •(core::int #index, core::String #name) → self::Enum#2#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#2.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#2#0.${this.{core::_Enum::_name}{core::String}}"; } -class Enum#1 extends core::_Enum /*isEnum*/ { - static const field core::List<self::Enum#1> values = #C21; - enum-element static const field self::Enum#1 a = #C18; - enum-element static const field self::Enum#1 b = #C19; - enum-element static const field self::Enum#1 c = #C20; - const constructor •(core::int #index, core::String #name) → self::Enum#1 +class Enum#1#0 extends core::_Enum /*isEnum*/ { + static const field core::List<self::Enum#1#0> values = #C21; + enum-element static const field self::Enum#1#0 a = #C18; + enum-element static const field self::Enum#1#0 b = #C19; + enum-element static const field self::Enum#1#0 c = #C20; + const constructor •(core::int #index, core::String #name) → self::Enum#1#0 : super core::_Enum::•(#index, #name) ; method toString() → core::String - return "Enum#1.${this.{core::_Enum::_name}{core::String}}"; + return "Enum#1#0.${this.{core::_Enum::_name}{core::String}}"; } class Enum extends core::_Enum /*isEnum*/ { static const field core::List<self::Enum> values = #C25; @@ -525,25 +525,25 @@ constants { #C1 = 0 #C2 = "a" - #C3 = self::Enum#4 {index:#C1, _name:#C2} - #C4 = <self::Enum#4*>[#C3] - #C5 = self::Enum#3 {index:#C1, _name:#C2} + #C3 = self::Enum#4#0 {index:#C1, _name:#C2} + #C4 = <self::Enum#4#0*>[#C3] + #C5 = self::Enum#3#0 {index:#C1, _name:#C2} #C6 = 1 #C7 = "b" - #C8 = self::Enum#3 {index:#C6, _name:#C7} + #C8 = self::Enum#3#0 {index:#C6, _name:#C7} #C9 = 2 #C10 = "c" - #C11 = self::Enum#3 {index:#C9, _name:#C10} - #C12 = <self::Enum#3*>[#C5, #C8, #C11] + #C11 = self::Enum#3#0 {index:#C9, _name:#C10} + #C12 = <self::Enum#3#0*>[#C5, #C8, #C11] #C13 = "Enum" - #C14 = self::Enum#2 {index:#C1, _name:#C13} - #C15 = self::Enum#2 {index:#C6, _name:#C2} - #C16 = self::Enum#2 {index:#C9, _name:#C7} - #C17 = <self::Enum#2*>[#C14, #C15, #C16] - #C18 = self::Enum#1 {index:#C1, _name:#C2} - #C19 = self::Enum#1 {index:#C6, _name:#C7} - #C20 = self::Enum#1 {index:#C9, _name:#C10} - #C21 = <self::Enum#1*>[#C18, #C19, #C20] + #C14 = self::Enum#2#0 {index:#C1, _name:#C13} + #C15 = self::Enum#2#0 {index:#C6, _name:#C2} + #C16 = self::Enum#2#0 {index:#C9, _name:#C7} + #C17 = <self::Enum#2#0*>[#C14, #C15, #C16] + #C18 = self::Enum#1#0 {index:#C1, _name:#C2} + #C19 = self::Enum#1#0 {index:#C6, _name:#C7} + #C20 = self::Enum#1#0 {index:#C9, _name:#C10} + #C21 = <self::Enum#1#0*>[#C18, #C19, #C20] #C22 = self::Enum {index:#C1, _name:#C13} #C23 = self::Enum {index:#C6, _name:#C2} #C24 = self::Enum {index:#C9, _name:#C7} @@ -563,7 +563,7 @@ Constructor coverage from constants: org-dartlang-testcase:///duplicated_declarations.dart: -- Enum#1. (from org-dartlang-testcase:///duplicated_declarations.dart:85:6) +- Enum#1#0. (from org-dartlang-testcase:///duplicated_declarations.dart:85:6) - _Enum. (from org-dartlang-sdk:///sdk/lib/core/enum.dart) - Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart) - Enum. (from org-dartlang-testcase:///duplicated_declarations.dart:78:6)
diff --git a/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.expect b/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.expect index 1894958..f58f1ab 100644 --- a/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.expect +++ b/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.expect
@@ -2873,8 +2873,8 @@ : super core::Object::•() ; } -class C#8 extends core::Object { - synthetic constructor •() → self::C#8 +class C#8#0 extends core::Object { + synthetic constructor •() → self::C#8#0 : super core::Object::•() ; } @@ -2883,8 +2883,8 @@ : super core::Object::•() ; } -class B#10 extends core::Object { - synthetic constructor •() → self::B#10 +class B#10#0 extends core::Object { + synthetic constructor •() → self::B#10#0 : super core::Object::•() ; } @@ -2893,8 +2893,8 @@ : super core::Object::•() ; } -class D#7 extends core::Object { - synthetic constructor •() → self::D#7 +class D#7#0 extends core::Object { + synthetic constructor •() → self::D#7#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.modular.expect b/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.modular.expect index 1894958..f58f1ab 100644 --- a/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.modular.expect +++ b/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.modular.expect
@@ -2873,8 +2873,8 @@ : super core::Object::•() ; } -class C#8 extends core::Object { - synthetic constructor •() → self::C#8 +class C#8#0 extends core::Object { + synthetic constructor •() → self::C#8#0 : super core::Object::•() ; } @@ -2883,8 +2883,8 @@ : super core::Object::•() ; } -class B#10 extends core::Object { - synthetic constructor •() → self::B#10 +class B#10#0 extends core::Object { + synthetic constructor •() → self::B#10#0 : super core::Object::•() ; } @@ -2893,8 +2893,8 @@ : super core::Object::•() ; } -class D#7 extends core::Object { - synthetic constructor •() → self::D#7 +class D#7#0 extends core::Object { + synthetic constructor •() → self::D#7#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.outline.expect b/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.outline.expect index 2df8558..ab4dd54 100644 --- a/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.outline.expect +++ b/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.outline.expect
@@ -2810,24 +2810,24 @@ synthetic constructor •() → self::N ; } -class C#8 extends core::Object { - synthetic constructor •() → self::C#8 +class C#8#0 extends core::Object { + synthetic constructor •() → self::C#8#0 ; } class N2 extends core::Object { synthetic constructor •() → self::N2 ; } -class B#10 extends core::Object { - synthetic constructor •() → self::B#10 +class B#10#0 extends core::Object { + synthetic constructor •() → self::B#10#0 ; } class N3 extends core::Object { synthetic constructor •() → self::N3 ; } -class D#7 extends core::Object { - synthetic constructor •() → self::D#7 +class D#7#0 extends core::Object { + synthetic constructor •() → self::D#7#0 ; } class N6 extends core::Object {
diff --git a/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.transformed.expect b/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.transformed.expect index 1894958..f58f1ab 100644 --- a/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/error_recovery/class_header.dart.weak.transformed.expect
@@ -2873,8 +2873,8 @@ : super core::Object::•() ; } -class C#8 extends core::Object { - synthetic constructor •() → self::C#8 +class C#8#0 extends core::Object { + synthetic constructor •() → self::C#8#0 : super core::Object::•() ; } @@ -2883,8 +2883,8 @@ : super core::Object::•() ; } -class B#10 extends core::Object { - synthetic constructor •() → self::B#10 +class B#10#0 extends core::Object { + synthetic constructor •() → self::B#10#0 : super core::Object::•() ; } @@ -2893,8 +2893,8 @@ : super core::Object::•() ; } -class D#7 extends core::Object { - synthetic constructor •() → self::D#7 +class D#7#0 extends core::Object { + synthetic constructor •() → self::D#7#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/issue37776.dart.weak.expect b/pkg/front_end/testcases/general/issue37776.dart.weak.expect index 67447b5..1c64356 100644 --- a/pkg/front_end/testcases/general/issue37776.dart.weak.expect +++ b/pkg/front_end/testcases/general/issue37776.dart.weak.expect
@@ -16,8 +16,8 @@ import self as self; import "dart:core" as core; -class X#1 extends core::Object /*hasConstConstructor*/ { - const constructor foo() → self::X#1 +class X#1#0 extends core::Object /*hasConstConstructor*/ { + const constructor foo() → self::X#1#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/issue37776.dart.weak.modular.expect b/pkg/front_end/testcases/general/issue37776.dart.weak.modular.expect index 67447b5..1c64356 100644 --- a/pkg/front_end/testcases/general/issue37776.dart.weak.modular.expect +++ b/pkg/front_end/testcases/general/issue37776.dart.weak.modular.expect
@@ -16,8 +16,8 @@ import self as self; import "dart:core" as core; -class X#1 extends core::Object /*hasConstConstructor*/ { - const constructor foo() → self::X#1 +class X#1#0 extends core::Object /*hasConstConstructor*/ { + const constructor foo() → self::X#1#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/issue37776.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue37776.dart.weak.outline.expect index 5ed6ff8..86ab2ac 100644 --- a/pkg/front_end/testcases/general/issue37776.dart.weak.outline.expect +++ b/pkg/front_end/testcases/general/issue37776.dart.weak.outline.expect
@@ -12,8 +12,8 @@ import self as self; import "dart:core" as core; -class X#1 extends core::Object /*hasConstConstructor*/ { - const constructor foo() → self::X#1 +class X#1#0 extends core::Object /*hasConstConstructor*/ { + const constructor foo() → self::X#1#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/issue37776.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue37776.dart.weak.transformed.expect index 67447b5..1c64356 100644 --- a/pkg/front_end/testcases/general/issue37776.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/issue37776.dart.weak.transformed.expect
@@ -16,8 +16,8 @@ import self as self; import "dart:core" as core; -class X#1 extends core::Object /*hasConstConstructor*/ { - const constructor foo() → self::X#1 +class X#1#0 extends core::Object /*hasConstConstructor*/ { + const constructor foo() → self::X#1#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/issue39421.dart.weak.expect b/pkg/front_end/testcases/general/issue39421.dart.weak.expect index 8c5950d..029a92c 100644 --- a/pkg/front_end/testcases/general/issue39421.dart.weak.expect +++ b/pkg/front_end/testcases/general/issue39421.dart.weak.expect
@@ -23,8 +23,8 @@ import self as self; import "dart:core" as core; -class A#1 extends core::Object { - synthetic constructor •() → self::A#1 +class A#1#0 extends core::Object { + synthetic constructor •() → self::A#1#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/issue39421.dart.weak.modular.expect b/pkg/front_end/testcases/general/issue39421.dart.weak.modular.expect index 8c5950d..029a92c 100644 --- a/pkg/front_end/testcases/general/issue39421.dart.weak.modular.expect +++ b/pkg/front_end/testcases/general/issue39421.dart.weak.modular.expect
@@ -23,8 +23,8 @@ import self as self; import "dart:core" as core; -class A#1 extends core::Object { - synthetic constructor •() → self::A#1 +class A#1#0 extends core::Object { + synthetic constructor •() → self::A#1#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/issue39421.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue39421.dart.weak.outline.expect index 6e45e4e..63cf3dc 100644 --- a/pkg/front_end/testcases/general/issue39421.dart.weak.outline.expect +++ b/pkg/front_end/testcases/general/issue39421.dart.weak.outline.expect
@@ -19,8 +19,8 @@ import self as self; import "dart:core" as core; -class A#1 extends core::Object { - synthetic constructor •() → self::A#1 +class A#1#0 extends core::Object { + synthetic constructor •() → self::A#1#0 ; } class A extends core::Object {
diff --git a/pkg/front_end/testcases/general/issue39421.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue39421.dart.weak.transformed.expect index 8c5950d..029a92c 100644 --- a/pkg/front_end/testcases/general/issue39421.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/issue39421.dart.weak.transformed.expect
@@ -23,8 +23,8 @@ import self as self; import "dart:core" as core; -class A#1 extends core::Object { - synthetic constructor •() → self::A#1 +class A#1#0 extends core::Object { + synthetic constructor •() → self::A#1#0 : super core::Object::•() ; }
diff --git a/pkg/front_end/testcases/general/issue42997.dart.weak.expect b/pkg/front_end/testcases/general/issue42997.dart.weak.expect index 85c075a..e7185ba 100644 --- a/pkg/front_end/testcases/general/issue42997.dart.weak.expect +++ b/pkg/front_end/testcases/general/issue42997.dart.weak.expect
@@ -31,8 +31,8 @@ // for (PropertyState<Object, Object>> state in _states) ; // ^^ // -// pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1<I, O>'. -// - 'PropertyState#1' is from 'pkg/front_end/testcases/general/issue42997.dart'. +// pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1#0<I, O>'. +// - 'PropertyState#1#0' is from 'pkg/front_end/testcases/general/issue42997.dart'. // Try correcting the name to the name of an existing getter, or defining a getter or field named 'state'. // for (PropertyState<Object, Object>> state in _states) ; // ^^^^^ @@ -46,8 +46,8 @@ import self as self; import "dart:core" as core; -class PropertyState#1<I extends core::Object? = dynamic, O extends core::Object? = dynamic> extends core::Object { - synthetic constructor •() → self::PropertyState#1<self::PropertyState#1::I%, self::PropertyState#1::O%> +class PropertyState#1#0<I extends core::Object? = dynamic, O extends core::Object? = dynamic> extends core::Object { + synthetic constructor •() → self::PropertyState#1#0<self::PropertyState#1#0::I%, self::PropertyState#1#0::O%> : super core::Object::•() ; method dispose() → void { @@ -61,8 +61,8 @@ - 'Type' is from 'dart:core'. Try correcting the operator to an existing operator, or defining a '>>' operator. for (PropertyState<Object, Object>> state in _states) ; - ^^" in #C1{<unresolved>}.>>(invalid-expression "pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1<I, O>'. - - 'PropertyState#1' is from 'pkg/front_end/testcases/general/issue42997.dart'. + ^^" in #C1{<unresolved>}.>>(invalid-expression "pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1#0<I, O>'. + - 'PropertyState#1#0' is from 'pkg/front_end/testcases/general/issue42997.dart'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'state'. for (PropertyState<Object, Object>> state in _states) ; ^^^^^" in this{<unresolved>}.state))
diff --git a/pkg/front_end/testcases/general/issue42997.dart.weak.modular.expect b/pkg/front_end/testcases/general/issue42997.dart.weak.modular.expect index 85c075a..e7185ba 100644 --- a/pkg/front_end/testcases/general/issue42997.dart.weak.modular.expect +++ b/pkg/front_end/testcases/general/issue42997.dart.weak.modular.expect
@@ -31,8 +31,8 @@ // for (PropertyState<Object, Object>> state in _states) ; // ^^ // -// pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1<I, O>'. -// - 'PropertyState#1' is from 'pkg/front_end/testcases/general/issue42997.dart'. +// pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1#0<I, O>'. +// - 'PropertyState#1#0' is from 'pkg/front_end/testcases/general/issue42997.dart'. // Try correcting the name to the name of an existing getter, or defining a getter or field named 'state'. // for (PropertyState<Object, Object>> state in _states) ; // ^^^^^ @@ -46,8 +46,8 @@ import self as self; import "dart:core" as core; -class PropertyState#1<I extends core::Object? = dynamic, O extends core::Object? = dynamic> extends core::Object { - synthetic constructor •() → self::PropertyState#1<self::PropertyState#1::I%, self::PropertyState#1::O%> +class PropertyState#1#0<I extends core::Object? = dynamic, O extends core::Object? = dynamic> extends core::Object { + synthetic constructor •() → self::PropertyState#1#0<self::PropertyState#1#0::I%, self::PropertyState#1#0::O%> : super core::Object::•() ; method dispose() → void { @@ -61,8 +61,8 @@ - 'Type' is from 'dart:core'. Try correcting the operator to an existing operator, or defining a '>>' operator. for (PropertyState<Object, Object>> state in _states) ; - ^^" in #C1{<unresolved>}.>>(invalid-expression "pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1<I, O>'. - - 'PropertyState#1' is from 'pkg/front_end/testcases/general/issue42997.dart'. + ^^" in #C1{<unresolved>}.>>(invalid-expression "pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1#0<I, O>'. + - 'PropertyState#1#0' is from 'pkg/front_end/testcases/general/issue42997.dart'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'state'. for (PropertyState<Object, Object>> state in _states) ; ^^^^^" in this{<unresolved>}.state))
diff --git a/pkg/front_end/testcases/general/issue42997.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue42997.dart.weak.outline.expect index 347c54f..72af488 100644 --- a/pkg/front_end/testcases/general/issue42997.dart.weak.outline.expect +++ b/pkg/front_end/testcases/general/issue42997.dart.weak.outline.expect
@@ -17,8 +17,8 @@ import self as self; import "dart:core" as core; -class PropertyState#1<I extends core::Object? = dynamic, O extends core::Object? = dynamic> extends core::Object { - synthetic constructor •() → self::PropertyState#1<self::PropertyState#1::I%, self::PropertyState#1::O%> +class PropertyState#1#0<I extends core::Object? = dynamic, O extends core::Object? = dynamic> extends core::Object { + synthetic constructor •() → self::PropertyState#1#0<self::PropertyState#1#0::I%, self::PropertyState#1#0::O%> ; method dispose() → void ;
diff --git a/pkg/front_end/testcases/general/issue42997.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue42997.dart.weak.transformed.expect index 85c075a..e7185ba 100644 --- a/pkg/front_end/testcases/general/issue42997.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general/issue42997.dart.weak.transformed.expect
@@ -31,8 +31,8 @@ // for (PropertyState<Object, Object>> state in _states) ; // ^^ // -// pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1<I, O>'. -// - 'PropertyState#1' is from 'pkg/front_end/testcases/general/issue42997.dart'. +// pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1#0<I, O>'. +// - 'PropertyState#1#0' is from 'pkg/front_end/testcases/general/issue42997.dart'. // Try correcting the name to the name of an existing getter, or defining a getter or field named 'state'. // for (PropertyState<Object, Object>> state in _states) ; // ^^^^^ @@ -46,8 +46,8 @@ import self as self; import "dart:core" as core; -class PropertyState#1<I extends core::Object? = dynamic, O extends core::Object? = dynamic> extends core::Object { - synthetic constructor •() → self::PropertyState#1<self::PropertyState#1::I%, self::PropertyState#1::O%> +class PropertyState#1#0<I extends core::Object? = dynamic, O extends core::Object? = dynamic> extends core::Object { + synthetic constructor •() → self::PropertyState#1#0<self::PropertyState#1#0::I%, self::PropertyState#1#0::O%> : super core::Object::•() ; method dispose() → void { @@ -61,8 +61,8 @@ - 'Type' is from 'dart:core'. Try correcting the operator to an existing operator, or defining a '>>' operator. for (PropertyState<Object, Object>> state in _states) ; - ^^" in #C1{<unresolved>}.>>(invalid-expression "pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1<I, O>'. - - 'PropertyState#1' is from 'pkg/front_end/testcases/general/issue42997.dart'. + ^^" in #C1{<unresolved>}.>>(invalid-expression "pkg/front_end/testcases/general/issue42997.dart:12:41: Error: The getter 'state' isn't defined for the class 'PropertyState#1#0<I, O>'. + - 'PropertyState#1#0' is from 'pkg/front_end/testcases/general/issue42997.dart'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'state'. for (PropertyState<Object, Object>> state in _states) ; ^^^^^" in this{<unresolved>}.state))
diff --git a/pkg/front_end/testcases/general/issue49208.dart b/pkg/front_end/testcases/general/issue49208.dart new file mode 100644 index 0000000..6e163b1 --- /dev/null +++ b/pkg/front_end/testcases/general/issue49208.dart
@@ -0,0 +1,43 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +class State<T extends StatefulWidget> {} + +class StatefulWidget {} + +mixin MyMixin<T, W extends StatefulWidget> on State<W> { + void listenToEvents(Stream<MyModel<T>> stream) { + stream.listen((event) {}); + } +} + +class MyModel<T> { + MyModel(this.data); + + final T data; +} + +typedef MyMixinTypedef = MyMixin<String, MyWidget>; + +class MyWidget extends StatefulWidget {} + +// TODO: hover over `listenToEvents` and observe the tooltip + +// Case 1: without additional typedef +// produces `void listenToEvents(Stream<MyModel<String>> stream)` + +class MyWidgetState1 extends State<MyWidget> with MyMixin<String, MyWidget> { + void doSomething() { + listenToEvents(Stream.value(MyModel('foo'))); + } +} + +// Case 2: with typedef for the mixin +// produces `void listenToEvents(Stream<MyModel<dynamic>> stream)` + +class MyWidgetState2 extends State<MyWidget> with MyMixinTypedef { + void doSomething() { + listenToEvents(Stream.value(MyModel('foo'))); + } +}
diff --git a/pkg/front_end/testcases/general/issue49208.dart.textual_outline.expect b/pkg/front_end/testcases/general/issue49208.dart.textual_outline.expect new file mode 100644 index 0000000..5da0660 --- /dev/null +++ b/pkg/front_end/testcases/general/issue49208.dart.textual_outline.expect
@@ -0,0 +1,24 @@ +class State<T extends StatefulWidget> {} + +class StatefulWidget {} + +mixin MyMixin<T, W extends StatefulWidget> on State<W> { + void listenToEvents(Stream<MyModel<T>> stream) {} +} + +class MyModel<T> { + MyModel(this.data); + final T data; +} + +typedef MyMixinTypedef = MyMixin<String, MyWidget>; + +class MyWidget extends StatefulWidget {} + +class MyWidgetState1 extends State<MyWidget> with MyMixin<String, MyWidget> { + void doSomething() {} +} + +class MyWidgetState2 extends State<MyWidget> with MyMixinTypedef { + void doSomething() {} +}
diff --git a/pkg/front_end/testcases/general/issue49208.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/issue49208.dart.textual_outline_modelled.expect new file mode 100644 index 0000000..f98529a --- /dev/null +++ b/pkg/front_end/testcases/general/issue49208.dart.textual_outline_modelled.expect
@@ -0,0 +1,23 @@ +class MyModel<T> { + MyModel(this.data); + final T data; +} + +class MyWidget extends StatefulWidget {} + +class MyWidgetState1 extends State<MyWidget> with MyMixin<String, MyWidget> { + void doSomething() {} +} + +class MyWidgetState2 extends State<MyWidget> with MyMixinTypedef { + void doSomething() {} +} + +class State<T extends StatefulWidget> {} + +class StatefulWidget {} + +mixin MyMixin<T, W extends StatefulWidget> on State<W> { + void listenToEvents(Stream<MyModel<T>> stream) {} +} +typedef MyMixinTypedef = MyMixin<String, MyWidget>;
diff --git a/pkg/front_end/testcases/general/issue49208.dart.weak.expect b/pkg/front_end/testcases/general/issue49208.dart.weak.expect new file mode 100644 index 0000000..dfd789e --- /dev/null +++ b/pkg/front_end/testcases/general/issue49208.dart.weak.expect
@@ -0,0 +1,62 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; +import "dart:async" as asy; + +typedef MyMixinTypedef = self::MyMixin<core::String, self::MyWidget>; +class State<T extends self::StatefulWidget> extends core::Object { + synthetic constructor •() → self::State<self::State::T> + : super core::Object::•() + ; +} +class StatefulWidget extends core::Object { + synthetic constructor •() → self::StatefulWidget + : super core::Object::•() + ; +} +abstract class MyMixin<T extends core::Object? = dynamic, W extends self::StatefulWidget> extends self::State<self::MyMixin::W> /*isMixinDeclaration*/ { + method listenToEvents(covariant-by-class asy::Stream<self::MyModel<self::MyMixin::T%>> stream) → void { + stream.{asy::Stream::listen}((self::MyModel<self::MyMixin::T%> event) → void {}){((self::MyModel<self::MyMixin::T%>) →? void, {cancelOnError: core::bool?, onDone: () →? void, onError: core::Function?}) → asy::StreamSubscription<self::MyModel<self::MyMixin::T%>>}; + } +} +class MyModel<T extends core::Object? = dynamic> extends core::Object { + final field self::MyModel::T% data; + constructor •(self::MyModel::T% data) → self::MyModel<self::MyModel::T%> + : self::MyModel::data = data, super core::Object::•() + ; +} +class MyWidget extends self::StatefulWidget { + synthetic constructor •() → self::MyWidget + : super self::StatefulWidget::•() + ; +} +abstract class _MyWidgetState1&State&MyMixin = self::State<self::MyWidget> with self::MyMixin<core::String, self::MyWidget> /*isAnonymousMixin*/ { + synthetic constructor •() → self::_MyWidgetState1&State&MyMixin + : super self::State::•() + ; + mixin-super-stub method listenToEvents(covariant-by-class asy::Stream<self::MyModel<core::String>> stream) → void + return super.{self::MyMixin::listenToEvents}(stream); +} +class MyWidgetState1 extends self::_MyWidgetState1&State&MyMixin { + synthetic constructor •() → self::MyWidgetState1 + : super self::_MyWidgetState1&State&MyMixin::•() + ; + method doSomething() → void { + this.{self::_MyWidgetState1&State&MyMixin::listenToEvents}(asy::Stream::value<self::MyModel<core::String>>(new self::MyModel::•<core::String>("foo"))){(asy::Stream<self::MyModel<core::String>>) → void}; + } +} +abstract class _MyWidgetState2&State&MyMixinTypedef = self::State<self::MyWidget> with self::MyMixin<core::String, self::MyWidget> /*isAnonymousMixin*/ { + synthetic constructor •() → self::_MyWidgetState2&State&MyMixinTypedef + : super self::State::•() + ; + mixin-super-stub method listenToEvents(covariant-by-class asy::Stream<self::MyModel<core::String>> stream) → void + return super.{self::MyMixin::listenToEvents}(stream); +} +class MyWidgetState2 extends self::_MyWidgetState2&State&MyMixinTypedef { + synthetic constructor •() → self::MyWidgetState2 + : super self::_MyWidgetState2&State&MyMixinTypedef::•() + ; + method doSomething() → void { + this.{self::_MyWidgetState2&State&MyMixinTypedef::listenToEvents}(asy::Stream::value<self::MyModel<core::String>>(new self::MyModel::•<core::String>("foo"))){(asy::Stream<self::MyModel<core::String>>) → void}; + } +}
diff --git a/pkg/front_end/testcases/general/issue49208.dart.weak.modular.expect b/pkg/front_end/testcases/general/issue49208.dart.weak.modular.expect new file mode 100644 index 0000000..dfd789e --- /dev/null +++ b/pkg/front_end/testcases/general/issue49208.dart.weak.modular.expect
@@ -0,0 +1,62 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; +import "dart:async" as asy; + +typedef MyMixinTypedef = self::MyMixin<core::String, self::MyWidget>; +class State<T extends self::StatefulWidget> extends core::Object { + synthetic constructor •() → self::State<self::State::T> + : super core::Object::•() + ; +} +class StatefulWidget extends core::Object { + synthetic constructor •() → self::StatefulWidget + : super core::Object::•() + ; +} +abstract class MyMixin<T extends core::Object? = dynamic, W extends self::StatefulWidget> extends self::State<self::MyMixin::W> /*isMixinDeclaration*/ { + method listenToEvents(covariant-by-class asy::Stream<self::MyModel<self::MyMixin::T%>> stream) → void { + stream.{asy::Stream::listen}((self::MyModel<self::MyMixin::T%> event) → void {}){((self::MyModel<self::MyMixin::T%>) →? void, {cancelOnError: core::bool?, onDone: () →? void, onError: core::Function?}) → asy::StreamSubscription<self::MyModel<self::MyMixin::T%>>}; + } +} +class MyModel<T extends core::Object? = dynamic> extends core::Object { + final field self::MyModel::T% data; + constructor •(self::MyModel::T% data) → self::MyModel<self::MyModel::T%> + : self::MyModel::data = data, super core::Object::•() + ; +} +class MyWidget extends self::StatefulWidget { + synthetic constructor •() → self::MyWidget + : super self::StatefulWidget::•() + ; +} +abstract class _MyWidgetState1&State&MyMixin = self::State<self::MyWidget> with self::MyMixin<core::String, self::MyWidget> /*isAnonymousMixin*/ { + synthetic constructor •() → self::_MyWidgetState1&State&MyMixin + : super self::State::•() + ; + mixin-super-stub method listenToEvents(covariant-by-class asy::Stream<self::MyModel<core::String>> stream) → void + return super.{self::MyMixin::listenToEvents}(stream); +} +class MyWidgetState1 extends self::_MyWidgetState1&State&MyMixin { + synthetic constructor •() → self::MyWidgetState1 + : super self::_MyWidgetState1&State&MyMixin::•() + ; + method doSomething() → void { + this.{self::_MyWidgetState1&State&MyMixin::listenToEvents}(asy::Stream::value<self::MyModel<core::String>>(new self::MyModel::•<core::String>("foo"))){(asy::Stream<self::MyModel<core::String>>) → void}; + } +} +abstract class _MyWidgetState2&State&MyMixinTypedef = self::State<self::MyWidget> with self::MyMixin<core::String, self::MyWidget> /*isAnonymousMixin*/ { + synthetic constructor •() → self::_MyWidgetState2&State&MyMixinTypedef + : super self::State::•() + ; + mixin-super-stub method listenToEvents(covariant-by-class asy::Stream<self::MyModel<core::String>> stream) → void + return super.{self::MyMixin::listenToEvents}(stream); +} +class MyWidgetState2 extends self::_MyWidgetState2&State&MyMixinTypedef { + synthetic constructor •() → self::MyWidgetState2 + : super self::_MyWidgetState2&State&MyMixinTypedef::•() + ; + method doSomething() → void { + this.{self::_MyWidgetState2&State&MyMixinTypedef::listenToEvents}(asy::Stream::value<self::MyModel<core::String>>(new self::MyModel::•<core::String>("foo"))){(asy::Stream<self::MyModel<core::String>>) → void}; + } +}
diff --git a/pkg/front_end/testcases/general/issue49208.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue49208.dart.weak.outline.expect new file mode 100644 index 0000000..90c5335 --- /dev/null +++ b/pkg/front_end/testcases/general/issue49208.dart.weak.outline.expect
@@ -0,0 +1,53 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; +import "dart:async" as asy; + +typedef MyMixinTypedef = self::MyMixin<core::String, self::MyWidget>; +class State<T extends self::StatefulWidget> extends core::Object { + synthetic constructor •() → self::State<self::State::T> + ; +} +class StatefulWidget extends core::Object { + synthetic constructor •() → self::StatefulWidget + ; +} +abstract class MyMixin<T extends core::Object? = dynamic, W extends self::StatefulWidget> extends self::State<self::MyMixin::W> /*isMixinDeclaration*/ { + method listenToEvents(covariant-by-class asy::Stream<self::MyModel<self::MyMixin::T%>> stream) → void + ; +} +class MyModel<T extends core::Object? = dynamic> extends core::Object { + final field self::MyModel::T% data; + constructor •(self::MyModel::T% data) → self::MyModel<self::MyModel::T%> + ; +} +class MyWidget extends self::StatefulWidget { + synthetic constructor •() → self::MyWidget + ; +} +abstract class _MyWidgetState1&State&MyMixin = self::State<self::MyWidget> with self::MyMixin<core::String, self::MyWidget> /*isAnonymousMixin*/ { + synthetic constructor •() → self::_MyWidgetState1&State&MyMixin + : super self::State::•() + ; + mixin-super-stub method listenToEvents(covariant-by-class asy::Stream<self::MyModel<core::String>> stream) → void + return super.{self::MyMixin::listenToEvents}(stream); +} +class MyWidgetState1 extends self::_MyWidgetState1&State&MyMixin { + synthetic constructor •() → self::MyWidgetState1 + ; + method doSomething() → void + ; +} +abstract class _MyWidgetState2&State&MyMixinTypedef = self::State<self::MyWidget> with self::MyMixin<core::String, self::MyWidget> /*isAnonymousMixin*/ { + synthetic constructor •() → self::_MyWidgetState2&State&MyMixinTypedef + : super self::State::•() + ; + mixin-super-stub method listenToEvents(covariant-by-class asy::Stream<self::MyModel<core::String>> stream) → void + return super.{self::MyMixin::listenToEvents}(stream); +} +class MyWidgetState2 extends self::_MyWidgetState2&State&MyMixinTypedef { + synthetic constructor •() → self::MyWidgetState2 + ; + method doSomething() → void + ; +}
diff --git a/pkg/front_end/testcases/general/issue49208.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue49208.dart.weak.transformed.expect new file mode 100644 index 0000000..2dbc897 --- /dev/null +++ b/pkg/front_end/testcases/general/issue49208.dart.weak.transformed.expect
@@ -0,0 +1,64 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; +import "dart:async" as asy; + +typedef MyMixinTypedef = self::MyMixin<core::String, self::MyWidget>; +class State<T extends self::StatefulWidget> extends core::Object { + synthetic constructor •() → self::State<self::State::T> + : super core::Object::•() + ; +} +class StatefulWidget extends core::Object { + synthetic constructor •() → self::StatefulWidget + : super core::Object::•() + ; +} +abstract class MyMixin<T extends core::Object? = dynamic, W extends self::StatefulWidget> extends self::State<self::MyMixin::W> /*isMixinDeclaration*/ { + method listenToEvents(covariant-by-class asy::Stream<self::MyModel<self::MyMixin::T%>> stream) → void { + stream.{asy::Stream::listen}((self::MyModel<self::MyMixin::T%> event) → void {}){((self::MyModel<self::MyMixin::T%>) →? void, {cancelOnError: core::bool?, onDone: () →? void, onError: core::Function?}) → asy::StreamSubscription<self::MyModel<self::MyMixin::T%>>}; + } +} +class MyModel<T extends core::Object? = dynamic> extends core::Object { + final field self::MyModel::T% data; + constructor •(self::MyModel::T% data) → self::MyModel<self::MyModel::T%> + : self::MyModel::data = data, super core::Object::•() + ; +} +class MyWidget extends self::StatefulWidget { + synthetic constructor •() → self::MyWidget + : super self::StatefulWidget::•() + ; +} +abstract class _MyWidgetState1&State&MyMixin extends self::State<self::MyWidget> implements self::MyMixin<core::String, self::MyWidget> /*isAnonymousMixin,isEliminatedMixin*/ { + synthetic constructor •() → self::_MyWidgetState1&State&MyMixin + : super self::State::•() + ; + method listenToEvents(covariant-by-class asy::Stream<self::MyModel<core::String>> stream) → void { + stream.{asy::Stream::listen}((self::MyModel<core::String> event) → void {}){((self::MyModel<core::String>) →? void, {cancelOnError: core::bool?, onDone: () →? void, onError: core::Function?}) → asy::StreamSubscription<self::MyModel<core::String>>}; + } +} +class MyWidgetState1 extends self::_MyWidgetState1&State&MyMixin { + synthetic constructor •() → self::MyWidgetState1 + : super self::_MyWidgetState1&State&MyMixin::•() + ; + method doSomething() → void { + this.{self::_MyWidgetState1&State&MyMixin::listenToEvents}(asy::Stream::value<self::MyModel<core::String>>(new self::MyModel::•<core::String>("foo"))){(asy::Stream<self::MyModel<core::String>>) → void}; + } +} +abstract class _MyWidgetState2&State&MyMixinTypedef extends self::State<self::MyWidget> implements self::MyMixin<core::String, self::MyWidget> /*isAnonymousMixin,isEliminatedMixin*/ { + synthetic constructor •() → self::_MyWidgetState2&State&MyMixinTypedef + : super self::State::•() + ; + method listenToEvents(covariant-by-class asy::Stream<self::MyModel<core::String>> stream) → void { + stream.{asy::Stream::listen}((self::MyModel<core::String> event) → void {}){((self::MyModel<core::String>) →? void, {cancelOnError: core::bool?, onDone: () →? void, onError: core::Function?}) → asy::StreamSubscription<self::MyModel<core::String>>}; + } +} +class MyWidgetState2 extends self::_MyWidgetState2&State&MyMixinTypedef { + synthetic constructor •() → self::MyWidgetState2 + : super self::_MyWidgetState2&State&MyMixinTypedef::•() + ; + method doSomething() → void { + this.{self::_MyWidgetState2&State&MyMixinTypedef::listenToEvents}(asy::Stream::value<self::MyModel<core::String>>(new self::MyModel::•<core::String>("foo"))){(asy::Stream<self::MyModel<core::String>>) → void}; + } +}
diff --git a/pkg/front_end/testcases/incremental/no_outline_change_21.yaml.world.1.expect b/pkg/front_end/testcases/incremental/no_outline_change_21.yaml.world.1.expect index 31c97e3..33d590b 100644 --- a/pkg/front_end/testcases/incremental/no_outline_change_21.yaml.world.1.expect +++ b/pkg/front_end/testcases/incremental/no_outline_change_21.yaml.world.1.expect
@@ -25,8 +25,8 @@ // ^^^^^^^ // - class A1#1 extends dart.core::Object { - constructor foo2() → main::A1#1 + class A1#1#0 extends dart.core::Object { + constructor foo2() → main::A1#1#0 : super dart.core::Object::•() {} } class A1 extends dart.core::Object {
diff --git a/pkg/front_end/testcases/incremental/no_outline_change_21.yaml.world.2.expect b/pkg/front_end/testcases/incremental/no_outline_change_21.yaml.world.2.expect index 31c97e3..33d590b 100644 --- a/pkg/front_end/testcases/incremental/no_outline_change_21.yaml.world.2.expect +++ b/pkg/front_end/testcases/incremental/no_outline_change_21.yaml.world.2.expect
@@ -25,8 +25,8 @@ // ^^^^^^^ // - class A1#1 extends dart.core::Object { - constructor foo2() → main::A1#1 + class A1#1#0 extends dart.core::Object { + constructor foo2() → main::A1#1#0 : super dart.core::Object::•() {} } class A1 extends dart.core::Object {
diff --git a/pkg/front_end/testcases/macros/augment_super.dart.strong.expect b/pkg/front_end/testcases/macros/augment_super.dart.strong.expect index 7942619..cdc87f7 100644 --- a/pkg/front_end/testcases/macros/augment_super.dart.strong.expect +++ b/pkg/front_end/testcases/macros/augment_super.dart.strong.expect
@@ -171,7 +171,12 @@ self::_#topLevelMethod#augment0(); #C1; } -static method topLevelMethodErrors() → void {} +static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodErrors() → void { + core::int local; + invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:12:3: Error: Undefined name 'augment'. + augment; // Error + ^^^^^^^"; +} static get /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelProperty() → core::List<core::int> { return block { final core::List<core::int> #t1 = core::List::of<core::int>(self::_#topLevelProperty#augment0); @@ -195,12 +200,6 @@ ^" == null ?{invalid-type} self::_#nullableTopLevelProperty#augment0 = value : null; } static method main() → dynamic {} -static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodError() → void { - core::int local; - invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:12:3: Error: Undefined name 'augment'. - augment; // Error - ^^^^^^^"; -} static method /* from org-dartlang-testcase:///augment_super_lib.dart */ injectedTopLevelMethod() → void { invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:44:3: Error: 'augment super' is only allowed in member augmentations. augment super(); // Error
diff --git a/pkg/front_end/testcases/macros/augment_super.dart.strong.transformed.expect b/pkg/front_end/testcases/macros/augment_super.dart.strong.transformed.expect index 189ed4b..88d2916 100644 --- a/pkg/front_end/testcases/macros/augment_super.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/macros/augment_super.dart.strong.transformed.expect
@@ -171,7 +171,12 @@ self::_#topLevelMethod#augment0(); #C1; } -static method topLevelMethodErrors() → void {} +static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodErrors() → void { + core::int local; + invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:12:3: Error: Undefined name 'augment'. + augment; // Error + ^^^^^^^"; +} static get /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelProperty() → core::List<core::int> { return block { final core::List<core::int> #t1 = core::List::of<core::int>(self::_#topLevelProperty#augment0); @@ -195,12 +200,6 @@ ^" == null ?{invalid-type} self::_#nullableTopLevelProperty#augment0 = value : null; } static method main() → dynamic {} -static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodError() → void { - core::int local; - invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:12:3: Error: Undefined name 'augment'. - augment; // Error - ^^^^^^^"; -} static method /* from org-dartlang-testcase:///augment_super_lib.dart */ injectedTopLevelMethod() → void { invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:44:3: Error: 'augment super' is only allowed in member augmentations. augment super(); // Error
diff --git a/pkg/front_end/testcases/macros/augment_super.dart.weak.expect b/pkg/front_end/testcases/macros/augment_super.dart.weak.expect index 7942619..cdc87f7 100644 --- a/pkg/front_end/testcases/macros/augment_super.dart.weak.expect +++ b/pkg/front_end/testcases/macros/augment_super.dart.weak.expect
@@ -171,7 +171,12 @@ self::_#topLevelMethod#augment0(); #C1; } -static method topLevelMethodErrors() → void {} +static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodErrors() → void { + core::int local; + invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:12:3: Error: Undefined name 'augment'. + augment; // Error + ^^^^^^^"; +} static get /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelProperty() → core::List<core::int> { return block { final core::List<core::int> #t1 = core::List::of<core::int>(self::_#topLevelProperty#augment0); @@ -195,12 +200,6 @@ ^" == null ?{invalid-type} self::_#nullableTopLevelProperty#augment0 = value : null; } static method main() → dynamic {} -static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodError() → void { - core::int local; - invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:12:3: Error: Undefined name 'augment'. - augment; // Error - ^^^^^^^"; -} static method /* from org-dartlang-testcase:///augment_super_lib.dart */ injectedTopLevelMethod() → void { invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:44:3: Error: 'augment super' is only allowed in member augmentations. augment super(); // Error
diff --git a/pkg/front_end/testcases/macros/augment_super.dart.weak.modular.expect b/pkg/front_end/testcases/macros/augment_super.dart.weak.modular.expect index 7942619..cdc87f7 100644 --- a/pkg/front_end/testcases/macros/augment_super.dart.weak.modular.expect +++ b/pkg/front_end/testcases/macros/augment_super.dart.weak.modular.expect
@@ -171,7 +171,12 @@ self::_#topLevelMethod#augment0(); #C1; } -static method topLevelMethodErrors() → void {} +static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodErrors() → void { + core::int local; + invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:12:3: Error: Undefined name 'augment'. + augment; // Error + ^^^^^^^"; +} static get /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelProperty() → core::List<core::int> { return block { final core::List<core::int> #t1 = core::List::of<core::int>(self::_#topLevelProperty#augment0); @@ -195,12 +200,6 @@ ^" == null ?{invalid-type} self::_#nullableTopLevelProperty#augment0 = value : null; } static method main() → dynamic {} -static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodError() → void { - core::int local; - invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:12:3: Error: Undefined name 'augment'. - augment; // Error - ^^^^^^^"; -} static method /* from org-dartlang-testcase:///augment_super_lib.dart */ injectedTopLevelMethod() → void { invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:44:3: Error: 'augment super' is only allowed in member augmentations. augment super(); // Error
diff --git a/pkg/front_end/testcases/macros/augment_super.dart.weak.outline.expect b/pkg/front_end/testcases/macros/augment_super.dart.weak.outline.expect index 28518f4..806186c 100644 --- a/pkg/front_end/testcases/macros/augment_super.dart.weak.outline.expect +++ b/pkg/front_end/testcases/macros/augment_super.dart.weak.outline.expect
@@ -36,7 +36,5 @@ ; static method main() → dynamic ; -static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodError() → void - ; static method /* from org-dartlang-testcase:///augment_super_lib.dart */ injectedTopLevelMethod() → void ;
diff --git a/pkg/front_end/testcases/macros/augment_super.dart.weak.transformed.expect b/pkg/front_end/testcases/macros/augment_super.dart.weak.transformed.expect index 189ed4b..88d2916 100644 --- a/pkg/front_end/testcases/macros/augment_super.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/macros/augment_super.dart.weak.transformed.expect
@@ -171,7 +171,12 @@ self::_#topLevelMethod#augment0(); #C1; } -static method topLevelMethodErrors() → void {} +static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodErrors() → void { + core::int local; + invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:12:3: Error: Undefined name 'augment'. + augment; // Error + ^^^^^^^"; +} static get /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelProperty() → core::List<core::int> { return block { final core::List<core::int> #t1 = core::List::of<core::int>(self::_#topLevelProperty#augment0); @@ -195,12 +200,6 @@ ^" == null ?{invalid-type} self::_#nullableTopLevelProperty#augment0 = value : null; } static method main() → dynamic {} -static method /* from org-dartlang-testcase:///augment_super_lib.dart */ topLevelMethodError() → void { - core::int local; - invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:12:3: Error: Undefined name 'augment'. - augment; // Error - ^^^^^^^"; -} static method /* from org-dartlang-testcase:///augment_super_lib.dart */ injectedTopLevelMethod() → void { invalid-expression "pkg/front_end/testcases/macros/augment_super_lib.dart:44:3: Error: 'augment super' is only allowed in member augmentations. augment super(); // Error
diff --git a/pkg/front_end/testcases/macros/augment_super_lib.dart b/pkg/front_end/testcases/macros/augment_super_lib.dart index 4a26be6..baef6f4 100644 --- a/pkg/front_end/testcases/macros/augment_super_lib.dart +++ b/pkg/front_end/testcases/macros/augment_super_lib.dart
@@ -7,7 +7,7 @@ augment super; } -augment void topLevelMethodError() { +augment void topLevelMethodErrors() { augment int local; // Error augment; // Error }
diff --git a/pkg/front_end/testcases/macros/class_members.dart b/pkg/front_end/testcases/macros/class_members.dart index 12aa818..1dd6a71 100644 --- a/pkg/front_end/testcases/macros/class_members.dart +++ b/pkg/front_end/testcases/macros/class_members.dart
@@ -4,7 +4,9 @@ import augment 'class_members_lib.dart'; -class Class { +part 'class_members_part.dart'; + +class Class1 { void existingMethod() { print('existingMethod-origin'); } @@ -16,22 +18,61 @@ } external void set augmentedSetter(_); + + static void staticExistingMethod() { + print('staticExistingMethod-origin'); + } + + external static void staticAugmentedMethod(); + + static void set staticExistingSetter(_) { + print('staticExistingSetter-origin'); + } + + external static void set staticAugmentedSetter(_); } -test(Class c) { - c.orphanedMethod(); - c.orphanedSetter = 0; +test(Class1 c1, Class2 c2) { + c1.orphanedMethod(); + c1.orphanedSetter = 0; + c2.orphanedMethod(); + c2.orphanedSetter = 0; + Class1.staticOrphanedMethod(); + Class1.staticOrphanedSetter = 0; + Class2.staticOrphanedMethod(); + Class2.staticOrphanedSetter = 0; } main() { - Class c = new Class(); - c.augmentedMethod(); - c.injectedMethod(); - c.existingMethod(); + Class1 c1 = new Class1(); + c1.augmentedMethod(); + c1.injectedMethod(); + c1.existingMethod(); + Class1.staticAugmentedMethod(); + Class1.staticInjectedMethod(); + Class1.staticExistingMethod(); - c.augmentedSetter = 0; - c.injectedSetter = 0; - c.existingSetter = 0; + c1.augmentedSetter = 0; + c1.injectedSetter = 0; + c1.existingSetter = 0; + Class1.staticAugmentedSetter = 0; + Class1.staticInjectedSetter = 0; + Class1.staticExistingSetter = 0; - injectedMethod(c); + Class2 c2 = new Class2(); + c2.augmentedMethod(); + c2.injectedMethod(); + c2.existingMethod(); + Class2.staticAugmentedMethod(); + Class2.staticInjectedMethod(); + Class2.staticExistingMethod(); + + c2.augmentedSetter = 0; + c2.injectedSetter = 0; + c2.existingSetter = 0; + Class2.staticAugmentedSetter = 0; + Class2.staticInjectedSetter = 0; + Class2.staticExistingSetter = 0; + + injectedMethod(c1, c2); } \ No newline at end of file
diff --git a/pkg/front_end/testcases/macros/class_members.dart.strong.expect b/pkg/front_end/testcases/macros/class_members.dart.strong.expect index 52ceeba..c177741 100644 --- a/pkg/front_end/testcases/macros/class_members.dart.strong.expect +++ b/pkg/front_end/testcases/macros/class_members.dart.strong.expect
@@ -3,10 +3,10 @@ // Problems in library: // // pkg/front_end/testcases/macros/class_members_lib.dart:9:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void existingMethod() { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:8:8: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:10:8: Context: This is the existing member. // void existingMethod() { // ^^^^^^^^^^^^^^ // @@ -15,11 +15,24 @@ // augment void orphanedMethod() { // ^^^^^^^^^^^^^^ // +// pkg/front_end/testcases/macros/class_members_lib.dart:33:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:22:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:39:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// // pkg/front_end/testcases/macros/class_members_lib.dart:21:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:14:12: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:16:12: Context: This is the existing member. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ // @@ -28,25 +41,119 @@ // augment void set orphanedSetter(_) { // ^^^^^^^^^^^^^^ // -// pkg/front_end/testcases/macros/class_members.dart:22:5: Error: The method 'orphanedMethod' isn't defined for the class 'Class'. -// - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. -// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. -// c.orphanedMethod(); -// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_lib.dart:45:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:28:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ // -// pkg/front_end/testcases/macros/class_members.dart:23:5: Error: The setter 'orphanedSetter' isn't defined for the class 'Class'. -// - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// pkg/front_end/testcases/macros/class_members_lib.dart:51:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:60:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:8:8: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:66:16: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:84:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:20:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:90:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:72:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:14:12: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:78:20: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:96:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:26:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:102:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:40:10: Error: Member not found: 'Class1.staticOrphanedMethod'. +// Class1.staticOrphanedMethod(); +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:41:10: Error: Setter not found: 'staticOrphanedSetter'. +// Class1.staticOrphanedSetter = 0; +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:42:10: Error: Member not found: 'Class2.staticOrphanedMethod'. +// Class2.staticOrphanedMethod(); +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:43:10: Error: Setter not found: 'staticOrphanedSetter'. +// Class2.staticOrphanedSetter = 0; +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:36:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class1'. +// - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. +// c1.orphanedMethod(); +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:37:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class1'. +// - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. // Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. -// c.orphanedSetter = 0; -// ^^^^^^^^^^^^^^ +// c1.orphanedSetter = 0; +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:38:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class2'. +// - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. +// c2.orphanedMethod(); +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:39:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class2'. +// - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. +// c2.orphanedSetter = 0; +// ^^^^^^^^^^^^^^ // import self as self; import "dart:core" as core; import "org-dartlang-testcase:///class_members.dart"; -class Class extends core::Object { - synthetic constructor •() → self::Class +part class_members_part.dart; +class Class1 extends core::Object { + synthetic constructor •() → self::Class1 : super core::Object::•() ; method existingMethod() → void { @@ -61,6 +168,18 @@ set /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedSetter(dynamic _) → void { core::print("augmentedSetter"); } + static method staticExistingMethod() → void { + core::print("staticExistingMethod-origin"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedMethod() → void { + core::print("staticAugmentedMethod"); + } + static set staticExistingSetter(dynamic _) → void { + core::print("staticExistingSetter-origin"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedSetter(dynamic _) → void { + core::print("staticAugmentedSetter"); + } method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void { core::print("injectedMethod"); } @@ -73,39 +192,180 @@ set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void { core::print("orphanedSetter"); } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void { + core::print("staticExistingMethod-duplicate"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void { + core::print("staticInjectedMethod"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void { + core::print("staticOrphanedMethod"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void { + core::print("staticExistingSetter-duplicate"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void { + core::print("staticInjectedSetter"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void { + core::print("staticOrphanedSetter"); + } } -static method test(self::Class c) → dynamic { - invalid-expression "pkg/front_end/testcases/macros/class_members.dart:22:5: Error: The method 'orphanedMethod' isn't defined for the class 'Class'. - - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. +class Class2 extends core::Object { // from org-dartlang-testcase:///class_members_part.dart + synthetic constructor •() → self::Class2 + : super core::Object::•() + ; + method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void { + core::print("injectedMethod"); + } + method /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedMethod() → void { + core::print("orphanedMethod"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ injectedSetter(dynamic _) → void { + core::print("injectedSetter"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void { + core::print("orphanedSetter"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void { + core::print("staticExistingMethod-duplicate"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void { + core::print("staticInjectedMethod"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void { + core::print("staticOrphanedMethod"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void { + core::print("staticExistingSetter-duplicate"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void { + core::print("staticInjectedSetter"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void { + core::print("staticOrphanedSetter"); + } + method existingMethod() → void { + core::print("existingMethod-origin"); + } + method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedMethod() → void { + core::print("augmentedMethod"); + } + set existingSetter(dynamic _) → void { + core::print("existingSetter-origin"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedSetter(dynamic _) → void { + core::print("augmentedSetter"); + } + static method staticExistingMethod() → void { + core::print("staticExistingMethod-origin"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedMethod() → void { + core::print("staticAugmentedMethod"); + } + static set staticExistingSetter(dynamic _) → void { + core::print("staticExistingSetter-origin"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedSetter(dynamic _) → void { + core::print("staticAugmentedSetter"); + } +} +static method test(self::Class1 c1, self::Class2 c2) → dynamic { + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:36:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class1'. + - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. - c.orphanedMethod(); - ^^^^^^^^^^^^^^" in c{<unresolved>}.orphanedMethod(); - invalid-expression "pkg/front_end/testcases/macros/class_members.dart:23:5: Error: The setter 'orphanedSetter' isn't defined for the class 'Class'. - - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. + c1.orphanedMethod(); + ^^^^^^^^^^^^^^" in c1{<unresolved>}.orphanedMethod(); + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:37:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class1'. + - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. - c.orphanedSetter = 0; - ^^^^^^^^^^^^^^" in c{<unresolved>}.orphanedSetter = 0; + c1.orphanedSetter = 0; + ^^^^^^^^^^^^^^" in c1{<unresolved>}.orphanedSetter = 0; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:38:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class2'. + - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. + c2.orphanedMethod(); + ^^^^^^^^^^^^^^" in c2{<unresolved>}.orphanedMethod(); + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:39:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class2'. + - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. + c2.orphanedSetter = 0; + ^^^^^^^^^^^^^^" in c2{<unresolved>}.orphanedSetter = 0; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:40:10: Error: Member not found: 'Class1.staticOrphanedMethod'. + Class1.staticOrphanedMethod(); + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:41:10: Error: Setter not found: 'staticOrphanedSetter'. + Class1.staticOrphanedSetter = 0; + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:42:10: Error: Member not found: 'Class2.staticOrphanedMethod'. + Class2.staticOrphanedMethod(); + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:43:10: Error: Setter not found: 'staticOrphanedSetter'. + Class2.staticOrphanedSetter = 0; + ^^^^^^^^^^^^^^^^^^^^"; } static method main() → dynamic { - self::Class c = new self::Class::•(); - c.{self::Class::augmentedMethod}(){() → void}; - c.{self::Class::injectedMethod}(){() → void}; - c.{self::Class::existingMethod}(){() → void}; - c.{self::Class::augmentedSetter} = 0; - c.{self::Class::injectedSetter} = 0; - c.{self::Class::existingSetter} = 0; - self::injectedMethod(c); + self::Class1 c1 = new self::Class1::•(); + c1.{self::Class1::augmentedMethod}(){() → void}; + c1.{self::Class1::injectedMethod}(){() → void}; + c1.{self::Class1::existingMethod}(){() → void}; + self::Class1::staticAugmentedMethod(); + self::Class1::staticInjectedMethod(); + self::Class1::staticExistingMethod(); + c1.{self::Class1::augmentedSetter} = 0; + c1.{self::Class1::injectedSetter} = 0; + c1.{self::Class1::existingSetter} = 0; + self::Class1::staticAugmentedSetter = 0; + self::Class1::staticInjectedSetter = 0; + self::Class1::staticExistingSetter = 0; + self::Class2 c2 = new self::Class2::•(); + c2.{self::Class2::augmentedMethod}(){() → void}; + c2.{self::Class2::injectedMethod}(){() → void}; + c2.{self::Class2::existingMethod}(){() → void}; + self::Class2::staticAugmentedMethod(); + self::Class2::staticInjectedMethod(); + self::Class2::staticExistingMethod(); + c2.{self::Class2::augmentedSetter} = 0; + c2.{self::Class2::injectedSetter} = 0; + c2.{self::Class2::existingSetter} = 0; + self::Class2::staticAugmentedSetter = 0; + self::Class2::staticInjectedSetter = 0; + self::Class2::staticExistingSetter = 0; + self::injectedMethod(c1, c2); } -static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class c) → void { - c.{self::Class::orphanedMethod}(){() → void}; - c.{self::Class::orphanedMethod}(){() → void}; - c.{self::Class::orphanedSetter} = 0; +static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class1 c1, self::Class2 c2) → void { + c1.{self::Class1::orphanedMethod}(){() → void}; + c1.{self::Class1::orphanedSetter} = 0; + c2.{self::Class2::orphanedMethod}(){() → void}; + c2.{self::Class2::orphanedSetter} = 0; + self::Class1::staticOrphanedMethod(); + self::Class1::staticOrphanedSetter = 0; + self::Class2::staticOrphanedMethod(); + self::Class2::staticOrphanedSetter = 0; } -static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class c) → void { - c.{self::Class::augmentedMethod}(){() → void}; - c.{self::Class::injectedMethod}(){() → void}; - c.{self::Class::existingMethod}(){() → void}; - c.{self::Class::augmentedSetter} = 0; - c.{self::Class::injectedSetter} = 0; - c.{self::Class::existingSetter} = 0; +static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class1 c1, self::Class2 c2) → void { + c1.{self::Class1::augmentedMethod}(){() → void}; + c1.{self::Class1::injectedMethod}(){() → void}; + c1.{self::Class1::existingMethod}(){() → void}; + self::Class1::staticAugmentedMethod(); + self::Class1::staticInjectedMethod(); + self::Class1::staticExistingMethod#1(); + c1.{self::Class1::augmentedSetter} = 0; + c1.{self::Class1::injectedSetter} = 0; + c1.{self::Class1::existingSetter} = 0; + self::Class1::staticAugmentedSetter = 0; + self::Class1::staticInjectedSetter = 0; + self::Class1::staticExistingSetter#1 = 0; + c2.{self::Class2::augmentedMethod}(){() → void}; + c2.{self::Class2::injectedMethod}(){() → void}; + c2.{self::Class2::existingMethod}(){() → void}; + self::Class2::staticAugmentedMethod(); + self::Class2::staticInjectedMethod(); + self::Class2::staticExistingMethod#1(); + c2.{self::Class2::augmentedSetter} = 0; + c2.{self::Class2::injectedSetter} = 0; + c2.{self::Class2::existingSetter} = 0; + self::Class2::staticAugmentedSetter = 0; + self::Class2::staticInjectedSetter = 0; + self::Class2::staticExistingSetter#1 = 0; }
diff --git a/pkg/front_end/testcases/macros/class_members.dart.strong.transformed.expect b/pkg/front_end/testcases/macros/class_members.dart.strong.transformed.expect index 52ceeba..c177741 100644 --- a/pkg/front_end/testcases/macros/class_members.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/macros/class_members.dart.strong.transformed.expect
@@ -3,10 +3,10 @@ // Problems in library: // // pkg/front_end/testcases/macros/class_members_lib.dart:9:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void existingMethod() { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:8:8: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:10:8: Context: This is the existing member. // void existingMethod() { // ^^^^^^^^^^^^^^ // @@ -15,11 +15,24 @@ // augment void orphanedMethod() { // ^^^^^^^^^^^^^^ // +// pkg/front_end/testcases/macros/class_members_lib.dart:33:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:22:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:39:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// // pkg/front_end/testcases/macros/class_members_lib.dart:21:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:14:12: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:16:12: Context: This is the existing member. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ // @@ -28,25 +41,119 @@ // augment void set orphanedSetter(_) { // ^^^^^^^^^^^^^^ // -// pkg/front_end/testcases/macros/class_members.dart:22:5: Error: The method 'orphanedMethod' isn't defined for the class 'Class'. -// - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. -// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. -// c.orphanedMethod(); -// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_lib.dart:45:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:28:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ // -// pkg/front_end/testcases/macros/class_members.dart:23:5: Error: The setter 'orphanedSetter' isn't defined for the class 'Class'. -// - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// pkg/front_end/testcases/macros/class_members_lib.dart:51:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:60:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:8:8: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:66:16: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:84:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:20:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:90:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:72:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:14:12: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:78:20: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:96:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:26:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:102:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:40:10: Error: Member not found: 'Class1.staticOrphanedMethod'. +// Class1.staticOrphanedMethod(); +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:41:10: Error: Setter not found: 'staticOrphanedSetter'. +// Class1.staticOrphanedSetter = 0; +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:42:10: Error: Member not found: 'Class2.staticOrphanedMethod'. +// Class2.staticOrphanedMethod(); +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:43:10: Error: Setter not found: 'staticOrphanedSetter'. +// Class2.staticOrphanedSetter = 0; +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:36:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class1'. +// - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. +// c1.orphanedMethod(); +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:37:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class1'. +// - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. // Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. -// c.orphanedSetter = 0; -// ^^^^^^^^^^^^^^ +// c1.orphanedSetter = 0; +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:38:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class2'. +// - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. +// c2.orphanedMethod(); +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:39:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class2'. +// - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. +// c2.orphanedSetter = 0; +// ^^^^^^^^^^^^^^ // import self as self; import "dart:core" as core; import "org-dartlang-testcase:///class_members.dart"; -class Class extends core::Object { - synthetic constructor •() → self::Class +part class_members_part.dart; +class Class1 extends core::Object { + synthetic constructor •() → self::Class1 : super core::Object::•() ; method existingMethod() → void { @@ -61,6 +168,18 @@ set /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedSetter(dynamic _) → void { core::print("augmentedSetter"); } + static method staticExistingMethod() → void { + core::print("staticExistingMethod-origin"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedMethod() → void { + core::print("staticAugmentedMethod"); + } + static set staticExistingSetter(dynamic _) → void { + core::print("staticExistingSetter-origin"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedSetter(dynamic _) → void { + core::print("staticAugmentedSetter"); + } method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void { core::print("injectedMethod"); } @@ -73,39 +192,180 @@ set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void { core::print("orphanedSetter"); } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void { + core::print("staticExistingMethod-duplicate"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void { + core::print("staticInjectedMethod"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void { + core::print("staticOrphanedMethod"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void { + core::print("staticExistingSetter-duplicate"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void { + core::print("staticInjectedSetter"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void { + core::print("staticOrphanedSetter"); + } } -static method test(self::Class c) → dynamic { - invalid-expression "pkg/front_end/testcases/macros/class_members.dart:22:5: Error: The method 'orphanedMethod' isn't defined for the class 'Class'. - - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. +class Class2 extends core::Object { // from org-dartlang-testcase:///class_members_part.dart + synthetic constructor •() → self::Class2 + : super core::Object::•() + ; + method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void { + core::print("injectedMethod"); + } + method /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedMethod() → void { + core::print("orphanedMethod"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ injectedSetter(dynamic _) → void { + core::print("injectedSetter"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void { + core::print("orphanedSetter"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void { + core::print("staticExistingMethod-duplicate"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void { + core::print("staticInjectedMethod"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void { + core::print("staticOrphanedMethod"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void { + core::print("staticExistingSetter-duplicate"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void { + core::print("staticInjectedSetter"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void { + core::print("staticOrphanedSetter"); + } + method existingMethod() → void { + core::print("existingMethod-origin"); + } + method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedMethod() → void { + core::print("augmentedMethod"); + } + set existingSetter(dynamic _) → void { + core::print("existingSetter-origin"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedSetter(dynamic _) → void { + core::print("augmentedSetter"); + } + static method staticExistingMethod() → void { + core::print("staticExistingMethod-origin"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedMethod() → void { + core::print("staticAugmentedMethod"); + } + static set staticExistingSetter(dynamic _) → void { + core::print("staticExistingSetter-origin"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedSetter(dynamic _) → void { + core::print("staticAugmentedSetter"); + } +} +static method test(self::Class1 c1, self::Class2 c2) → dynamic { + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:36:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class1'. + - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. - c.orphanedMethod(); - ^^^^^^^^^^^^^^" in c{<unresolved>}.orphanedMethod(); - invalid-expression "pkg/front_end/testcases/macros/class_members.dart:23:5: Error: The setter 'orphanedSetter' isn't defined for the class 'Class'. - - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. + c1.orphanedMethod(); + ^^^^^^^^^^^^^^" in c1{<unresolved>}.orphanedMethod(); + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:37:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class1'. + - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. - c.orphanedSetter = 0; - ^^^^^^^^^^^^^^" in c{<unresolved>}.orphanedSetter = 0; + c1.orphanedSetter = 0; + ^^^^^^^^^^^^^^" in c1{<unresolved>}.orphanedSetter = 0; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:38:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class2'. + - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. + c2.orphanedMethod(); + ^^^^^^^^^^^^^^" in c2{<unresolved>}.orphanedMethod(); + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:39:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class2'. + - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. + c2.orphanedSetter = 0; + ^^^^^^^^^^^^^^" in c2{<unresolved>}.orphanedSetter = 0; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:40:10: Error: Member not found: 'Class1.staticOrphanedMethod'. + Class1.staticOrphanedMethod(); + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:41:10: Error: Setter not found: 'staticOrphanedSetter'. + Class1.staticOrphanedSetter = 0; + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:42:10: Error: Member not found: 'Class2.staticOrphanedMethod'. + Class2.staticOrphanedMethod(); + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:43:10: Error: Setter not found: 'staticOrphanedSetter'. + Class2.staticOrphanedSetter = 0; + ^^^^^^^^^^^^^^^^^^^^"; } static method main() → dynamic { - self::Class c = new self::Class::•(); - c.{self::Class::augmentedMethod}(){() → void}; - c.{self::Class::injectedMethod}(){() → void}; - c.{self::Class::existingMethod}(){() → void}; - c.{self::Class::augmentedSetter} = 0; - c.{self::Class::injectedSetter} = 0; - c.{self::Class::existingSetter} = 0; - self::injectedMethod(c); + self::Class1 c1 = new self::Class1::•(); + c1.{self::Class1::augmentedMethod}(){() → void}; + c1.{self::Class1::injectedMethod}(){() → void}; + c1.{self::Class1::existingMethod}(){() → void}; + self::Class1::staticAugmentedMethod(); + self::Class1::staticInjectedMethod(); + self::Class1::staticExistingMethod(); + c1.{self::Class1::augmentedSetter} = 0; + c1.{self::Class1::injectedSetter} = 0; + c1.{self::Class1::existingSetter} = 0; + self::Class1::staticAugmentedSetter = 0; + self::Class1::staticInjectedSetter = 0; + self::Class1::staticExistingSetter = 0; + self::Class2 c2 = new self::Class2::•(); + c2.{self::Class2::augmentedMethod}(){() → void}; + c2.{self::Class2::injectedMethod}(){() → void}; + c2.{self::Class2::existingMethod}(){() → void}; + self::Class2::staticAugmentedMethod(); + self::Class2::staticInjectedMethod(); + self::Class2::staticExistingMethod(); + c2.{self::Class2::augmentedSetter} = 0; + c2.{self::Class2::injectedSetter} = 0; + c2.{self::Class2::existingSetter} = 0; + self::Class2::staticAugmentedSetter = 0; + self::Class2::staticInjectedSetter = 0; + self::Class2::staticExistingSetter = 0; + self::injectedMethod(c1, c2); } -static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class c) → void { - c.{self::Class::orphanedMethod}(){() → void}; - c.{self::Class::orphanedMethod}(){() → void}; - c.{self::Class::orphanedSetter} = 0; +static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class1 c1, self::Class2 c2) → void { + c1.{self::Class1::orphanedMethod}(){() → void}; + c1.{self::Class1::orphanedSetter} = 0; + c2.{self::Class2::orphanedMethod}(){() → void}; + c2.{self::Class2::orphanedSetter} = 0; + self::Class1::staticOrphanedMethod(); + self::Class1::staticOrphanedSetter = 0; + self::Class2::staticOrphanedMethod(); + self::Class2::staticOrphanedSetter = 0; } -static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class c) → void { - c.{self::Class::augmentedMethod}(){() → void}; - c.{self::Class::injectedMethod}(){() → void}; - c.{self::Class::existingMethod}(){() → void}; - c.{self::Class::augmentedSetter} = 0; - c.{self::Class::injectedSetter} = 0; - c.{self::Class::existingSetter} = 0; +static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class1 c1, self::Class2 c2) → void { + c1.{self::Class1::augmentedMethod}(){() → void}; + c1.{self::Class1::injectedMethod}(){() → void}; + c1.{self::Class1::existingMethod}(){() → void}; + self::Class1::staticAugmentedMethod(); + self::Class1::staticInjectedMethod(); + self::Class1::staticExistingMethod#1(); + c1.{self::Class1::augmentedSetter} = 0; + c1.{self::Class1::injectedSetter} = 0; + c1.{self::Class1::existingSetter} = 0; + self::Class1::staticAugmentedSetter = 0; + self::Class1::staticInjectedSetter = 0; + self::Class1::staticExistingSetter#1 = 0; + c2.{self::Class2::augmentedMethod}(){() → void}; + c2.{self::Class2::injectedMethod}(){() → void}; + c2.{self::Class2::existingMethod}(){() → void}; + self::Class2::staticAugmentedMethod(); + self::Class2::staticInjectedMethod(); + self::Class2::staticExistingMethod#1(); + c2.{self::Class2::augmentedSetter} = 0; + c2.{self::Class2::injectedSetter} = 0; + c2.{self::Class2::existingSetter} = 0; + self::Class2::staticAugmentedSetter = 0; + self::Class2::staticInjectedSetter = 0; + self::Class2::staticExistingSetter#1 = 0; }
diff --git a/pkg/front_end/testcases/macros/class_members.dart.textual_outline.expect b/pkg/front_end/testcases/macros/class_members.dart.textual_outline.expect index c5c8d44..f0737d5 100644 --- a/pkg/front_end/testcases/macros/class_members.dart.textual_outline.expect +++ b/pkg/front_end/testcases/macros/class_members.dart.textual_outline.expect
@@ -1,9 +1,14 @@ import augment 'class_members_lib.dart'; -class Class { +part 'class_members_part.dart'; +class Class1 { void existingMethod() {} external void augmentedMethod(); void set existingSetter(_) {} external void set augmentedSetter(_); + static void staticExistingMethod() {} + external static void staticAugmentedMethod(); + static void set staticExistingSetter(_) {} + external static void set staticAugmentedSetter(_); } -test(Class c) {} +test(Class1 c1, Class2 c2) {} main() {}
diff --git a/pkg/front_end/testcases/macros/class_members.dart.weak.expect b/pkg/front_end/testcases/macros/class_members.dart.weak.expect index 52ceeba..c177741 100644 --- a/pkg/front_end/testcases/macros/class_members.dart.weak.expect +++ b/pkg/front_end/testcases/macros/class_members.dart.weak.expect
@@ -3,10 +3,10 @@ // Problems in library: // // pkg/front_end/testcases/macros/class_members_lib.dart:9:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void existingMethod() { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:8:8: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:10:8: Context: This is the existing member. // void existingMethod() { // ^^^^^^^^^^^^^^ // @@ -15,11 +15,24 @@ // augment void orphanedMethod() { // ^^^^^^^^^^^^^^ // +// pkg/front_end/testcases/macros/class_members_lib.dart:33:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:22:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:39:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// // pkg/front_end/testcases/macros/class_members_lib.dart:21:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:14:12: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:16:12: Context: This is the existing member. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ // @@ -28,25 +41,119 @@ // augment void set orphanedSetter(_) { // ^^^^^^^^^^^^^^ // -// pkg/front_end/testcases/macros/class_members.dart:22:5: Error: The method 'orphanedMethod' isn't defined for the class 'Class'. -// - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. -// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. -// c.orphanedMethod(); -// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_lib.dart:45:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:28:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ // -// pkg/front_end/testcases/macros/class_members.dart:23:5: Error: The setter 'orphanedSetter' isn't defined for the class 'Class'. -// - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// pkg/front_end/testcases/macros/class_members_lib.dart:51:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:60:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:8:8: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:66:16: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:84:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:20:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:90:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:72:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:14:12: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:78:20: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:96:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:26:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:102:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:40:10: Error: Member not found: 'Class1.staticOrphanedMethod'. +// Class1.staticOrphanedMethod(); +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:41:10: Error: Setter not found: 'staticOrphanedSetter'. +// Class1.staticOrphanedSetter = 0; +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:42:10: Error: Member not found: 'Class2.staticOrphanedMethod'. +// Class2.staticOrphanedMethod(); +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:43:10: Error: Setter not found: 'staticOrphanedSetter'. +// Class2.staticOrphanedSetter = 0; +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:36:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class1'. +// - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. +// c1.orphanedMethod(); +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:37:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class1'. +// - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. // Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. -// c.orphanedSetter = 0; -// ^^^^^^^^^^^^^^ +// c1.orphanedSetter = 0; +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:38:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class2'. +// - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. +// c2.orphanedMethod(); +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:39:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class2'. +// - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. +// c2.orphanedSetter = 0; +// ^^^^^^^^^^^^^^ // import self as self; import "dart:core" as core; import "org-dartlang-testcase:///class_members.dart"; -class Class extends core::Object { - synthetic constructor •() → self::Class +part class_members_part.dart; +class Class1 extends core::Object { + synthetic constructor •() → self::Class1 : super core::Object::•() ; method existingMethod() → void { @@ -61,6 +168,18 @@ set /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedSetter(dynamic _) → void { core::print("augmentedSetter"); } + static method staticExistingMethod() → void { + core::print("staticExistingMethod-origin"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedMethod() → void { + core::print("staticAugmentedMethod"); + } + static set staticExistingSetter(dynamic _) → void { + core::print("staticExistingSetter-origin"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedSetter(dynamic _) → void { + core::print("staticAugmentedSetter"); + } method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void { core::print("injectedMethod"); } @@ -73,39 +192,180 @@ set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void { core::print("orphanedSetter"); } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void { + core::print("staticExistingMethod-duplicate"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void { + core::print("staticInjectedMethod"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void { + core::print("staticOrphanedMethod"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void { + core::print("staticExistingSetter-duplicate"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void { + core::print("staticInjectedSetter"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void { + core::print("staticOrphanedSetter"); + } } -static method test(self::Class c) → dynamic { - invalid-expression "pkg/front_end/testcases/macros/class_members.dart:22:5: Error: The method 'orphanedMethod' isn't defined for the class 'Class'. - - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. +class Class2 extends core::Object { // from org-dartlang-testcase:///class_members_part.dart + synthetic constructor •() → self::Class2 + : super core::Object::•() + ; + method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void { + core::print("injectedMethod"); + } + method /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedMethod() → void { + core::print("orphanedMethod"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ injectedSetter(dynamic _) → void { + core::print("injectedSetter"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void { + core::print("orphanedSetter"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void { + core::print("staticExistingMethod-duplicate"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void { + core::print("staticInjectedMethod"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void { + core::print("staticOrphanedMethod"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void { + core::print("staticExistingSetter-duplicate"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void { + core::print("staticInjectedSetter"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void { + core::print("staticOrphanedSetter"); + } + method existingMethod() → void { + core::print("existingMethod-origin"); + } + method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedMethod() → void { + core::print("augmentedMethod"); + } + set existingSetter(dynamic _) → void { + core::print("existingSetter-origin"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedSetter(dynamic _) → void { + core::print("augmentedSetter"); + } + static method staticExistingMethod() → void { + core::print("staticExistingMethod-origin"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedMethod() → void { + core::print("staticAugmentedMethod"); + } + static set staticExistingSetter(dynamic _) → void { + core::print("staticExistingSetter-origin"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedSetter(dynamic _) → void { + core::print("staticAugmentedSetter"); + } +} +static method test(self::Class1 c1, self::Class2 c2) → dynamic { + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:36:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class1'. + - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. - c.orphanedMethod(); - ^^^^^^^^^^^^^^" in c{<unresolved>}.orphanedMethod(); - invalid-expression "pkg/front_end/testcases/macros/class_members.dart:23:5: Error: The setter 'orphanedSetter' isn't defined for the class 'Class'. - - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. + c1.orphanedMethod(); + ^^^^^^^^^^^^^^" in c1{<unresolved>}.orphanedMethod(); + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:37:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class1'. + - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. - c.orphanedSetter = 0; - ^^^^^^^^^^^^^^" in c{<unresolved>}.orphanedSetter = 0; + c1.orphanedSetter = 0; + ^^^^^^^^^^^^^^" in c1{<unresolved>}.orphanedSetter = 0; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:38:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class2'. + - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. + c2.orphanedMethod(); + ^^^^^^^^^^^^^^" in c2{<unresolved>}.orphanedMethod(); + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:39:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class2'. + - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. + c2.orphanedSetter = 0; + ^^^^^^^^^^^^^^" in c2{<unresolved>}.orphanedSetter = 0; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:40:10: Error: Member not found: 'Class1.staticOrphanedMethod'. + Class1.staticOrphanedMethod(); + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:41:10: Error: Setter not found: 'staticOrphanedSetter'. + Class1.staticOrphanedSetter = 0; + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:42:10: Error: Member not found: 'Class2.staticOrphanedMethod'. + Class2.staticOrphanedMethod(); + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:43:10: Error: Setter not found: 'staticOrphanedSetter'. + Class2.staticOrphanedSetter = 0; + ^^^^^^^^^^^^^^^^^^^^"; } static method main() → dynamic { - self::Class c = new self::Class::•(); - c.{self::Class::augmentedMethod}(){() → void}; - c.{self::Class::injectedMethod}(){() → void}; - c.{self::Class::existingMethod}(){() → void}; - c.{self::Class::augmentedSetter} = 0; - c.{self::Class::injectedSetter} = 0; - c.{self::Class::existingSetter} = 0; - self::injectedMethod(c); + self::Class1 c1 = new self::Class1::•(); + c1.{self::Class1::augmentedMethod}(){() → void}; + c1.{self::Class1::injectedMethod}(){() → void}; + c1.{self::Class1::existingMethod}(){() → void}; + self::Class1::staticAugmentedMethod(); + self::Class1::staticInjectedMethod(); + self::Class1::staticExistingMethod(); + c1.{self::Class1::augmentedSetter} = 0; + c1.{self::Class1::injectedSetter} = 0; + c1.{self::Class1::existingSetter} = 0; + self::Class1::staticAugmentedSetter = 0; + self::Class1::staticInjectedSetter = 0; + self::Class1::staticExistingSetter = 0; + self::Class2 c2 = new self::Class2::•(); + c2.{self::Class2::augmentedMethod}(){() → void}; + c2.{self::Class2::injectedMethod}(){() → void}; + c2.{self::Class2::existingMethod}(){() → void}; + self::Class2::staticAugmentedMethod(); + self::Class2::staticInjectedMethod(); + self::Class2::staticExistingMethod(); + c2.{self::Class2::augmentedSetter} = 0; + c2.{self::Class2::injectedSetter} = 0; + c2.{self::Class2::existingSetter} = 0; + self::Class2::staticAugmentedSetter = 0; + self::Class2::staticInjectedSetter = 0; + self::Class2::staticExistingSetter = 0; + self::injectedMethod(c1, c2); } -static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class c) → void { - c.{self::Class::orphanedMethod}(){() → void}; - c.{self::Class::orphanedMethod}(){() → void}; - c.{self::Class::orphanedSetter} = 0; +static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class1 c1, self::Class2 c2) → void { + c1.{self::Class1::orphanedMethod}(){() → void}; + c1.{self::Class1::orphanedSetter} = 0; + c2.{self::Class2::orphanedMethod}(){() → void}; + c2.{self::Class2::orphanedSetter} = 0; + self::Class1::staticOrphanedMethod(); + self::Class1::staticOrphanedSetter = 0; + self::Class2::staticOrphanedMethod(); + self::Class2::staticOrphanedSetter = 0; } -static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class c) → void { - c.{self::Class::augmentedMethod}(){() → void}; - c.{self::Class::injectedMethod}(){() → void}; - c.{self::Class::existingMethod}(){() → void}; - c.{self::Class::augmentedSetter} = 0; - c.{self::Class::injectedSetter} = 0; - c.{self::Class::existingSetter} = 0; +static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class1 c1, self::Class2 c2) → void { + c1.{self::Class1::augmentedMethod}(){() → void}; + c1.{self::Class1::injectedMethod}(){() → void}; + c1.{self::Class1::existingMethod}(){() → void}; + self::Class1::staticAugmentedMethod(); + self::Class1::staticInjectedMethod(); + self::Class1::staticExistingMethod#1(); + c1.{self::Class1::augmentedSetter} = 0; + c1.{self::Class1::injectedSetter} = 0; + c1.{self::Class1::existingSetter} = 0; + self::Class1::staticAugmentedSetter = 0; + self::Class1::staticInjectedSetter = 0; + self::Class1::staticExistingSetter#1 = 0; + c2.{self::Class2::augmentedMethod}(){() → void}; + c2.{self::Class2::injectedMethod}(){() → void}; + c2.{self::Class2::existingMethod}(){() → void}; + self::Class2::staticAugmentedMethod(); + self::Class2::staticInjectedMethod(); + self::Class2::staticExistingMethod#1(); + c2.{self::Class2::augmentedSetter} = 0; + c2.{self::Class2::injectedSetter} = 0; + c2.{self::Class2::existingSetter} = 0; + self::Class2::staticAugmentedSetter = 0; + self::Class2::staticInjectedSetter = 0; + self::Class2::staticExistingSetter#1 = 0; }
diff --git a/pkg/front_end/testcases/macros/class_members.dart.weak.modular.expect b/pkg/front_end/testcases/macros/class_members.dart.weak.modular.expect index 52ceeba..c177741 100644 --- a/pkg/front_end/testcases/macros/class_members.dart.weak.modular.expect +++ b/pkg/front_end/testcases/macros/class_members.dart.weak.modular.expect
@@ -3,10 +3,10 @@ // Problems in library: // // pkg/front_end/testcases/macros/class_members_lib.dart:9:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void existingMethod() { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:8:8: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:10:8: Context: This is the existing member. // void existingMethod() { // ^^^^^^^^^^^^^^ // @@ -15,11 +15,24 @@ // augment void orphanedMethod() { // ^^^^^^^^^^^^^^ // +// pkg/front_end/testcases/macros/class_members_lib.dart:33:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:22:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:39:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// // pkg/front_end/testcases/macros/class_members_lib.dart:21:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:14:12: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:16:12: Context: This is the existing member. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ // @@ -28,25 +41,119 @@ // augment void set orphanedSetter(_) { // ^^^^^^^^^^^^^^ // -// pkg/front_end/testcases/macros/class_members.dart:22:5: Error: The method 'orphanedMethod' isn't defined for the class 'Class'. -// - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. -// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. -// c.orphanedMethod(); -// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_lib.dart:45:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:28:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ // -// pkg/front_end/testcases/macros/class_members.dart:23:5: Error: The setter 'orphanedSetter' isn't defined for the class 'Class'. -// - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// pkg/front_end/testcases/macros/class_members_lib.dart:51:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:60:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:8:8: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:66:16: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:84:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:20:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:90:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:72:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:14:12: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:78:20: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:96:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:26:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:102:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:40:10: Error: Member not found: 'Class1.staticOrphanedMethod'. +// Class1.staticOrphanedMethod(); +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:41:10: Error: Setter not found: 'staticOrphanedSetter'. +// Class1.staticOrphanedSetter = 0; +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:42:10: Error: Member not found: 'Class2.staticOrphanedMethod'. +// Class2.staticOrphanedMethod(); +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:43:10: Error: Setter not found: 'staticOrphanedSetter'. +// Class2.staticOrphanedSetter = 0; +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:36:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class1'. +// - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. +// c1.orphanedMethod(); +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:37:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class1'. +// - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. // Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. -// c.orphanedSetter = 0; -// ^^^^^^^^^^^^^^ +// c1.orphanedSetter = 0; +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:38:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class2'. +// - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. +// c2.orphanedMethod(); +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:39:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class2'. +// - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. +// c2.orphanedSetter = 0; +// ^^^^^^^^^^^^^^ // import self as self; import "dart:core" as core; import "org-dartlang-testcase:///class_members.dart"; -class Class extends core::Object { - synthetic constructor •() → self::Class +part class_members_part.dart; +class Class1 extends core::Object { + synthetic constructor •() → self::Class1 : super core::Object::•() ; method existingMethod() → void { @@ -61,6 +168,18 @@ set /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedSetter(dynamic _) → void { core::print("augmentedSetter"); } + static method staticExistingMethod() → void { + core::print("staticExistingMethod-origin"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedMethod() → void { + core::print("staticAugmentedMethod"); + } + static set staticExistingSetter(dynamic _) → void { + core::print("staticExistingSetter-origin"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedSetter(dynamic _) → void { + core::print("staticAugmentedSetter"); + } method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void { core::print("injectedMethod"); } @@ -73,39 +192,180 @@ set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void { core::print("orphanedSetter"); } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void { + core::print("staticExistingMethod-duplicate"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void { + core::print("staticInjectedMethod"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void { + core::print("staticOrphanedMethod"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void { + core::print("staticExistingSetter-duplicate"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void { + core::print("staticInjectedSetter"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void { + core::print("staticOrphanedSetter"); + } } -static method test(self::Class c) → dynamic { - invalid-expression "pkg/front_end/testcases/macros/class_members.dart:22:5: Error: The method 'orphanedMethod' isn't defined for the class 'Class'. - - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. +class Class2 extends core::Object { // from org-dartlang-testcase:///class_members_part.dart + synthetic constructor •() → self::Class2 + : super core::Object::•() + ; + method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void { + core::print("injectedMethod"); + } + method /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedMethod() → void { + core::print("orphanedMethod"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ injectedSetter(dynamic _) → void { + core::print("injectedSetter"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void { + core::print("orphanedSetter"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void { + core::print("staticExistingMethod-duplicate"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void { + core::print("staticInjectedMethod"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void { + core::print("staticOrphanedMethod"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void { + core::print("staticExistingSetter-duplicate"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void { + core::print("staticInjectedSetter"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void { + core::print("staticOrphanedSetter"); + } + method existingMethod() → void { + core::print("existingMethod-origin"); + } + method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedMethod() → void { + core::print("augmentedMethod"); + } + set existingSetter(dynamic _) → void { + core::print("existingSetter-origin"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedSetter(dynamic _) → void { + core::print("augmentedSetter"); + } + static method staticExistingMethod() → void { + core::print("staticExistingMethod-origin"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedMethod() → void { + core::print("staticAugmentedMethod"); + } + static set staticExistingSetter(dynamic _) → void { + core::print("staticExistingSetter-origin"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedSetter(dynamic _) → void { + core::print("staticAugmentedSetter"); + } +} +static method test(self::Class1 c1, self::Class2 c2) → dynamic { + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:36:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class1'. + - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. - c.orphanedMethod(); - ^^^^^^^^^^^^^^" in c{<unresolved>}.orphanedMethod(); - invalid-expression "pkg/front_end/testcases/macros/class_members.dart:23:5: Error: The setter 'orphanedSetter' isn't defined for the class 'Class'. - - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. + c1.orphanedMethod(); + ^^^^^^^^^^^^^^" in c1{<unresolved>}.orphanedMethod(); + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:37:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class1'. + - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. - c.orphanedSetter = 0; - ^^^^^^^^^^^^^^" in c{<unresolved>}.orphanedSetter = 0; + c1.orphanedSetter = 0; + ^^^^^^^^^^^^^^" in c1{<unresolved>}.orphanedSetter = 0; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:38:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class2'. + - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. + c2.orphanedMethod(); + ^^^^^^^^^^^^^^" in c2{<unresolved>}.orphanedMethod(); + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:39:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class2'. + - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. + c2.orphanedSetter = 0; + ^^^^^^^^^^^^^^" in c2{<unresolved>}.orphanedSetter = 0; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:40:10: Error: Member not found: 'Class1.staticOrphanedMethod'. + Class1.staticOrphanedMethod(); + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:41:10: Error: Setter not found: 'staticOrphanedSetter'. + Class1.staticOrphanedSetter = 0; + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:42:10: Error: Member not found: 'Class2.staticOrphanedMethod'. + Class2.staticOrphanedMethod(); + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:43:10: Error: Setter not found: 'staticOrphanedSetter'. + Class2.staticOrphanedSetter = 0; + ^^^^^^^^^^^^^^^^^^^^"; } static method main() → dynamic { - self::Class c = new self::Class::•(); - c.{self::Class::augmentedMethod}(){() → void}; - c.{self::Class::injectedMethod}(){() → void}; - c.{self::Class::existingMethod}(){() → void}; - c.{self::Class::augmentedSetter} = 0; - c.{self::Class::injectedSetter} = 0; - c.{self::Class::existingSetter} = 0; - self::injectedMethod(c); + self::Class1 c1 = new self::Class1::•(); + c1.{self::Class1::augmentedMethod}(){() → void}; + c1.{self::Class1::injectedMethod}(){() → void}; + c1.{self::Class1::existingMethod}(){() → void}; + self::Class1::staticAugmentedMethod(); + self::Class1::staticInjectedMethod(); + self::Class1::staticExistingMethod(); + c1.{self::Class1::augmentedSetter} = 0; + c1.{self::Class1::injectedSetter} = 0; + c1.{self::Class1::existingSetter} = 0; + self::Class1::staticAugmentedSetter = 0; + self::Class1::staticInjectedSetter = 0; + self::Class1::staticExistingSetter = 0; + self::Class2 c2 = new self::Class2::•(); + c2.{self::Class2::augmentedMethod}(){() → void}; + c2.{self::Class2::injectedMethod}(){() → void}; + c2.{self::Class2::existingMethod}(){() → void}; + self::Class2::staticAugmentedMethod(); + self::Class2::staticInjectedMethod(); + self::Class2::staticExistingMethod(); + c2.{self::Class2::augmentedSetter} = 0; + c2.{self::Class2::injectedSetter} = 0; + c2.{self::Class2::existingSetter} = 0; + self::Class2::staticAugmentedSetter = 0; + self::Class2::staticInjectedSetter = 0; + self::Class2::staticExistingSetter = 0; + self::injectedMethod(c1, c2); } -static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class c) → void { - c.{self::Class::orphanedMethod}(){() → void}; - c.{self::Class::orphanedMethod}(){() → void}; - c.{self::Class::orphanedSetter} = 0; +static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class1 c1, self::Class2 c2) → void { + c1.{self::Class1::orphanedMethod}(){() → void}; + c1.{self::Class1::orphanedSetter} = 0; + c2.{self::Class2::orphanedMethod}(){() → void}; + c2.{self::Class2::orphanedSetter} = 0; + self::Class1::staticOrphanedMethod(); + self::Class1::staticOrphanedSetter = 0; + self::Class2::staticOrphanedMethod(); + self::Class2::staticOrphanedSetter = 0; } -static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class c) → void { - c.{self::Class::augmentedMethod}(){() → void}; - c.{self::Class::injectedMethod}(){() → void}; - c.{self::Class::existingMethod}(){() → void}; - c.{self::Class::augmentedSetter} = 0; - c.{self::Class::injectedSetter} = 0; - c.{self::Class::existingSetter} = 0; +static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class1 c1, self::Class2 c2) → void { + c1.{self::Class1::augmentedMethod}(){() → void}; + c1.{self::Class1::injectedMethod}(){() → void}; + c1.{self::Class1::existingMethod}(){() → void}; + self::Class1::staticAugmentedMethod(); + self::Class1::staticInjectedMethod(); + self::Class1::staticExistingMethod#1(); + c1.{self::Class1::augmentedSetter} = 0; + c1.{self::Class1::injectedSetter} = 0; + c1.{self::Class1::existingSetter} = 0; + self::Class1::staticAugmentedSetter = 0; + self::Class1::staticInjectedSetter = 0; + self::Class1::staticExistingSetter#1 = 0; + c2.{self::Class2::augmentedMethod}(){() → void}; + c2.{self::Class2::injectedMethod}(){() → void}; + c2.{self::Class2::existingMethod}(){() → void}; + self::Class2::staticAugmentedMethod(); + self::Class2::staticInjectedMethod(); + self::Class2::staticExistingMethod#1(); + c2.{self::Class2::augmentedSetter} = 0; + c2.{self::Class2::injectedSetter} = 0; + c2.{self::Class2::existingSetter} = 0; + self::Class2::staticAugmentedSetter = 0; + self::Class2::staticInjectedSetter = 0; + self::Class2::staticExistingSetter#1 = 0; }
diff --git a/pkg/front_end/testcases/macros/class_members.dart.weak.outline.expect b/pkg/front_end/testcases/macros/class_members.dart.weak.outline.expect index 49e7b51..fe7ba9d 100644 --- a/pkg/front_end/testcases/macros/class_members.dart.weak.outline.expect +++ b/pkg/front_end/testcases/macros/class_members.dart.weak.outline.expect
@@ -3,10 +3,10 @@ // Problems in library: // // pkg/front_end/testcases/macros/class_members_lib.dart:9:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void existingMethod() { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:8:8: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:10:8: Context: This is the existing member. // void existingMethod() { // ^^^^^^^^^^^^^^ // @@ -15,11 +15,24 @@ // augment void orphanedMethod() { // ^^^^^^^^^^^^^^ // +// pkg/front_end/testcases/macros/class_members_lib.dart:33:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:22:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:39:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// // pkg/front_end/testcases/macros/class_members_lib.dart:21:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:14:12: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:16:12: Context: This is the existing member. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ // @@ -28,13 +41,79 @@ // augment void set orphanedSetter(_) { // ^^^^^^^^^^^^^^ // +// pkg/front_end/testcases/macros/class_members_lib.dart:45:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:28:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:51:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:60:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:8:8: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:66:16: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:84:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:20:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:90:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:72:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:14:12: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:78:20: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:96:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:26:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:102:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// import self as self; import "dart:core" as core; import "org-dartlang-testcase:///class_members.dart"; -class Class extends core::Object { - synthetic constructor •() → self::Class +part class_members_part.dart; +class Class1 extends core::Object { + synthetic constructor •() → self::Class1 ; method existingMethod() → void ; @@ -42,6 +121,12 @@ set existingSetter(dynamic _) → void ; external set augmentedSetter(dynamic _) → void; + static method staticExistingMethod() → void + ; + external static method staticAugmentedMethod() → void; + static set staticExistingSetter(dynamic _) → void + ; + external static set staticAugmentedSetter(dynamic _) → void; method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void ; method /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedMethod() → void @@ -50,12 +135,60 @@ ; set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void ; + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void + ; + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void + ; + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void + ; + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void + ; + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void + ; + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void + ; } -static method test(self::Class c) → dynamic +class Class2 extends core::Object { // from org-dartlang-testcase:///class_members_part.dart + synthetic constructor •() → self::Class2 + ; + method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void + ; + method /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedMethod() → void + ; + set /* from org-dartlang-testcase:///class_members_lib.dart */ injectedSetter(dynamic _) → void + ; + set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void + ; + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void + ; + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void + ; + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void + ; + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void + ; + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void + ; + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void + ; + method existingMethod() → void + ; + external method augmentedMethod() → void; + set existingSetter(dynamic _) → void + ; + external set augmentedSetter(dynamic _) → void; + static method staticExistingMethod() → void + ; + external static method staticAugmentedMethod() → void; + static set staticExistingSetter(dynamic _) → void + ; + external static set staticAugmentedSetter(dynamic _) → void; +} +static method test(self::Class1 c1, self::Class2 c2) → dynamic ; static method main() → dynamic ; -static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class c) → void +static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class1 c1, self::Class2 c2) → void ; -static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class c) → void +static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class1 c1, self::Class2 c2) → void ;
diff --git a/pkg/front_end/testcases/macros/class_members.dart.weak.transformed.expect b/pkg/front_end/testcases/macros/class_members.dart.weak.transformed.expect index 52ceeba..c177741 100644 --- a/pkg/front_end/testcases/macros/class_members.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/macros/class_members.dart.weak.transformed.expect
@@ -3,10 +3,10 @@ // Problems in library: // // pkg/front_end/testcases/macros/class_members_lib.dart:9:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void existingMethod() { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:8:8: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:10:8: Context: This is the existing member. // void existingMethod() { // ^^^^^^^^^^^^^^ // @@ -15,11 +15,24 @@ // augment void orphanedMethod() { // ^^^^^^^^^^^^^^ // +// pkg/front_end/testcases/macros/class_members_lib.dart:33:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:22:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:39:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// // pkg/front_end/testcases/macros/class_members_lib.dart:21:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. -// Try changing the name to an existing member or adding an 'augment' modifier. +// Try changing the name of the member or adding an 'augment' modifier. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ -// pkg/front_end/testcases/macros/class_members.dart:14:12: Context: This is the existing member. +// pkg/front_end/testcases/macros/class_members.dart:16:12: Context: This is the existing member. // void set existingSetter(_) { // ^^^^^^^^^^^^^^ // @@ -28,25 +41,119 @@ // augment void set orphanedSetter(_) { // ^^^^^^^^^^^^^^ // -// pkg/front_end/testcases/macros/class_members.dart:22:5: Error: The method 'orphanedMethod' isn't defined for the class 'Class'. -// - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. -// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. -// c.orphanedMethod(); -// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_lib.dart:45:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members.dart:28:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ // -// pkg/front_end/testcases/macros/class_members.dart:23:5: Error: The setter 'orphanedSetter' isn't defined for the class 'Class'. -// - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// pkg/front_end/testcases/macros/class_members_lib.dart:51:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:60:8: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:8:8: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:66:16: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:84:15: Error: Member 'staticExistingMethod' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:20:15: Context: This is the existing member. +// static void staticExistingMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:90:23: Error: Augmentation member 'staticOrphanedMethod' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void staticOrphanedMethod() { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:72:12: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:14:12: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:78:20: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:96:19: Error: Member 'staticExistingSetter' conflicts with an existing member of the same name in the augmented class. +// Try changing the name of the member or adding an 'augment' modifier. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/class_members_part.dart:26:19: Context: This is the existing member. +// static void set staticExistingSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members_lib.dart:102:27: Error: Augmentation member 'staticOrphanedSetter' doesn't match a member in the augmented class. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment static void set staticOrphanedSetter(_) { +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:40:10: Error: Member not found: 'Class1.staticOrphanedMethod'. +// Class1.staticOrphanedMethod(); +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:41:10: Error: Setter not found: 'staticOrphanedSetter'. +// Class1.staticOrphanedSetter = 0; +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:42:10: Error: Member not found: 'Class2.staticOrphanedMethod'. +// Class2.staticOrphanedMethod(); +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:43:10: Error: Setter not found: 'staticOrphanedSetter'. +// Class2.staticOrphanedSetter = 0; +// ^^^^^^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:36:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class1'. +// - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. +// c1.orphanedMethod(); +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:37:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class1'. +// - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. // Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. -// c.orphanedSetter = 0; -// ^^^^^^^^^^^^^^ +// c1.orphanedSetter = 0; +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:38:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class2'. +// - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. +// c2.orphanedMethod(); +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/class_members.dart:39:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class2'. +// - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +// Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. +// c2.orphanedSetter = 0; +// ^^^^^^^^^^^^^^ // import self as self; import "dart:core" as core; import "org-dartlang-testcase:///class_members.dart"; -class Class extends core::Object { - synthetic constructor •() → self::Class +part class_members_part.dart; +class Class1 extends core::Object { + synthetic constructor •() → self::Class1 : super core::Object::•() ; method existingMethod() → void { @@ -61,6 +168,18 @@ set /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedSetter(dynamic _) → void { core::print("augmentedSetter"); } + static method staticExistingMethod() → void { + core::print("staticExistingMethod-origin"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedMethod() → void { + core::print("staticAugmentedMethod"); + } + static set staticExistingSetter(dynamic _) → void { + core::print("staticExistingSetter-origin"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedSetter(dynamic _) → void { + core::print("staticAugmentedSetter"); + } method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void { core::print("injectedMethod"); } @@ -73,39 +192,180 @@ set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void { core::print("orphanedSetter"); } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void { + core::print("staticExistingMethod-duplicate"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void { + core::print("staticInjectedMethod"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void { + core::print("staticOrphanedMethod"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void { + core::print("staticExistingSetter-duplicate"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void { + core::print("staticInjectedSetter"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void { + core::print("staticOrphanedSetter"); + } } -static method test(self::Class c) → dynamic { - invalid-expression "pkg/front_end/testcases/macros/class_members.dart:22:5: Error: The method 'orphanedMethod' isn't defined for the class 'Class'. - - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. +class Class2 extends core::Object { // from org-dartlang-testcase:///class_members_part.dart + synthetic constructor •() → self::Class2 + : super core::Object::•() + ; + method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod() → void { + core::print("injectedMethod"); + } + method /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedMethod() → void { + core::print("orphanedMethod"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ injectedSetter(dynamic _) → void { + core::print("injectedSetter"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ orphanedSetter(dynamic _) → void { + core::print("orphanedSetter"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingMethod#1() → void { + core::print("staticExistingMethod-duplicate"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedMethod() → void { + core::print("staticInjectedMethod"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedMethod() → void { + core::print("staticOrphanedMethod"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticExistingSetter#1(dynamic _) → void { + core::print("staticExistingSetter-duplicate"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticInjectedSetter(dynamic _) → void { + core::print("staticInjectedSetter"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticOrphanedSetter(dynamic _) → void { + core::print("staticOrphanedSetter"); + } + method existingMethod() → void { + core::print("existingMethod-origin"); + } + method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedMethod() → void { + core::print("augmentedMethod"); + } + set existingSetter(dynamic _) → void { + core::print("existingSetter-origin"); + } + set /* from org-dartlang-testcase:///class_members_lib.dart */ augmentedSetter(dynamic _) → void { + core::print("augmentedSetter"); + } + static method staticExistingMethod() → void { + core::print("staticExistingMethod-origin"); + } + static method /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedMethod() → void { + core::print("staticAugmentedMethod"); + } + static set staticExistingSetter(dynamic _) → void { + core::print("staticExistingSetter-origin"); + } + static set /* from org-dartlang-testcase:///class_members_lib.dart */ staticAugmentedSetter(dynamic _) → void { + core::print("staticAugmentedSetter"); + } +} +static method test(self::Class1 c1, self::Class2 c2) → dynamic { + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:36:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class1'. + - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. - c.orphanedMethod(); - ^^^^^^^^^^^^^^" in c{<unresolved>}.orphanedMethod(); - invalid-expression "pkg/front_end/testcases/macros/class_members.dart:23:5: Error: The setter 'orphanedSetter' isn't defined for the class 'Class'. - - 'Class' is from 'pkg/front_end/testcases/macros/class_members.dart'. + c1.orphanedMethod(); + ^^^^^^^^^^^^^^" in c1{<unresolved>}.orphanedMethod(); + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:37:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class1'. + - 'Class1' is from 'pkg/front_end/testcases/macros/class_members.dart'. Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. - c.orphanedSetter = 0; - ^^^^^^^^^^^^^^" in c{<unresolved>}.orphanedSetter = 0; + c1.orphanedSetter = 0; + ^^^^^^^^^^^^^^" in c1{<unresolved>}.orphanedSetter = 0; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:38:6: Error: The method 'orphanedMethod' isn't defined for the class 'Class2'. + - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +Try correcting the name to the name of an existing method, or defining a method named 'orphanedMethod'. + c2.orphanedMethod(); + ^^^^^^^^^^^^^^" in c2{<unresolved>}.orphanedMethod(); + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:39:6: Error: The setter 'orphanedSetter' isn't defined for the class 'Class2'. + - 'Class2' is from 'pkg/front_end/testcases/macros/class_members.dart'. +Try correcting the name to the name of an existing setter, or defining a setter or field named 'orphanedSetter'. + c2.orphanedSetter = 0; + ^^^^^^^^^^^^^^" in c2{<unresolved>}.orphanedSetter = 0; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:40:10: Error: Member not found: 'Class1.staticOrphanedMethod'. + Class1.staticOrphanedMethod(); + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:41:10: Error: Setter not found: 'staticOrphanedSetter'. + Class1.staticOrphanedSetter = 0; + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:42:10: Error: Member not found: 'Class2.staticOrphanedMethod'. + Class2.staticOrphanedMethod(); + ^^^^^^^^^^^^^^^^^^^^"; + invalid-expression "pkg/front_end/testcases/macros/class_members.dart:43:10: Error: Setter not found: 'staticOrphanedSetter'. + Class2.staticOrphanedSetter = 0; + ^^^^^^^^^^^^^^^^^^^^"; } static method main() → dynamic { - self::Class c = new self::Class::•(); - c.{self::Class::augmentedMethod}(){() → void}; - c.{self::Class::injectedMethod}(){() → void}; - c.{self::Class::existingMethod}(){() → void}; - c.{self::Class::augmentedSetter} = 0; - c.{self::Class::injectedSetter} = 0; - c.{self::Class::existingSetter} = 0; - self::injectedMethod(c); + self::Class1 c1 = new self::Class1::•(); + c1.{self::Class1::augmentedMethod}(){() → void}; + c1.{self::Class1::injectedMethod}(){() → void}; + c1.{self::Class1::existingMethod}(){() → void}; + self::Class1::staticAugmentedMethod(); + self::Class1::staticInjectedMethod(); + self::Class1::staticExistingMethod(); + c1.{self::Class1::augmentedSetter} = 0; + c1.{self::Class1::injectedSetter} = 0; + c1.{self::Class1::existingSetter} = 0; + self::Class1::staticAugmentedSetter = 0; + self::Class1::staticInjectedSetter = 0; + self::Class1::staticExistingSetter = 0; + self::Class2 c2 = new self::Class2::•(); + c2.{self::Class2::augmentedMethod}(){() → void}; + c2.{self::Class2::injectedMethod}(){() → void}; + c2.{self::Class2::existingMethod}(){() → void}; + self::Class2::staticAugmentedMethod(); + self::Class2::staticInjectedMethod(); + self::Class2::staticExistingMethod(); + c2.{self::Class2::augmentedSetter} = 0; + c2.{self::Class2::injectedSetter} = 0; + c2.{self::Class2::existingSetter} = 0; + self::Class2::staticAugmentedSetter = 0; + self::Class2::staticInjectedSetter = 0; + self::Class2::staticExistingSetter = 0; + self::injectedMethod(c1, c2); } -static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class c) → void { - c.{self::Class::orphanedMethod}(){() → void}; - c.{self::Class::orphanedMethod}(){() → void}; - c.{self::Class::orphanedSetter} = 0; +static method /* from org-dartlang-testcase:///class_members_lib.dart */ augmentTest(self::Class1 c1, self::Class2 c2) → void { + c1.{self::Class1::orphanedMethod}(){() → void}; + c1.{self::Class1::orphanedSetter} = 0; + c2.{self::Class2::orphanedMethod}(){() → void}; + c2.{self::Class2::orphanedSetter} = 0; + self::Class1::staticOrphanedMethod(); + self::Class1::staticOrphanedSetter = 0; + self::Class2::staticOrphanedMethod(); + self::Class2::staticOrphanedSetter = 0; } -static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class c) → void { - c.{self::Class::augmentedMethod}(){() → void}; - c.{self::Class::injectedMethod}(){() → void}; - c.{self::Class::existingMethod}(){() → void}; - c.{self::Class::augmentedSetter} = 0; - c.{self::Class::injectedSetter} = 0; - c.{self::Class::existingSetter} = 0; +static method /* from org-dartlang-testcase:///class_members_lib.dart */ injectedMethod(self::Class1 c1, self::Class2 c2) → void { + c1.{self::Class1::augmentedMethod}(){() → void}; + c1.{self::Class1::injectedMethod}(){() → void}; + c1.{self::Class1::existingMethod}(){() → void}; + self::Class1::staticAugmentedMethod(); + self::Class1::staticInjectedMethod(); + self::Class1::staticExistingMethod#1(); + c1.{self::Class1::augmentedSetter} = 0; + c1.{self::Class1::injectedSetter} = 0; + c1.{self::Class1::existingSetter} = 0; + self::Class1::staticAugmentedSetter = 0; + self::Class1::staticInjectedSetter = 0; + self::Class1::staticExistingSetter#1 = 0; + c2.{self::Class2::augmentedMethod}(){() → void}; + c2.{self::Class2::injectedMethod}(){() → void}; + c2.{self::Class2::existingMethod}(){() → void}; + self::Class2::staticAugmentedMethod(); + self::Class2::staticInjectedMethod(); + self::Class2::staticExistingMethod#1(); + c2.{self::Class2::augmentedSetter} = 0; + c2.{self::Class2::injectedSetter} = 0; + c2.{self::Class2::existingSetter} = 0; + self::Class2::staticAugmentedSetter = 0; + self::Class2::staticInjectedSetter = 0; + self::Class2::staticExistingSetter#1 = 0; }
diff --git a/pkg/front_end/testcases/macros/class_members_lib.dart b/pkg/front_end/testcases/macros/class_members_lib.dart index a5952d5..5cf66a0 100644 --- a/pkg/front_end/testcases/macros/class_members_lib.dart +++ b/pkg/front_end/testcases/macros/class_members_lib.dart
@@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -augment class Class { +augment class Class1 { augment void augmentedMethod() { print('augmentedMethod'); } @@ -27,20 +27,120 @@ augment void set orphanedSetter(_) { print('orphanedSetter'); } + augment static void staticAugmentedMethod() { + print('staticAugmentedMethod'); + } + static void staticExistingMethod() { + print('staticExistingMethod-duplicate'); + } + static void staticInjectedMethod() { + print('staticInjectedMethod'); + } + augment static void staticOrphanedMethod() { + print('staticOrphanedMethod'); + } + augment static void set staticAugmentedSetter(_) { + print('staticAugmentedSetter'); + } + static void set staticExistingSetter(_) { + print('staticExistingSetter-duplicate'); + } + static void set staticInjectedSetter(_) { + print('staticInjectedSetter'); + } + augment static void set staticOrphanedSetter(_) { + print('staticOrphanedSetter'); + } } -void augmentTest(Class c) { - c.orphanedMethod(); - c.orphanedMethod(); - c.orphanedSetter = 0; +augment class Class2 { + augment void augmentedMethod() { + print('augmentedMethod'); + } + void existingMethod() { + print('existingMethod-duplicate'); + } + void injectedMethod() { + print('injectedMethod'); + } + augment void orphanedMethod() { + print('orphanedMethod'); + } + augment void set augmentedSetter(_) { + print('augmentedSetter'); + } + void set existingSetter(_) { + print('existingSetter-duplicate'); + } + void set injectedSetter(_) { + print('injectedSetter'); + } + augment void set orphanedSetter(_) { + print('orphanedSetter'); + } + augment static void staticAugmentedMethod() { + print('staticAugmentedMethod'); + } + static void staticExistingMethod() { + print('staticExistingMethod-duplicate'); + } + static void staticInjectedMethod() { + print('staticInjectedMethod'); + } + augment static void staticOrphanedMethod() { + print('staticOrphanedMethod'); + } + augment static void set staticAugmentedSetter(_) { + print('staticAugmentedSetter'); + } + static void set staticExistingSetter(_) { + print('staticExistingSetter-duplicate'); + } + static void set staticInjectedSetter(_) { + print('staticInjectedSetter'); + } + augment static void set staticOrphanedSetter(_) { + print('staticOrphanedSetter'); + } } -void injectedMethod(Class c) { - c.augmentedMethod(); - c.injectedMethod(); - c.existingMethod(); +void augmentTest(Class1 c1, Class2 c2) { + c1.orphanedMethod(); + c1.orphanedSetter = 0; + c2.orphanedMethod(); + c2.orphanedSetter = 0; + Class1.staticOrphanedMethod(); + Class1.staticOrphanedSetter = 0; + Class2.staticOrphanedMethod(); + Class2.staticOrphanedSetter = 0; +} - c.augmentedSetter = 0; - c.injectedSetter = 0; - c.existingSetter = 0; +void injectedMethod(Class1 c1, Class2 c2) { + c1.augmentedMethod(); + c1.injectedMethod(); + c1.existingMethod(); + Class1.staticAugmentedMethod(); + Class1.staticInjectedMethod(); + Class1.staticExistingMethod(); + + c1.augmentedSetter = 0; + c1.injectedSetter = 0; + c1.existingSetter = 0; + Class1.staticAugmentedSetter = 0; + Class1.staticInjectedSetter = 0; + Class1.staticExistingSetter = 0; + + c2.augmentedMethod(); + c2.injectedMethod(); + c2.existingMethod(); + Class2.staticAugmentedMethod(); + Class2.staticInjectedMethod(); + Class2.staticExistingMethod(); + + c2.augmentedSetter = 0; + c2.injectedSetter = 0; + c2.existingSetter = 0; + Class2.staticAugmentedSetter = 0; + Class2.staticInjectedSetter = 0; + Class2.staticExistingSetter = 0; } \ No newline at end of file
diff --git a/pkg/front_end/testcases/macros/class_members_part.dart b/pkg/front_end/testcases/macros/class_members_part.dart new file mode 100644 index 0000000..482e31f --- /dev/null +++ b/pkg/front_end/testcases/macros/class_members_part.dart
@@ -0,0 +1,31 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +part of 'class_members.dart'; + +class Class2 { + void existingMethod() { + print('existingMethod-origin'); + } + + external void augmentedMethod(); + + void set existingSetter(_) { + print('existingSetter-origin'); + } + + external void set augmentedSetter(_); + + static void staticExistingMethod() { + print('staticExistingMethod-origin'); + } + + external static void staticAugmentedMethod(); + + static void set staticExistingSetter(_) { + print('staticExistingSetter-origin'); + } + + external static void set staticAugmentedSetter(_); +}
diff --git a/pkg/front_end/testcases/macros/library_members.dart b/pkg/front_end/testcases/macros/library_members.dart new file mode 100644 index 0000000..dbc9632 --- /dev/null +++ b/pkg/front_end/testcases/macros/library_members.dart
@@ -0,0 +1,47 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import augment 'library_members_lib.dart'; + +void existingMethod() { + print('existingMethod-origin'); +} + +external void augmentedMethod(); + +void set existingSetter(_) { + print('existingSetter-origin'); +} + +external void set augmentedSetter(_); + +class ExistingClass {} +class AugmentedClass {} + +class existingMethod2 {} +void ExistingClass2() {} + +test() { + orphanedMethod(); + orphanedSetter = 0; + new OrphanedClass(); +} + +main() { + augmentedMethod(); + injectedMethod(); + existingMethod(); + ExistingClass2(); + + augmentedSetter = 0; + injectedSetter = 0; + existingSetter = 0; + + new ExistingClass(); + new AugmentedClass(); + new InjectedClass(); + new existingMethod2(); + + augmentMain(); +}
diff --git a/pkg/front_end/testcases/macros/library_members.dart.strong.expect b/pkg/front_end/testcases/macros/library_members.dart.strong.expect new file mode 100644 index 0000000..4b6c6b6 --- /dev/null +++ b/pkg/front_end/testcases/macros/library_members.dart.strong.expect
@@ -0,0 +1,169 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/library_members_lib.dart:8:6: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:7:6: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:11:6: Error: Declaration 'existingMethod2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// void existingMethod2() { +// ^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:22:7: Context: This is the existing member. +// class existingMethod2 {} +// ^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:17:14: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:33:7: Error: Class 'ExistingClass' conflicts with an existing class of the same name in the augmented library. +// Try changing the name of the class or adding an 'augment' modifier. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:19:7: Context: This is the existing class. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:34:7: Error: Declaration 'ExistingClass2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// class ExistingClass2 {} +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:23:6: Context: This is the existing member. +// void ExistingClass2() {} +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:37:15: Error: Augmentation class 'OrphanedClass' doesn't match a class in the augmented library. +// Try changing the name to an existing class or removing the 'augment' modifier. +// augment class OrphanedClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:23:10: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:13:10: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:29:18: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///library_members.dart"; + +class ExistingClass#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass#0#1 + : super core::Object::•() + ; +} +class ExistingClass2#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass2#0#1 + : super core::Object::•() + ; +} +class InjectedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::InjectedClass + : super core::Object::•() + ; +} +class OrphanedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::OrphanedClass + : super core::Object::•() + ; +} +class ExistingClass extends core::Object { + synthetic constructor •() → self::ExistingClass + : super core::Object::•() + ; +} +class AugmentedClass extends core::Object { + synthetic constructor •() → self::AugmentedClass + : super core::Object::•() + ; +} +class existingMethod2 extends core::Object { + synthetic constructor •() → self::existingMethod2 + : super core::Object::•() + ; +} +static method existingMethod() → void { + core::print("existingMethod-origin"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentedMethod() → void { + core::print("augmentedMethod"); +} +static set existingSetter(dynamic _) → void { + core::print("existingSetter-origin"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ augmentedSetter(dynamic _) → void { + core::print("augmentedSetter"); +} +static method ExistingClass2() → void {} +static method test() → dynamic { + self::orphanedMethod(); + self::orphanedSetter = 0; + new self::OrphanedClass::•(); +} +static method main() → dynamic { + self::augmentedMethod(); + self::injectedMethod(); + self::existingMethod(); + self::ExistingClass2(); + self::augmentedSetter = 0; + self::injectedSetter = 0; + self::existingSetter = 0; + new self::ExistingClass::•(); + new self::AugmentedClass::•(); + new self::InjectedClass::•(); + new self::existingMethod2::•(); + self::augmentMain(); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod#1() → void { + core::print("existingMethod-duplicate"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod2#1() → void { + core::print("existingMethod2-duplicate"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ injectedMethod() → void { + core::print("injectedMethod"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedMethod() → void { + core::print("orphanedMethod"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ existingSetter#1(dynamic _) → void { + core::print("existingSetter-duplicate"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ injectedSetter(dynamic _) → void { + core::print("injectedSetter"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedSetter(dynamic _) → void { + core::print("orphanedSetter"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentTest() → void { + self::orphanedMethod(); + self::orphanedMethod(); + self::orphanedSetter = 0; + new self::OrphanedClass::•(); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentMain() → void { + self::augmentedMethod(); + self::injectedMethod(); + self::existingMethod#1(); + self::augmentedSetter = 0; + self::injectedSetter = 0; + self::existingSetter#1 = 0; + new self::ExistingClass#0#1::•(); + new self::AugmentedClass::•(); + new self::InjectedClass::•(); +}
diff --git a/pkg/front_end/testcases/macros/library_members.dart.strong.transformed.expect b/pkg/front_end/testcases/macros/library_members.dart.strong.transformed.expect new file mode 100644 index 0000000..4b6c6b6 --- /dev/null +++ b/pkg/front_end/testcases/macros/library_members.dart.strong.transformed.expect
@@ -0,0 +1,169 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/library_members_lib.dart:8:6: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:7:6: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:11:6: Error: Declaration 'existingMethod2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// void existingMethod2() { +// ^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:22:7: Context: This is the existing member. +// class existingMethod2 {} +// ^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:17:14: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:33:7: Error: Class 'ExistingClass' conflicts with an existing class of the same name in the augmented library. +// Try changing the name of the class or adding an 'augment' modifier. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:19:7: Context: This is the existing class. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:34:7: Error: Declaration 'ExistingClass2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// class ExistingClass2 {} +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:23:6: Context: This is the existing member. +// void ExistingClass2() {} +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:37:15: Error: Augmentation class 'OrphanedClass' doesn't match a class in the augmented library. +// Try changing the name to an existing class or removing the 'augment' modifier. +// augment class OrphanedClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:23:10: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:13:10: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:29:18: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///library_members.dart"; + +class ExistingClass#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass#0#1 + : super core::Object::•() + ; +} +class ExistingClass2#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass2#0#1 + : super core::Object::•() + ; +} +class InjectedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::InjectedClass + : super core::Object::•() + ; +} +class OrphanedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::OrphanedClass + : super core::Object::•() + ; +} +class ExistingClass extends core::Object { + synthetic constructor •() → self::ExistingClass + : super core::Object::•() + ; +} +class AugmentedClass extends core::Object { + synthetic constructor •() → self::AugmentedClass + : super core::Object::•() + ; +} +class existingMethod2 extends core::Object { + synthetic constructor •() → self::existingMethod2 + : super core::Object::•() + ; +} +static method existingMethod() → void { + core::print("existingMethod-origin"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentedMethod() → void { + core::print("augmentedMethod"); +} +static set existingSetter(dynamic _) → void { + core::print("existingSetter-origin"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ augmentedSetter(dynamic _) → void { + core::print("augmentedSetter"); +} +static method ExistingClass2() → void {} +static method test() → dynamic { + self::orphanedMethod(); + self::orphanedSetter = 0; + new self::OrphanedClass::•(); +} +static method main() → dynamic { + self::augmentedMethod(); + self::injectedMethod(); + self::existingMethod(); + self::ExistingClass2(); + self::augmentedSetter = 0; + self::injectedSetter = 0; + self::existingSetter = 0; + new self::ExistingClass::•(); + new self::AugmentedClass::•(); + new self::InjectedClass::•(); + new self::existingMethod2::•(); + self::augmentMain(); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod#1() → void { + core::print("existingMethod-duplicate"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod2#1() → void { + core::print("existingMethod2-duplicate"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ injectedMethod() → void { + core::print("injectedMethod"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedMethod() → void { + core::print("orphanedMethod"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ existingSetter#1(dynamic _) → void { + core::print("existingSetter-duplicate"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ injectedSetter(dynamic _) → void { + core::print("injectedSetter"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedSetter(dynamic _) → void { + core::print("orphanedSetter"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentTest() → void { + self::orphanedMethod(); + self::orphanedMethod(); + self::orphanedSetter = 0; + new self::OrphanedClass::•(); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentMain() → void { + self::augmentedMethod(); + self::injectedMethod(); + self::existingMethod#1(); + self::augmentedSetter = 0; + self::injectedSetter = 0; + self::existingSetter#1 = 0; + new self::ExistingClass#0#1::•(); + new self::AugmentedClass::•(); + new self::InjectedClass::•(); +}
diff --git a/pkg/front_end/testcases/macros/library_members.dart.textual_outline.expect b/pkg/front_end/testcases/macros/library_members.dart.textual_outline.expect new file mode 100644 index 0000000..2fcb87e --- /dev/null +++ b/pkg/front_end/testcases/macros/library_members.dart.textual_outline.expect
@@ -0,0 +1,11 @@ +import augment 'library_members_lib.dart'; +void existingMethod() {} +external void augmentedMethod(); +void set existingSetter(_) {} +external void set augmentedSetter(_); +class ExistingClass {} +class AugmentedClass {} +class existingMethod2 {} +void ExistingClass2() {} +test() {} +main() {}
diff --git a/pkg/front_end/testcases/macros/library_members.dart.weak.expect b/pkg/front_end/testcases/macros/library_members.dart.weak.expect new file mode 100644 index 0000000..4b6c6b6 --- /dev/null +++ b/pkg/front_end/testcases/macros/library_members.dart.weak.expect
@@ -0,0 +1,169 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/library_members_lib.dart:8:6: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:7:6: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:11:6: Error: Declaration 'existingMethod2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// void existingMethod2() { +// ^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:22:7: Context: This is the existing member. +// class existingMethod2 {} +// ^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:17:14: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:33:7: Error: Class 'ExistingClass' conflicts with an existing class of the same name in the augmented library. +// Try changing the name of the class or adding an 'augment' modifier. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:19:7: Context: This is the existing class. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:34:7: Error: Declaration 'ExistingClass2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// class ExistingClass2 {} +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:23:6: Context: This is the existing member. +// void ExistingClass2() {} +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:37:15: Error: Augmentation class 'OrphanedClass' doesn't match a class in the augmented library. +// Try changing the name to an existing class or removing the 'augment' modifier. +// augment class OrphanedClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:23:10: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:13:10: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:29:18: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///library_members.dart"; + +class ExistingClass#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass#0#1 + : super core::Object::•() + ; +} +class ExistingClass2#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass2#0#1 + : super core::Object::•() + ; +} +class InjectedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::InjectedClass + : super core::Object::•() + ; +} +class OrphanedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::OrphanedClass + : super core::Object::•() + ; +} +class ExistingClass extends core::Object { + synthetic constructor •() → self::ExistingClass + : super core::Object::•() + ; +} +class AugmentedClass extends core::Object { + synthetic constructor •() → self::AugmentedClass + : super core::Object::•() + ; +} +class existingMethod2 extends core::Object { + synthetic constructor •() → self::existingMethod2 + : super core::Object::•() + ; +} +static method existingMethod() → void { + core::print("existingMethod-origin"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentedMethod() → void { + core::print("augmentedMethod"); +} +static set existingSetter(dynamic _) → void { + core::print("existingSetter-origin"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ augmentedSetter(dynamic _) → void { + core::print("augmentedSetter"); +} +static method ExistingClass2() → void {} +static method test() → dynamic { + self::orphanedMethod(); + self::orphanedSetter = 0; + new self::OrphanedClass::•(); +} +static method main() → dynamic { + self::augmentedMethod(); + self::injectedMethod(); + self::existingMethod(); + self::ExistingClass2(); + self::augmentedSetter = 0; + self::injectedSetter = 0; + self::existingSetter = 0; + new self::ExistingClass::•(); + new self::AugmentedClass::•(); + new self::InjectedClass::•(); + new self::existingMethod2::•(); + self::augmentMain(); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod#1() → void { + core::print("existingMethod-duplicate"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod2#1() → void { + core::print("existingMethod2-duplicate"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ injectedMethod() → void { + core::print("injectedMethod"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedMethod() → void { + core::print("orphanedMethod"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ existingSetter#1(dynamic _) → void { + core::print("existingSetter-duplicate"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ injectedSetter(dynamic _) → void { + core::print("injectedSetter"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedSetter(dynamic _) → void { + core::print("orphanedSetter"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentTest() → void { + self::orphanedMethod(); + self::orphanedMethod(); + self::orphanedSetter = 0; + new self::OrphanedClass::•(); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentMain() → void { + self::augmentedMethod(); + self::injectedMethod(); + self::existingMethod#1(); + self::augmentedSetter = 0; + self::injectedSetter = 0; + self::existingSetter#1 = 0; + new self::ExistingClass#0#1::•(); + new self::AugmentedClass::•(); + new self::InjectedClass::•(); +}
diff --git a/pkg/front_end/testcases/macros/library_members.dart.weak.modular.expect b/pkg/front_end/testcases/macros/library_members.dart.weak.modular.expect new file mode 100644 index 0000000..4b6c6b6 --- /dev/null +++ b/pkg/front_end/testcases/macros/library_members.dart.weak.modular.expect
@@ -0,0 +1,169 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/library_members_lib.dart:8:6: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:7:6: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:11:6: Error: Declaration 'existingMethod2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// void existingMethod2() { +// ^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:22:7: Context: This is the existing member. +// class existingMethod2 {} +// ^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:17:14: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:33:7: Error: Class 'ExistingClass' conflicts with an existing class of the same name in the augmented library. +// Try changing the name of the class or adding an 'augment' modifier. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:19:7: Context: This is the existing class. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:34:7: Error: Declaration 'ExistingClass2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// class ExistingClass2 {} +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:23:6: Context: This is the existing member. +// void ExistingClass2() {} +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:37:15: Error: Augmentation class 'OrphanedClass' doesn't match a class in the augmented library. +// Try changing the name to an existing class or removing the 'augment' modifier. +// augment class OrphanedClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:23:10: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:13:10: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:29:18: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///library_members.dart"; + +class ExistingClass#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass#0#1 + : super core::Object::•() + ; +} +class ExistingClass2#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass2#0#1 + : super core::Object::•() + ; +} +class InjectedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::InjectedClass + : super core::Object::•() + ; +} +class OrphanedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::OrphanedClass + : super core::Object::•() + ; +} +class ExistingClass extends core::Object { + synthetic constructor •() → self::ExistingClass + : super core::Object::•() + ; +} +class AugmentedClass extends core::Object { + synthetic constructor •() → self::AugmentedClass + : super core::Object::•() + ; +} +class existingMethod2 extends core::Object { + synthetic constructor •() → self::existingMethod2 + : super core::Object::•() + ; +} +static method existingMethod() → void { + core::print("existingMethod-origin"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentedMethod() → void { + core::print("augmentedMethod"); +} +static set existingSetter(dynamic _) → void { + core::print("existingSetter-origin"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ augmentedSetter(dynamic _) → void { + core::print("augmentedSetter"); +} +static method ExistingClass2() → void {} +static method test() → dynamic { + self::orphanedMethod(); + self::orphanedSetter = 0; + new self::OrphanedClass::•(); +} +static method main() → dynamic { + self::augmentedMethod(); + self::injectedMethod(); + self::existingMethod(); + self::ExistingClass2(); + self::augmentedSetter = 0; + self::injectedSetter = 0; + self::existingSetter = 0; + new self::ExistingClass::•(); + new self::AugmentedClass::•(); + new self::InjectedClass::•(); + new self::existingMethod2::•(); + self::augmentMain(); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod#1() → void { + core::print("existingMethod-duplicate"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod2#1() → void { + core::print("existingMethod2-duplicate"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ injectedMethod() → void { + core::print("injectedMethod"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedMethod() → void { + core::print("orphanedMethod"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ existingSetter#1(dynamic _) → void { + core::print("existingSetter-duplicate"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ injectedSetter(dynamic _) → void { + core::print("injectedSetter"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedSetter(dynamic _) → void { + core::print("orphanedSetter"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentTest() → void { + self::orphanedMethod(); + self::orphanedMethod(); + self::orphanedSetter = 0; + new self::OrphanedClass::•(); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentMain() → void { + self::augmentedMethod(); + self::injectedMethod(); + self::existingMethod#1(); + self::augmentedSetter = 0; + self::injectedSetter = 0; + self::existingSetter#1 = 0; + new self::ExistingClass#0#1::•(); + new self::AugmentedClass::•(); + new self::InjectedClass::•(); +}
diff --git a/pkg/front_end/testcases/macros/library_members.dart.weak.outline.expect b/pkg/front_end/testcases/macros/library_members.dart.weak.outline.expect new file mode 100644 index 0000000..f4a0714 --- /dev/null +++ b/pkg/front_end/testcases/macros/library_members.dart.weak.outline.expect
@@ -0,0 +1,122 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/library_members_lib.dart:8:6: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:7:6: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:11:6: Error: Declaration 'existingMethod2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// void existingMethod2() { +// ^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:22:7: Context: This is the existing member. +// class existingMethod2 {} +// ^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:17:14: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:33:7: Error: Class 'ExistingClass' conflicts with an existing class of the same name in the augmented library. +// Try changing the name of the class or adding an 'augment' modifier. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:19:7: Context: This is the existing class. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:34:7: Error: Declaration 'ExistingClass2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// class ExistingClass2 {} +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:23:6: Context: This is the existing member. +// void ExistingClass2() {} +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:37:15: Error: Augmentation class 'OrphanedClass' doesn't match a class in the augmented library. +// Try changing the name to an existing class or removing the 'augment' modifier. +// augment class OrphanedClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:23:10: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:13:10: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:29:18: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///library_members.dart"; + +class ExistingClass#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass#0#1 + ; +} +class ExistingClass2#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass2#0#1 + ; +} +class InjectedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::InjectedClass + ; +} +class OrphanedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::OrphanedClass + ; +} +class ExistingClass extends core::Object { + synthetic constructor •() → self::ExistingClass + ; +} +class AugmentedClass extends core::Object { + synthetic constructor •() → self::AugmentedClass + ; +} +class existingMethod2 extends core::Object { + synthetic constructor •() → self::existingMethod2 + ; +} +static method existingMethod() → void + ; +external static method augmentedMethod() → void; +static set existingSetter(dynamic _) → void + ; +external static set augmentedSetter(dynamic _) → void; +static method ExistingClass2() → void + ; +static method test() → dynamic + ; +static method main() → dynamic + ; +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod#1() → void + ; +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod2#1() → void + ; +static method /* from org-dartlang-testcase:///library_members_lib.dart */ injectedMethod() → void + ; +static method /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedMethod() → void + ; +static set /* from org-dartlang-testcase:///library_members_lib.dart */ existingSetter#1(dynamic _) → void + ; +static set /* from org-dartlang-testcase:///library_members_lib.dart */ injectedSetter(dynamic _) → void + ; +static set /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedSetter(dynamic _) → void + ; +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentTest() → void + ; +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentMain() → void + ;
diff --git a/pkg/front_end/testcases/macros/library_members.dart.weak.transformed.expect b/pkg/front_end/testcases/macros/library_members.dart.weak.transformed.expect new file mode 100644 index 0000000..4b6c6b6 --- /dev/null +++ b/pkg/front_end/testcases/macros/library_members.dart.weak.transformed.expect
@@ -0,0 +1,169 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/library_members_lib.dart:8:6: Error: Member 'existingMethod' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:7:6: Context: This is the existing member. +// void existingMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:11:6: Error: Declaration 'existingMethod2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// void existingMethod2() { +// ^^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:22:7: Context: This is the existing member. +// class existingMethod2 {} +// ^^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:17:14: Error: Augmentation member 'orphanedMethod' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void orphanedMethod() { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:33:7: Error: Class 'ExistingClass' conflicts with an existing class of the same name in the augmented library. +// Try changing the name of the class or adding an 'augment' modifier. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:19:7: Context: This is the existing class. +// class ExistingClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:34:7: Error: Declaration 'ExistingClass2' conflicts with an existing declaration of the same name in the augmented library. +// Try changing the name of the declaration. +// class ExistingClass2 {} +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:23:6: Context: This is the existing member. +// void ExistingClass2() {} +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:37:15: Error: Augmentation class 'OrphanedClass' doesn't match a class in the augmented library. +// Try changing the name to an existing class or removing the 'augment' modifier. +// augment class OrphanedClass {} +// ^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:23:10: Error: Member 'existingSetter' conflicts with an existing member of the same name in the augmented library. +// Try changing the name of the member or adding an 'augment' modifier. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// pkg/front_end/testcases/macros/library_members.dart:13:10: Context: This is the existing member. +// void set existingSetter(_) { +// ^^^^^^^^^^^^^^ +// +// pkg/front_end/testcases/macros/library_members_lib.dart:29:18: Error: Augmentation member 'orphanedSetter' doesn't match a member in the augmented library. +// Try changing the name to an existing member or removing the 'augment' modifier. +// augment void set orphanedSetter(_) { +// ^^^^^^^^^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///library_members.dart"; + +class ExistingClass#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass#0#1 + : super core::Object::•() + ; +} +class ExistingClass2#0#1 extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::ExistingClass2#0#1 + : super core::Object::•() + ; +} +class InjectedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::InjectedClass + : super core::Object::•() + ; +} +class OrphanedClass extends core::Object { // from org-dartlang-testcase:///library_members_lib.dart + synthetic constructor •() → self::OrphanedClass + : super core::Object::•() + ; +} +class ExistingClass extends core::Object { + synthetic constructor •() → self::ExistingClass + : super core::Object::•() + ; +} +class AugmentedClass extends core::Object { + synthetic constructor •() → self::AugmentedClass + : super core::Object::•() + ; +} +class existingMethod2 extends core::Object { + synthetic constructor •() → self::existingMethod2 + : super core::Object::•() + ; +} +static method existingMethod() → void { + core::print("existingMethod-origin"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentedMethod() → void { + core::print("augmentedMethod"); +} +static set existingSetter(dynamic _) → void { + core::print("existingSetter-origin"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ augmentedSetter(dynamic _) → void { + core::print("augmentedSetter"); +} +static method ExistingClass2() → void {} +static method test() → dynamic { + self::orphanedMethod(); + self::orphanedSetter = 0; + new self::OrphanedClass::•(); +} +static method main() → dynamic { + self::augmentedMethod(); + self::injectedMethod(); + self::existingMethod(); + self::ExistingClass2(); + self::augmentedSetter = 0; + self::injectedSetter = 0; + self::existingSetter = 0; + new self::ExistingClass::•(); + new self::AugmentedClass::•(); + new self::InjectedClass::•(); + new self::existingMethod2::•(); + self::augmentMain(); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod#1() → void { + core::print("existingMethod-duplicate"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ existingMethod2#1() → void { + core::print("existingMethod2-duplicate"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ injectedMethod() → void { + core::print("injectedMethod"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedMethod() → void { + core::print("orphanedMethod"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ existingSetter#1(dynamic _) → void { + core::print("existingSetter-duplicate"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ injectedSetter(dynamic _) → void { + core::print("injectedSetter"); +} +static set /* from org-dartlang-testcase:///library_members_lib.dart */ orphanedSetter(dynamic _) → void { + core::print("orphanedSetter"); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentTest() → void { + self::orphanedMethod(); + self::orphanedMethod(); + self::orphanedSetter = 0; + new self::OrphanedClass::•(); +} +static method /* from org-dartlang-testcase:///library_members_lib.dart */ augmentMain() → void { + self::augmentedMethod(); + self::injectedMethod(); + self::existingMethod#1(); + self::augmentedSetter = 0; + self::injectedSetter = 0; + self::existingSetter#1 = 0; + new self::ExistingClass#0#1::•(); + new self::AugmentedClass::•(); + new self::InjectedClass::•(); +}
diff --git a/pkg/front_end/testcases/macros/library_members_lib.dart b/pkg/front_end/testcases/macros/library_members_lib.dart new file mode 100644 index 0000000..0885c4d --- /dev/null +++ b/pkg/front_end/testcases/macros/library_members_lib.dart
@@ -0,0 +1,58 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +augment void augmentedMethod() { + print('augmentedMethod'); +} +void existingMethod() { + print('existingMethod-duplicate'); +} +void existingMethod2() { + print('existingMethod2-duplicate'); +} +void injectedMethod() { + print('injectedMethod'); +} +augment void orphanedMethod() { + print('orphanedMethod'); +} +augment void set augmentedSetter(_) { + print('augmentedSetter'); +} +void set existingSetter(_) { + print('existingSetter-duplicate'); +} +void set injectedSetter(_) { + print('injectedSetter'); +} +augment void set orphanedSetter(_) { + print('orphanedSetter'); +} + +class ExistingClass {} +class ExistingClass2 {} +augment class AugmentedClass {} +class InjectedClass {} +augment class OrphanedClass {} + +void augmentTest() { + orphanedMethod(); + orphanedMethod(); + orphanedSetter = 0; + new OrphanedClass(); +} + +void augmentMain() { + augmentedMethod(); + injectedMethod(); + existingMethod(); + + augmentedSetter = 0; + injectedSetter = 0; + existingSetter = 0; + + new ExistingClass(); + new AugmentedClass(); + new InjectedClass(); +} \ No newline at end of file
diff --git a/pkg/front_end/testcases/macros/part_import_augment.dart b/pkg/front_end/testcases/macros/part_import_augment.dart new file mode 100644 index 0000000..e204374 --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment.dart
@@ -0,0 +1,5 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +part 'part_import_augment_part.dart';
diff --git a/pkg/front_end/testcases/macros/part_import_augment.dart.strong.expect b/pkg/front_end/testcases/macros/part_import_augment.dart.strong.expect new file mode 100644 index 0000000..be5f74a --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment.dart.strong.expect
@@ -0,0 +1,28 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/part_import_augment_part.dart:7:1: Error: The part-of directive must be the only directive in a part. +// Try removing the other directives, or moving them to the library for which this is a part. +// import augment 'part_import_augment_lib.dart'; +// ^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///part_import_augment.dart"; + +part part_import_augment_part.dart; +class Class extends core::Object { // from org-dartlang-testcase:///part_import_augment_part.dart + synthetic constructor •() → self::Class + : super core::Object::•() + ; + method /* from org-dartlang-testcase:///part_import_augment_lib.dart */ method() → void {} + get /* from org-dartlang-testcase:///part_import_augment_lib.dart */ getter() → core::int + return 42; + set /* from org-dartlang-testcase:///part_import_augment_lib.dart */ setter(core::int value) → void {} +} +static method /* from org-dartlang-testcase:///part_import_augment_lib.dart */ method() → void {} +static get /* from org-dartlang-testcase:///part_import_augment_lib.dart */ getter() → core::int + return 42; +static set /* from org-dartlang-testcase:///part_import_augment_lib.dart */ setter(core::int value) → void {}
diff --git a/pkg/front_end/testcases/macros/part_import_augment.dart.strong.transformed.expect b/pkg/front_end/testcases/macros/part_import_augment.dart.strong.transformed.expect new file mode 100644 index 0000000..be5f74a --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment.dart.strong.transformed.expect
@@ -0,0 +1,28 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/part_import_augment_part.dart:7:1: Error: The part-of directive must be the only directive in a part. +// Try removing the other directives, or moving them to the library for which this is a part. +// import augment 'part_import_augment_lib.dart'; +// ^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///part_import_augment.dart"; + +part part_import_augment_part.dart; +class Class extends core::Object { // from org-dartlang-testcase:///part_import_augment_part.dart + synthetic constructor •() → self::Class + : super core::Object::•() + ; + method /* from org-dartlang-testcase:///part_import_augment_lib.dart */ method() → void {} + get /* from org-dartlang-testcase:///part_import_augment_lib.dart */ getter() → core::int + return 42; + set /* from org-dartlang-testcase:///part_import_augment_lib.dart */ setter(core::int value) → void {} +} +static method /* from org-dartlang-testcase:///part_import_augment_lib.dart */ method() → void {} +static get /* from org-dartlang-testcase:///part_import_augment_lib.dart */ getter() → core::int + return 42; +static set /* from org-dartlang-testcase:///part_import_augment_lib.dart */ setter(core::int value) → void {}
diff --git a/pkg/front_end/testcases/macros/part_import_augment.dart.textual_outline.expect b/pkg/front_end/testcases/macros/part_import_augment.dart.textual_outline.expect new file mode 100644 index 0000000..0567781 --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment.dart.textual_outline.expect
@@ -0,0 +1 @@ +part 'part_import_augment_part.dart';
diff --git a/pkg/front_end/testcases/macros/part_import_augment.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/macros/part_import_augment.dart.textual_outline_modelled.expect new file mode 100644 index 0000000..0567781 --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment.dart.textual_outline_modelled.expect
@@ -0,0 +1 @@ +part 'part_import_augment_part.dart';
diff --git a/pkg/front_end/testcases/macros/part_import_augment.dart.weak.expect b/pkg/front_end/testcases/macros/part_import_augment.dart.weak.expect new file mode 100644 index 0000000..be5f74a --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment.dart.weak.expect
@@ -0,0 +1,28 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/part_import_augment_part.dart:7:1: Error: The part-of directive must be the only directive in a part. +// Try removing the other directives, or moving them to the library for which this is a part. +// import augment 'part_import_augment_lib.dart'; +// ^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///part_import_augment.dart"; + +part part_import_augment_part.dart; +class Class extends core::Object { // from org-dartlang-testcase:///part_import_augment_part.dart + synthetic constructor •() → self::Class + : super core::Object::•() + ; + method /* from org-dartlang-testcase:///part_import_augment_lib.dart */ method() → void {} + get /* from org-dartlang-testcase:///part_import_augment_lib.dart */ getter() → core::int + return 42; + set /* from org-dartlang-testcase:///part_import_augment_lib.dart */ setter(core::int value) → void {} +} +static method /* from org-dartlang-testcase:///part_import_augment_lib.dart */ method() → void {} +static get /* from org-dartlang-testcase:///part_import_augment_lib.dart */ getter() → core::int + return 42; +static set /* from org-dartlang-testcase:///part_import_augment_lib.dart */ setter(core::int value) → void {}
diff --git a/pkg/front_end/testcases/macros/part_import_augment.dart.weak.modular.expect b/pkg/front_end/testcases/macros/part_import_augment.dart.weak.modular.expect new file mode 100644 index 0000000..be5f74a --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment.dart.weak.modular.expect
@@ -0,0 +1,28 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/part_import_augment_part.dart:7:1: Error: The part-of directive must be the only directive in a part. +// Try removing the other directives, or moving them to the library for which this is a part. +// import augment 'part_import_augment_lib.dart'; +// ^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///part_import_augment.dart"; + +part part_import_augment_part.dart; +class Class extends core::Object { // from org-dartlang-testcase:///part_import_augment_part.dart + synthetic constructor •() → self::Class + : super core::Object::•() + ; + method /* from org-dartlang-testcase:///part_import_augment_lib.dart */ method() → void {} + get /* from org-dartlang-testcase:///part_import_augment_lib.dart */ getter() → core::int + return 42; + set /* from org-dartlang-testcase:///part_import_augment_lib.dart */ setter(core::int value) → void {} +} +static method /* from org-dartlang-testcase:///part_import_augment_lib.dart */ method() → void {} +static get /* from org-dartlang-testcase:///part_import_augment_lib.dart */ getter() → core::int + return 42; +static set /* from org-dartlang-testcase:///part_import_augment_lib.dart */ setter(core::int value) → void {}
diff --git a/pkg/front_end/testcases/macros/part_import_augment.dart.weak.outline.expect b/pkg/front_end/testcases/macros/part_import_augment.dart.weak.outline.expect new file mode 100644 index 0000000..2c3a8ff --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment.dart.weak.outline.expect
@@ -0,0 +1,31 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/part_import_augment_part.dart:7:1: Error: The part-of directive must be the only directive in a part. +// Try removing the other directives, or moving them to the library for which this is a part. +// import augment 'part_import_augment_lib.dart'; +// ^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///part_import_augment.dart"; + +part part_import_augment_part.dart; +class Class extends core::Object { // from org-dartlang-testcase:///part_import_augment_part.dart + synthetic constructor •() → self::Class + ; + method method() → void + ; + get getter() → core::int + ; + set setter(core::int value) → void + ; +} +static method /* from org-dartlang-testcase:///part_import_augment_part.dart */ method() → void + ; +static get /* from org-dartlang-testcase:///part_import_augment_part.dart */ getter() → core::int + ; +static set /* from org-dartlang-testcase:///part_import_augment_part.dart */ setter(core::int value) → void + ;
diff --git a/pkg/front_end/testcases/macros/part_import_augment.dart.weak.transformed.expect b/pkg/front_end/testcases/macros/part_import_augment.dart.weak.transformed.expect new file mode 100644 index 0000000..be5f74a --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment.dart.weak.transformed.expect
@@ -0,0 +1,28 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/macros/part_import_augment_part.dart:7:1: Error: The part-of directive must be the only directive in a part. +// Try removing the other directives, or moving them to the library for which this is a part. +// import augment 'part_import_augment_lib.dart'; +// ^^^^^^ +// +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///part_import_augment.dart"; + +part part_import_augment_part.dart; +class Class extends core::Object { // from org-dartlang-testcase:///part_import_augment_part.dart + synthetic constructor •() → self::Class + : super core::Object::•() + ; + method /* from org-dartlang-testcase:///part_import_augment_lib.dart */ method() → void {} + get /* from org-dartlang-testcase:///part_import_augment_lib.dart */ getter() → core::int + return 42; + set /* from org-dartlang-testcase:///part_import_augment_lib.dart */ setter(core::int value) → void {} +} +static method /* from org-dartlang-testcase:///part_import_augment_lib.dart */ method() → void {} +static get /* from org-dartlang-testcase:///part_import_augment_lib.dart */ getter() → core::int + return 42; +static set /* from org-dartlang-testcase:///part_import_augment_lib.dart */ setter(core::int value) → void {}
diff --git a/pkg/front_end/testcases/macros/part_import_augment_lib.dart b/pkg/front_end/testcases/macros/part_import_augment_lib.dart new file mode 100644 index 0000000..92c3b36 --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment_lib.dart
@@ -0,0 +1,13 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +augment void method() {} +augment int get getter => 42; +augment void set setter(int value) {} + +augment class Class { + augment void method() {} + augment int get getter => 42; + augment void set setter(int value) {} +} \ No newline at end of file
diff --git a/pkg/front_end/testcases/macros/part_import_augment_part.dart b/pkg/front_end/testcases/macros/part_import_augment_part.dart new file mode 100644 index 0000000..77c3284 --- /dev/null +++ b/pkg/front_end/testcases/macros/part_import_augment_part.dart
@@ -0,0 +1,17 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +part of 'part_import_augment.dart'; + +import augment 'part_import_augment_lib.dart'; + +void method() {} +int get getter => 42; +void set setter(int value) {} + +class Class { + void method() {} + int get getter => 42; + void set setter(int value) {} +} \ No newline at end of file
diff --git a/pkg/front_end/testcases/macros/scope_access.dart b/pkg/front_end/testcases/macros/scope_access.dart new file mode 100644 index 0000000..9b256ed --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access.dart
@@ -0,0 +1,51 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import augment 'scope_access_lib1.dart'; +import augment 'scope_access_lib2.dart'; + +void topLevelMethod() { + topLevelMethod(); + topLevelInjectedMethod1(); + topLevelInjectedMethod2(); + _topLevelInjectedMethod3(); +} + +void set topLevelSetter(value) { + topLevelSetter = value; + topLevelInjectedSetter1 = value; + topLevelInjectedSetter2 = value; + _topLevelInjectedSetter3 = value; +} + +class Class { + Class.constructor() { + Class.constructor(); + Class.injectedConstructor1(); + Class.injectedConstructor2(); + Class._injectedConstructor3(); + } + + static void staticMethod() { + staticMethod(); + staticInjectedMethod1(); + staticInjectedMethod2(); + _staticInjectedMethod3(); + Class.staticMethod(); + Class.staticInjectedMethod1(); + Class.staticInjectedMethod2(); + Class._staticInjectedMethod3(); + } + + static void set staticSetter(value) { + staticSetter = value; + staticInjectedSetter1 = value; + staticInjectedSetter2 = value; + _staticInjectedSetter3 = value; + Class.staticSetter = value; + Class.staticInjectedSetter1 = value; + Class.staticInjectedSetter2 = value; + Class._staticInjectedSetter3 = value; + } +} \ No newline at end of file
diff --git a/pkg/front_end/testcases/macros/scope_access.dart.strong.expect b/pkg/front_end/testcases/macros/scope_access.dart.strong.expect new file mode 100644 index 0000000..132b9cb --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access.dart.strong.expect
@@ -0,0 +1,166 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; + +class Class extends core::Object { + constructor injectedConstructor1() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor injectedConstructor2() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor _injectedConstructor3() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor constructor() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + static method staticMethod() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set staticSetter(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedMethod1() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedSetter1(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedMethod2() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedSetter2(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedMethod3() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedSetter3(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } +} +static method topLevelMethod() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set topLevelSetter(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedMethod1() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedSetter1(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedMethod2() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedSetter2(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedMethod3() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedSetter3(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +}
diff --git a/pkg/front_end/testcases/macros/scope_access.dart.strong.transformed.expect b/pkg/front_end/testcases/macros/scope_access.dart.strong.transformed.expect new file mode 100644 index 0000000..132b9cb --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access.dart.strong.transformed.expect
@@ -0,0 +1,166 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; + +class Class extends core::Object { + constructor injectedConstructor1() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor injectedConstructor2() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor _injectedConstructor3() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor constructor() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + static method staticMethod() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set staticSetter(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedMethod1() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedSetter1(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedMethod2() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedSetter2(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedMethod3() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedSetter3(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } +} +static method topLevelMethod() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set topLevelSetter(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedMethod1() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedSetter1(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedMethod2() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedSetter2(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedMethod3() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedSetter3(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +}
diff --git a/pkg/front_end/testcases/macros/scope_access.dart.textual_outline.expect b/pkg/front_end/testcases/macros/scope_access.dart.textual_outline.expect new file mode 100644 index 0000000..e710d5c --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access.dart.textual_outline.expect
@@ -0,0 +1,9 @@ +import augment 'scope_access_lib1.dart'; +import augment 'scope_access_lib2.dart'; +void topLevelMethod() {} +void set topLevelSetter(value) {} +class Class { + Class.constructor() {} + static void staticMethod() {} + static void set staticSetter(value) {} +}
diff --git a/pkg/front_end/testcases/macros/scope_access.dart.weak.expect b/pkg/front_end/testcases/macros/scope_access.dart.weak.expect new file mode 100644 index 0000000..132b9cb --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access.dart.weak.expect
@@ -0,0 +1,166 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; + +class Class extends core::Object { + constructor injectedConstructor1() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor injectedConstructor2() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor _injectedConstructor3() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor constructor() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + static method staticMethod() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set staticSetter(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedMethod1() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedSetter1(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedMethod2() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedSetter2(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedMethod3() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedSetter3(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } +} +static method topLevelMethod() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set topLevelSetter(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedMethod1() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedSetter1(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedMethod2() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedSetter2(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedMethod3() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedSetter3(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +}
diff --git a/pkg/front_end/testcases/macros/scope_access.dart.weak.modular.expect b/pkg/front_end/testcases/macros/scope_access.dart.weak.modular.expect new file mode 100644 index 0000000..132b9cb --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access.dart.weak.modular.expect
@@ -0,0 +1,166 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; + +class Class extends core::Object { + constructor injectedConstructor1() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor injectedConstructor2() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor _injectedConstructor3() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor constructor() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + static method staticMethod() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set staticSetter(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedMethod1() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedSetter1(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedMethod2() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedSetter2(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedMethod3() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedSetter3(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } +} +static method topLevelMethod() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set topLevelSetter(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedMethod1() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedSetter1(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedMethod2() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedSetter2(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedMethod3() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedSetter3(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +}
diff --git a/pkg/front_end/testcases/macros/scope_access.dart.weak.outline.expect b/pkg/front_end/testcases/macros/scope_access.dart.weak.outline.expect new file mode 100644 index 0000000..7ac3e38 --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access.dart.weak.outline.expect
@@ -0,0 +1,50 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; + +class Class extends core::Object { + constructor injectedConstructor1() → self::Class + ; + constructor injectedConstructor2() → self::Class + ; + constructor _injectedConstructor3() → self::Class + ; + constructor constructor() → self::Class + ; + static method staticMethod() → void + ; + static set staticSetter(dynamic value) → void + ; + static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedMethod1() → void + ; + static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedSetter1(dynamic value) → void + ; + static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedMethod2() → void + ; + static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedSetter2(dynamic value) → void + ; + static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedMethod3() → void + ; + static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedSetter3(dynamic value) → void + ; +} +static method topLevelMethod() → void + ; +static set topLevelSetter(dynamic value) → void + ; +static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedMethod1() → void + ; +static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedSetter1(dynamic value) → void + ; +static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedMethod2() → void + ; +static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedSetter2(dynamic value) → void + ; +static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedMethod3() → void + ; +static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedSetter3(dynamic value) → void + ;
diff --git a/pkg/front_end/testcases/macros/scope_access.dart.weak.transformed.expect b/pkg/front_end/testcases/macros/scope_access.dart.weak.transformed.expect new file mode 100644 index 0000000..132b9cb --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access.dart.weak.transformed.expect
@@ -0,0 +1,166 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; +import "org-dartlang-testcase:///scope_access.dart"; + +class Class extends core::Object { + constructor injectedConstructor1() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor injectedConstructor2() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor _injectedConstructor3() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + constructor constructor() → self::Class + : super core::Object::•() { + new self::Class::constructor(); + new self::Class::injectedConstructor1(); + new self::Class::injectedConstructor2(); + new self::Class::_injectedConstructor3(); + } + static method staticMethod() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set staticSetter(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedMethod1() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ staticInjectedSetter1(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedMethod2() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ staticInjectedSetter2(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } + static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedMethod3() → void { + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + self::Class::staticMethod(); + self::Class::staticInjectedMethod1(); + self::Class::staticInjectedMethod2(); + self::Class::_staticInjectedMethod3(); + } + static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _staticInjectedSetter3(dynamic value) → void { + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + self::Class::staticSetter = value; + self::Class::staticInjectedSetter1 = value; + self::Class::staticInjectedSetter2 = value; + self::Class::_staticInjectedSetter3 = value; + } +} +static method topLevelMethod() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set topLevelSetter(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedMethod1() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib1.dart */ topLevelInjectedSetter1(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedMethod2() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib2.dart */ topLevelInjectedSetter2(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +} +static method /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedMethod3() → void { + self::topLevelMethod(); + self::topLevelInjectedMethod1(); + self::topLevelInjectedMethod2(); + self::_topLevelInjectedMethod3(); +} +static set /* from org-dartlang-testcase:///scope_access_lib3.dart */ _topLevelInjectedSetter3(dynamic value) → void { + self::topLevelSetter = value; + self::topLevelInjectedSetter1 = value; + self::topLevelInjectedSetter2 = value; + self::_topLevelInjectedSetter3 = value; +}
diff --git a/pkg/front_end/testcases/macros/scope_access_lib1.dart b/pkg/front_end/testcases/macros/scope_access_lib1.dart new file mode 100644 index 0000000..53e1da3 --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access_lib1.dart
@@ -0,0 +1,48 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +void topLevelInjectedMethod1() { + topLevelMethod(); + topLevelInjectedMethod1(); + topLevelInjectedMethod2(); + _topLevelInjectedMethod3(); +} + +void set topLevelInjectedSetter1(value) { + topLevelSetter = value; + topLevelInjectedSetter1 = value; + topLevelInjectedSetter2 = value; + _topLevelInjectedSetter3 = value; +} + +augment class Class { + Class.injectedConstructor1() { + Class.constructor(); + Class.injectedConstructor1(); + Class.injectedConstructor2(); + Class._injectedConstructor3(); + } + + static void staticInjectedMethod1() { + staticMethod(); + staticInjectedMethod1(); + staticInjectedMethod2(); + _staticInjectedMethod3(); + Class.staticMethod(); + Class.staticInjectedMethod1(); + Class.staticInjectedMethod2(); + Class._staticInjectedMethod3(); + } + + static void set staticInjectedSetter1(value) { + staticSetter = value; + staticInjectedSetter1 = value; + staticInjectedSetter2 = value; + _staticInjectedSetter3 = value; + Class.staticSetter = value; + Class.staticInjectedSetter1 = value; + Class.staticInjectedSetter2 = value; + Class._staticInjectedSetter3 = value; + } +} \ No newline at end of file
diff --git a/pkg/front_end/testcases/macros/scope_access_lib2.dart b/pkg/front_end/testcases/macros/scope_access_lib2.dart new file mode 100644 index 0000000..593d80d --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access_lib2.dart
@@ -0,0 +1,50 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import augment 'scope_access_lib3.dart'; + +void topLevelInjectedMethod2() { + topLevelMethod(); + topLevelInjectedMethod1(); + topLevelInjectedMethod2(); + _topLevelInjectedMethod3(); +} + +void set topLevelInjectedSetter2(value) { + topLevelSetter = value; + topLevelInjectedSetter1 = value; + topLevelInjectedSetter2 = value; + _topLevelInjectedSetter3 = value; +} + +augment class Class { + Class.injectedConstructor2() { + Class.constructor(); + Class.injectedConstructor1(); + Class.injectedConstructor2(); + Class._injectedConstructor3(); + } + + static void staticInjectedMethod2() { + staticMethod(); + staticInjectedMethod1(); + staticInjectedMethod2(); + _staticInjectedMethod3(); + Class.staticMethod(); + Class.staticInjectedMethod1(); + Class.staticInjectedMethod2(); + Class._staticInjectedMethod3(); + } + + static void set staticInjectedSetter2(value) { + staticSetter = value; + staticInjectedSetter1 = value; + staticInjectedSetter2 = value; + _staticInjectedSetter3 = value; + Class.staticSetter = value; + Class.staticInjectedSetter1 = value; + Class.staticInjectedSetter2 = value; + Class._staticInjectedSetter3 = value; + } +} \ No newline at end of file
diff --git a/pkg/front_end/testcases/macros/scope_access_lib3.dart b/pkg/front_end/testcases/macros/scope_access_lib3.dart new file mode 100644 index 0000000..52a12f0 --- /dev/null +++ b/pkg/front_end/testcases/macros/scope_access_lib3.dart
@@ -0,0 +1,48 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +void _topLevelInjectedMethod3() { + topLevelMethod(); + topLevelInjectedMethod1(); + topLevelInjectedMethod2(); + _topLevelInjectedMethod3(); +} + +void set _topLevelInjectedSetter3(value) { + topLevelSetter = value; + topLevelInjectedSetter1 = value; + topLevelInjectedSetter2 = value; + _topLevelInjectedSetter3 = value; +} + +augment class Class { + Class._injectedConstructor3() { + Class.constructor(); + Class.injectedConstructor1(); + Class.injectedConstructor2(); + Class._injectedConstructor3(); + } + + static void _staticInjectedMethod3() { + staticMethod(); + staticInjectedMethod1(); + staticInjectedMethod2(); + _staticInjectedMethod3(); + Class.staticMethod(); + Class.staticInjectedMethod1(); + Class.staticInjectedMethod2(); + Class._staticInjectedMethod3(); + } + + static void set _staticInjectedSetter3(value) { + staticSetter = value; + staticInjectedSetter1 = value; + staticInjectedSetter2 = value; + _staticInjectedSetter3 = value; + Class.staticSetter = value; + Class.staticInjectedSetter1 = value; + Class.staticInjectedSetter2 = value; + Class._staticInjectedSetter3 = value; + } +} \ No newline at end of file
diff --git a/pkg/front_end/testcases/records/record_literal.dart b/pkg/front_end/testcases/records/record_literal.dart index f36247f..fca1025 100644 --- a/pkg/front_end/testcases/records/record_literal.dart +++ b/pkg/front_end/testcases/records/record_literal.dart
@@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. method() { + (); (0, 1); (0, b: 1); (a: 0, b: 1);
diff --git a/pkg/front_end/testcases/records/record_literal.dart.strong.expect b/pkg/front_end/testcases/records/record_literal.dart.strong.expect index 4822ef4..89c8acb 100644 --- a/pkg/front_end/testcases/records/record_literal.dart.strong.expect +++ b/pkg/front_end/testcases/records/record_literal.dart.strong.expect
@@ -1,4 +1,12 @@ library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/records/record_literal.dart:6:4: Error: Expected an identifier, but got ')'. +// Try inserting an identifier before ')'. +// (); +// ^ +// import self as self; import "dart:core" as core; @@ -11,6 +19,9 @@ } } static method method() → dynamic { + invalid-expression "pkg/front_end/testcases/records/record_literal.dart:6:4: Error: This couldn't be parsed. + (); + ^"; null{<invalid>}.foo(0, 1); null{<invalid>}.foo(0, b: 1); null{<invalid>}.foo(a: 0, b: 1);
diff --git a/pkg/front_end/testcases/records/record_literal.dart.weak.expect b/pkg/front_end/testcases/records/record_literal.dart.weak.expect index 6012049..77a9feb 100644 --- a/pkg/front_end/testcases/records/record_literal.dart.weak.expect +++ b/pkg/front_end/testcases/records/record_literal.dart.weak.expect
@@ -1,4 +1,12 @@ library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/records/record_literal.dart:6:4: Error: Expected an identifier, but got ')'. +// Try inserting an identifier before ')'. +// (); +// ^ +// import self as self; import "dart:core" as core; @@ -11,6 +19,9 @@ } } static method method() → dynamic { + invalid-expression "pkg/front_end/testcases/records/record_literal.dart:6:4: Error: This couldn't be parsed. + (); + ^"; null{<invalid>}.foo(0, 1); null{<invalid>}.foo(0, b: 1); null{<invalid>}.foo(a: 0, b: 1);
diff --git a/pkg/front_end/testcases/records/record_literal.dart.weak.modular.expect b/pkg/front_end/testcases/records/record_literal.dart.weak.modular.expect index 6012049..77a9feb 100644 --- a/pkg/front_end/testcases/records/record_literal.dart.weak.modular.expect +++ b/pkg/front_end/testcases/records/record_literal.dart.weak.modular.expect
@@ -1,4 +1,12 @@ library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/records/record_literal.dart:6:4: Error: Expected an identifier, but got ')'. +// Try inserting an identifier before ')'. +// (); +// ^ +// import self as self; import "dart:core" as core; @@ -11,6 +19,9 @@ } } static method method() → dynamic { + invalid-expression "pkg/front_end/testcases/records/record_literal.dart:6:4: Error: This couldn't be parsed. + (); + ^"; null{<invalid>}.foo(0, 1); null{<invalid>}.foo(0, b: 1); null{<invalid>}.foo(a: 0, b: 1);
diff --git a/pkg/front_end/testcases/textual_outline.status b/pkg/front_end/testcases/textual_outline.status index 0c41242..bcdcfc0e 100644 --- a/pkg/front_end/testcases/textual_outline.status +++ b/pkg/front_end/testcases/textual_outline.status
@@ -115,8 +115,10 @@ macros/class_members: FormatterCrash macros/extend_augmented: FormatterCrash macros/inject_constructor: FormatterCrash +macros/library_members: FormatterCrash macros/macro_class: FormatterCrash macros/multiple_imports: FormatterCrash +macros/scope_access: FormatterCrash nnbd_mixed/inheritance_from_opt_in: FormatterCrash nnbd_mixed/issue41597: FormatterCrash nnbd_mixed/null_safety_invalid_language_version: FormatterCrash
diff --git a/runtime/vm/closure_functions_cache.cc b/runtime/vm/closure_functions_cache.cc index 82c6499..49badbb 100644 --- a/runtime/vm/closure_functions_cache.cc +++ b/runtime/vm/closure_functions_cache.cc
@@ -11,6 +11,37 @@ namespace dart { FunctionPtr ClosureFunctionsCache::LookupClosureFunction( + const Class& owner, + TokenPosition token_pos) { + auto thread = Thread::Current(); + SafepointReadRwLocker ml(thread, thread->isolate_group()->program_lock()); + return LookupClosureFunctionLocked(owner, token_pos); +} + +FunctionPtr ClosureFunctionsCache::LookupClosureFunctionLocked( + const Class& owner, + TokenPosition token_pos) { + auto thread = Thread::Current(); + auto zone = thread->zone(); + auto object_store = thread->isolate_group()->object_store(); + + DEBUG_ASSERT( + thread->isolate_group()->program_lock()->IsCurrentThreadReader()); + + const auto& closures = + GrowableObjectArray::Handle(zone, object_store->closure_functions()); + auto& closure = Function::Handle(zone); + intptr_t num_closures = closures.Length(); + for (intptr_t i = 0; i < num_closures; i++) { + closure ^= closures.At(i); + if (closure.token_pos() == token_pos && closure.Owner() == owner.ptr()) { + return closure.ptr(); + } + } + return Function::null(); +} + +FunctionPtr ClosureFunctionsCache::LookupClosureFunction( const Function& parent, TokenPosition token_pos) { auto thread = Thread::Current(); @@ -95,6 +126,33 @@ return Function::RawCast(closures_array.At(idx)); } +FunctionPtr ClosureFunctionsCache::GetUniqueInnerClosure( + const Function& outer) { + auto thread = Thread::Current(); + auto zone = thread->zone(); + auto object_store = thread->isolate_group()->object_store(); + + SafepointReadRwLocker ml(thread, thread->isolate_group()->program_lock()); + + const auto& closures = + GrowableObjectArray::Handle(zone, object_store->closure_functions()); + auto& entry = Function::Handle(zone); + for (intptr_t i = (closures.Length() - 1); i >= 0; i--) { + entry ^= closures.At(i); + if (entry.parent_function() == outer.ptr()) { +#if defined(DEBUG) + auto& other = Function::Handle(zone); + for (intptr_t j = i - 1; j >= 0; j--) { + other ^= closures.At(j); + ASSERT(other.parent_function() != outer.ptr()); + } +#endif + return entry.ptr(); + } + } + return Function::null(); +} + void ClosureFunctionsCache::ForAllClosureFunctions( std::function<bool(const Function&)> callback) { auto thread = Thread::Current();
diff --git a/runtime/vm/closure_functions_cache.h b/runtime/vm/closure_functions_cache.h index e8d83e1..c52c2e6 100644 --- a/runtime/vm/closure_functions_cache.h +++ b/runtime/vm/closure_functions_cache.h
@@ -39,6 +39,11 @@ // requirements above). class ClosureFunctionsCache : public AllStatic { public: + static FunctionPtr LookupClosureFunction(const Class& owner, + TokenPosition pos); + static FunctionPtr LookupClosureFunctionLocked(const Class& owner, + TokenPosition pos); + static FunctionPtr LookupClosureFunction(const Function& parent, TokenPosition token_pos); static FunctionPtr LookupClosureFunctionLocked(const Function& parent, @@ -55,6 +60,8 @@ static intptr_t FindClosureIndex(const Function& needle); static FunctionPtr ClosureFunctionFromIndex(intptr_t idx); + static FunctionPtr GetUniqueInnerClosure(const Function& outer); + // Visits all closure functions registered in the object store. // // Iterates in-order, thereby allowing new closures being added during the
diff --git a/tools/VERSION b/tools/VERSION index bf6d620..fb871bb 100644 --- a/tools/VERSION +++ b/tools/VERSION
@@ -27,5 +27,5 @@ MAJOR 2 MINOR 19 PATCH 0 -PRERELEASE 143 +PRERELEASE 144 PRERELEASE_PATCH 0 \ No newline at end of file