Version 2.17.0-222.0.dev
Merge commit 'c51b09bd4e8fb9a330971e7e9b235f98f3afab41' into 'dev'
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/api/code.dart b/pkg/_fe_analyzer_shared/lib/src/macros/api/code.dart
index 6563aef..e0a09f2 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/api/code.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/api/code.dart
@@ -211,6 +211,18 @@
});
}
+class OmittedTypeAnnotationCode extends TypeAnnotationCode {
+ final OmittedTypeAnnotation typeAnnotation;
+
+ OmittedTypeAnnotationCode(this.typeAnnotation);
+
+ @override
+ CodeKind get kind => CodeKind.omittedTypeAnnotation;
+
+ @override
+ List<Object> get parts => [typeAnnotation];
+}
+
/// A piece of code representing a valid named type parameter.
class TypeParameterCode implements Code {
final TypeAnnotationCode? bound;
@@ -250,6 +262,7 @@
functionTypeAnnotation,
namedTypeAnnotation,
nullableTypeAnnotation,
+ omittedTypeAnnotation,
parameter,
raw,
typeParameter,
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart b/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart
index c24cd91..cc9ef15 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart
@@ -56,6 +56,19 @@
Iterable<TypeAnnotation> get typeArguments;
}
+/// An omitted type annotation.
+///
+/// This will be given whenever there is no explicit type annotation for a
+/// declaration.
+///
+/// These type annotations can still produce valid [Code] objects, which will
+/// result in the inferred type being emitted into the resulting code (or
+/// dynamic).
+///
+/// In the definition phase, you may also ask explicitly for the inferred type
+/// using the `inferType` API.
+abstract class OmittedTypeAnnotation implements TypeAnnotation {}
+
/// The interface representing a resolved type.
///
/// Resolved types understand exactly what type they represent, and can be
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor.dart
index c80c9a5..429a635 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor.dart
@@ -73,8 +73,13 @@
///
/// The [resolveIdentifier] argument should return the import uri to be used
/// for that identifier.
- String buildAugmentationLibrary(Iterable<MacroExecutionResult> macroResults,
- ResolvedIdentifier Function(Identifier) resolveIdentifier);
+ ///
+ /// The [inferOmittedType] argument is used to get the inferred type for a
+ /// given [OmittedTypeAnnotation].
+ String buildAugmentationLibrary(
+ Iterable<MacroExecutionResult> macroResults,
+ ResolvedIdentifier Function(Identifier) resolveIdentifier,
+ TypeAnnotation Function(OmittedTypeAnnotation) inferOmittedType);
/// Tell the executor to shut down and clean up any resources it may have
/// allocated.
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/augmentation_library.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/augmentation_library.dart
index fd0b26bc..a795bc6 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/augmentation_library.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/augmentation_library.dart
@@ -9,8 +9,10 @@
/// [MacroExecutor.buildAugmentationLibrary].
mixin AugmentationLibraryBuilder on MacroExecutor {
@override
- String buildAugmentationLibrary(Iterable<MacroExecutionResult> macroResults,
- ResolvedIdentifier Function(Identifier) resolveIdentifier) {
+ String buildAugmentationLibrary(
+ Iterable<MacroExecutionResult> macroResults,
+ ResolvedIdentifier Function(Identifier) resolveIdentifier,
+ TypeAnnotation Function(OmittedTypeAnnotation) typeInferrer) {
StringBuffer importsBuffer = new StringBuffer();
StringBuffer directivesBuffer = new StringBuffer();
Map<Uri, String> importPrefixes = {};
@@ -51,6 +53,8 @@
writeDirectivePart('${resolved.staticScope!}.');
}
writeDirectivePart('${part.name}');
+ } else if (part is OmittedTypeAnnotation) {
+ buildCode(typeInferrer(part).code);
} else {
throw new ArgumentError(
'Code objects only support String, Identifier, and Code '
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart
index b592139..5245960 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart
@@ -298,8 +298,10 @@
/// These calls are handled by the higher level executor.
@override
- String buildAugmentationLibrary(Iterable<MacroExecutionResult> macroResults,
- ResolvedIdentifier Function(Identifier) resolveIdentifier) =>
+ String buildAugmentationLibrary(
+ Iterable<MacroExecutionResult> macroResults,
+ ResolvedIdentifier Function(Identifier) resolveIdentifier,
+ TypeAnnotation Function(OmittedTypeAnnotation) inferOmittedType) =>
throw new StateError('Unreachable');
@override
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart
index 857674e..29c443b 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart
@@ -156,6 +156,18 @@
}
}
+class OmittedTypeAnnotationImpl extends TypeAnnotationImpl
+ implements OmittedTypeAnnotation {
+ OmittedTypeAnnotationImpl({required int id})
+ : super(id: id, isNullable: false);
+
+ @override
+ TypeAnnotationCode get code => new OmittedTypeAnnotationCode(this);
+
+ @override
+ RemoteInstanceKind get kind => RemoteInstanceKind.omittedTypeAnnotation;
+}
+
abstract class DeclarationImpl extends RemoteInstance implements Declaration {
final IdentifierImpl identifier;
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/remote_instance.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/remote_instance.dart
index fc45704..098ad02 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/remote_instance.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/remote_instance.dart
@@ -100,6 +100,7 @@
namedStaticType,
methodDeclaration,
namedTypeAnnotation,
+ omittedTypeAnnotation,
parameterDeclaration,
staticType,
typeAliasDeclaration,
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/serialization_extensions.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/serialization_extensions.dart
index d039f7d..81aa885 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/serialization_extensions.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/serialization_extensions.dart
@@ -48,6 +48,9 @@
case RemoteInstanceKind.namedTypeAnnotation:
moveNext();
return _expectNamedTypeAnnotation(id) as T;
+ case RemoteInstanceKind.omittedTypeAnnotation:
+ moveNext();
+ return _expectOmittedTypeAnnotation(id) as T;
case RemoteInstanceKind.parameterDeclaration:
moveNext();
return _expectParameterDeclaration(id) as T;
@@ -80,6 +83,13 @@
typeArguments: (this..moveNext())._expectRemoteInstanceList(),
);
+ OmittedTypeAnnotation _expectOmittedTypeAnnotation(int id) {
+ expectBool(); // Always `false`.
+ return new OmittedTypeAnnotationImpl(
+ id: id,
+ );
+ }
+
FunctionTypeAnnotation _expectFunctionTypeAnnotation(int id) =>
new FunctionTypeAnnotationImpl(
id: id,
@@ -274,6 +284,9 @@
case CodeKind.nullableTypeAnnotation:
return new NullableTypeAnnotationCode((this..moveNext()).expectCode())
as T;
+ case CodeKind.omittedTypeAnnotation:
+ return new OmittedTypeAnnotationCode(RemoteInstance.deserialize(this))
+ as T;
case CodeKind.parameter:
return new ParameterCode(
defaultValue: (this..moveNext()).expectNullableCode(),
@@ -354,6 +367,11 @@
NullableTypeAnnotationCode self = this as NullableTypeAnnotationCode;
self.underlyingType.serialize(serializer);
return;
+ case CodeKind.omittedTypeAnnotation:
+ OmittedTypeAnnotationCode self = this as OmittedTypeAnnotationCode;
+ (self.typeAnnotation as OmittedTypeAnnotationImpl)
+ .serialize(serializer);
+ return;
case CodeKind.parameter:
ParameterCode self = this as ParameterCode;
self.defaultValue.serializeNullable(serializer);
diff --git a/pkg/_fe_analyzer_shared/test/macros/executor/augmentation_library_test.dart b/pkg/_fe_analyzer_shared/test/macros/executor/augmentation_library_test.dart
index af3d9d7..78d960a 100644
--- a/pkg/_fe_analyzer_shared/test/macros/executor/augmentation_library_test.dart
+++ b/pkg/_fe_analyzer_shared/test/macros/executor/augmentation_library_test.dart
@@ -2,6 +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.
+import 'package:_fe_analyzer_shared/src/macros/executor/introspection_impls.dart';
import 'package:_fe_analyzer_shared/src/macros/executor/remote_instance.dart';
import 'package:test/fake.dart';
import 'package:test/test.dart';
@@ -15,18 +16,26 @@
void main() {
group('AugmentationLibraryBuilder', () {
+ final intIdentifier = TestIdentifier(
+ id: RemoteInstance.uniqueId,
+ name: 'int',
+ kind: IdentifierKind.topLevelMember,
+ staticScope: null,
+ uri: Uri.parse('dart:core'));
+
test('can combine multiple execution results', () {
var results = [
for (var i = 0; i < 2; i++)
MacroExecutionResultImpl(classAugmentations: {
for (var j = 0; j < 3; j++)
'Foo$i$j': [
- DeclarationCode.fromString('int get i => $i;\n'),
- DeclarationCode.fromString('int get j => $j;\n'),
+ DeclarationCode.fromParts([intIdentifier, ' get i => $i;\n']),
+ DeclarationCode.fromParts([intIdentifier, ' get j => $j;\n']),
]
}, libraryAugmentations: [
for (var j = 0; j < 3; j++)
- DeclarationCode.fromString('int get i${i}j$j => ${i + j};\n'),
+ DeclarationCode.fromParts(
+ [intIdentifier, ' get i${i}j$j => ${i + j};\n']),
], newTypeNames: [
'Foo${i}0',
'Foo${i}1',
@@ -34,37 +43,42 @@
]),
];
var library = _TestExecutor().buildAugmentationLibrary(
- results, (Identifier i) => (i as TestIdentifier).resolved);
+ results,
+ (Identifier i) => (i as TestIdentifier).resolved,
+ (OmittedTypeAnnotation i) =>
+ (i as TestOmittedTypeAnnotation).inferredType);
expect(library, equalsIgnoringWhitespace('''
- int get i0j0 => 0;
- int get i0j1 => 1;
- int get i0j2 => 2;
- int get i1j0 => 1;
- int get i1j1 => 2;
- int get i1j2 => 3;
+ import 'dart:core' as i0;
+
+ i0.int get i0j0 => 0;
+ i0.int get i0j1 => 1;
+ i0.int get i0j2 => 2;
+ i0.int get i1j0 => 1;
+ i0.int get i1j1 => 2;
+ i0.int get i1j2 => 3;
augment class Foo00 {
- int get i => 0;
- int get j => 0;
+ i0.int get i => 0;
+ i0.int get j => 0;
}
augment class Foo01 {
- int get i => 0;
- int get j => 1;
+ i0.int get i => 0;
+ i0.int get j => 1;
}
augment class Foo02 {
- int get i => 0;
- int get j => 2;
+ i0.int get i => 0;
+ i0.int get j => 2;
}
augment class Foo10 {
- int get i => 1;
- int get j => 0;
+ i0.int get i => 1;
+ i0.int get j => 0;
}
augment class Foo11 {
- int get i => 1;
- int get j => 1;
+ i0.int get i => 1;
+ i0.int get j => 1;
}
augment class Foo12 {
- int get i => 1;
- int get j => 2;
+ i0.int get i => 1;
+ i0.int get j => 2;
}
'''));
});
@@ -112,7 +126,9 @@
'<',
barIdentifier,
'<T>> {\n',
- 'late int ${barInstanceMember.name};\n',
+ 'late ',
+ intIdentifier,
+ ' ${barInstanceMember.name};\n',
barIdentifier,
'<T> build() => new ',
barIdentifier,
@@ -130,19 +146,50 @@
)
];
var library = _TestExecutor().buildAugmentationLibrary(
- results, (Identifier i) => (i as TestIdentifier).resolved);
+ results,
+ (Identifier i) => (i as TestIdentifier).resolved,
+ (OmittedTypeAnnotation i) =>
+ (i as TestOmittedTypeAnnotation).inferredType);
expect(library, equalsIgnoringWhitespace('''
import 'package:foo/foo.dart' as i0;
import 'package:builder/builder.dart' as i1;
import 'package:bar/bar.dart' as i2;
+ import 'dart:core' as i3;
class FooBuilder<T extends i0.Foo> implements i1.Builder<i2.Bar<T>> {
- late int baz;
+ late i3.int baz;
i2.Bar<T> build() => new i2.Bar()..baz = i2.Bar.zap;
}
'''));
});
+
+ test('can handle omitted type annotations', () {
+ var results = [
+ MacroExecutionResultImpl(classAugmentations: {}, libraryAugmentations: [
+ DeclarationCode.fromParts([
+ OmittedTypeAnnotationCode(
+ TestOmittedTypeAnnotation(NamedTypeAnnotationImpl(
+ id: RemoteInstance.uniqueId,
+ identifier: intIdentifier,
+ isNullable: false,
+ typeArguments: [],
+ ))),
+ ' x = 1;',
+ ]),
+ ], newTypeNames: []),
+ ];
+ var library = _TestExecutor().buildAugmentationLibrary(
+ results,
+ (Identifier i) => (i as TestIdentifier).resolved,
+ (OmittedTypeAnnotation i) =>
+ (i as TestOmittedTypeAnnotation).inferredType);
+ expect(library, equalsIgnoringWhitespace('''
+ import 'dart:core' as i0;
+
+ i0.int x = 1;
+ '''));
+ });
});
}
diff --git a/pkg/_fe_analyzer_shared/test/macros/executor/executor_test.dart b/pkg/_fe_analyzer_shared/test/macros/executor/executor_test.dart
index 13b54ac..b5b6240 100644
--- a/pkg/_fe_analyzer_shared/test/macros/executor/executor_test.dart
+++ b/pkg/_fe_analyzer_shared/test/macros/executor/executor_test.dart
@@ -271,7 +271,7 @@
expect(
result.libraryAugmentations.single.debugString().toString(),
equalsIgnoringWhitespace('''
- String get delegate_myVariable => _myVariable;'''));
+ /*inferred*/String get delegate_myVariable => _myVariable;'''));
});
test('on fields', () async {
@@ -428,7 +428,7 @@
.map((a) => a.debugString().toString()),
unorderedEquals([
equalsIgnoringWhitespace('''
- augment String get _myVariable {
+ augment /*inferred*/String get _myVariable {
print('parentClass: ');
print('isExternal: false');
print('isFinal: true');
@@ -436,11 +436,11 @@
return augment super;
}'''),
equalsIgnoringWhitespace('''
- augment set _myVariable(String value) {
+ augment set _myVariable(/*inferred*/String value) {
augment super = value;
}'''),
equalsIgnoringWhitespace('''
- augment final String _myVariable = 'new initial value' + augment super;
+ augment final /*inferred*/String _myVariable = 'new initial value' + augment super;
'''),
]));
});
diff --git a/pkg/_fe_analyzer_shared/test/macros/util.dart b/pkg/_fe_analyzer_shared/test/macros/util.dart
index edb0788..43c54f4 100644
--- a/pkg/_fe_analyzer_shared/test/macros/util.dart
+++ b/pkg/_fe_analyzer_shared/test/macros/util.dart
@@ -111,6 +111,14 @@
(library == other.library && identifier.name == other.identifier.name);
}
+/// Knows its inferred type ahead of time.
+class TestOmittedTypeAnnotation extends OmittedTypeAnnotationImpl {
+ final TypeAnnotation inferredType;
+
+ TestOmittedTypeAnnotation(this.inferredType)
+ : super(id: RemoteInstance.uniqueId);
+}
+
/// An identifier that knows the resolved version of itself.
class TestIdentifier extends IdentifierImpl {
final ResolvedIdentifier resolved;
@@ -137,6 +145,9 @@
part.debugString(buffer);
} else if (part is IdentifierImpl) {
buffer.write(part.name);
+ } else if (part is TestOmittedTypeAnnotation) {
+ buffer.write('/*inferred*/');
+ part.inferredType.code.debugString(buffer);
} else {
buffer.write(part as String);
}
@@ -244,6 +255,7 @@
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'String'),
isNullable: false,
typeArguments: const []);
+ static final inferredStringType = TestOmittedTypeAnnotation(stringType);
static final voidType = NamedTypeAnnotationImpl(
id: RemoteInstance.uniqueId,
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'void'),
@@ -271,7 +283,7 @@
isExternal: false,
isFinal: true,
isLate: false,
- type: stringType);
+ type: inferredStringType);
static final myVariableGetter = FunctionDeclarationImpl(
id: RemoteInstance.uniqueId,
identifier:
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_trailing_comma.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_trailing_comma.dart
index 4da7cda..1b4aed0 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_trailing_comma.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_trailing_comma.dart
@@ -25,16 +25,20 @@
Future<void> compute(ChangeBuilder builder) async {
final node = this.node;
if (node is ArgumentList) {
- await builder.addDartFileEdit(file, (builder) {
- builder.addSimpleInsertion(node.arguments.last.end, ',');
- });
+ await _insertComma(builder, node.arguments.last);
} else if (node is FormalParameterList) {
- await builder.addDartFileEdit(file, (builder) {
- builder.addSimpleInsertion(node.parameters.last.end, ',');
- });
+ await _insertComma(builder, node.parameters.last);
+ } else if (node is Assertion) {
+ await _insertComma(builder, node.message ?? node.condition);
}
}
+ Future<void> _insertComma(ChangeBuilder builder, AstNode lastNode) async {
+ await builder.addDartFileEdit(file, (builder) {
+ builder.addSimpleInsertion(lastNode.end, ',');
+ });
+ }
+
/// Return an instance of this class. Used as a tear-off in `FixProcessor`.
static AddTrailingComma newInstance() => AddTrailingComma();
}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_trailing_comma_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_trailing_comma_test.dart
index fe27f30..474e1d8 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_trailing_comma_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_trailing_comma_test.dart
@@ -72,6 +72,36 @@
@override
String get lintCode => LintNames.require_trailing_commas;
+ Future<void> test_assert_initializer() async {
+ await resolveTestCode('''
+class C {
+ C(a) : assert(a,
+ '');
+}
+''');
+ await assertHasFix('''
+class C {
+ C(a) : assert(a,
+ '',);
+}
+''');
+ }
+
+ Future<void> test_assert_statement() async {
+ await resolveTestCode('''
+void f(a, b) {
+ assert(a ||
+ b);
+}
+''');
+ await assertHasFix('''
+void f(a, b) {
+ assert(a ||
+ b,);
+}
+''');
+ }
+
Future<void> test_named() async {
await resolveTestCode('''
void f({a, b}) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/macro/macro.dart b/pkg/front_end/lib/src/fasta/kernel/macro/macro.dart
index cdeeaaa3..b004690 100644
--- a/pkg/front_end/lib/src/fasta/kernel/macro/macro.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/macro/macro.dart
@@ -229,6 +229,11 @@
}
}
+ macro.TypeAnnotation _inferOmittedType(
+ macro.OmittedTypeAnnotation omittedType) {
+ throw new UnimplementedError('This is not yet supported!');
+ }
+
Iterable<_ApplicationData> get _applicationData {
if (_applicationDataCache == null) {
List<_ApplicationData> data = _applicationDataCache = [];
@@ -325,7 +330,8 @@
SourceLibraryBuilder sourceLibraryBuilder = entry.key;
assert(entry.value.isNotEmpty);
String result = _macroExecutor
- .buildAugmentationLibrary(entry.value, _resolveIdentifier)
+ .buildAugmentationLibrary(
+ entry.value, _resolveIdentifier, _inferOmittedType)
.trim();
assert(
result.trim().isNotEmpty,
@@ -358,8 +364,8 @@
typeResolver,
classIntrospector);
if (result.isNotEmpty) {
- String source = _macroExecutor
- .buildAugmentationLibrary([result], _resolveIdentifier);
+ String source = _macroExecutor.buildAugmentationLibrary(
+ [result], _resolveIdentifier, _inferOmittedType);
SourceLibraryBuilder augmentationLibrary = await applicationData
.libraryBuilder
.createAugmentationLibrary(source);
@@ -446,7 +452,7 @@
in results.entries) {
SourceLibraryBuilder sourceLibraryBuilder = entry.key;
String result = _macroExecutor.buildAugmentationLibrary(
- entry.value, _resolveIdentifier);
+ entry.value, _resolveIdentifier, _inferOmittedType);
assert(
result.trim().isNotEmpty,
"Empty definitions phase augmentation library source for "
diff --git a/pkg/front_end/test/macros/declaration/macro_declaration_test.dart b/pkg/front_end/test/macros/declaration/macro_declaration_test.dart
index 27aa722..4eacef3 100644
--- a/pkg/front_end/test/macros/declaration/macro_declaration_test.dart
+++ b/pkg/front_end/test/macros/declaration/macro_declaration_test.dart
@@ -294,8 +294,10 @@
List<_MacroInstanceIdentifier> macroInstances = [];
@override
- String buildAugmentationLibrary(Iterable<MacroExecutionResult> macroResults,
- ResolvedIdentifier Function(Identifier) resolveIdentifier) {
+ String buildAugmentationLibrary(
+ Iterable<MacroExecutionResult> macroResults,
+ ResolvedIdentifier Function(Identifier) resolveIdentifier,
+ TypeAnnotation Function(OmittedTypeAnnotation) inferOmittedType) {
return '';
}
diff --git a/tests/lib/isolate/spawn_uri__package_uri__test.dart b/tests/lib/isolate/spawn_uri__package_uri__test.dart
index d5efa2c..b212874 100644
--- a/tests/lib/isolate/spawn_uri__package_uri__test.dart
+++ b/tests/lib/isolate/spawn_uri__package_uri__test.dart
@@ -12,6 +12,7 @@
main() async {
// Run the Dart VM with or without:
// --packages=<packages|package_config>
+ final futures = <Future>[];
for (final runWithPackagesArg in const [true, false]) {
// Run the isolate with or without
// Isolate.spawnUri(..., packageConfig: <packages|package_config>)
@@ -20,15 +21,16 @@
print('TEST spawnWithPackageConfig = $spawnWithPackageConfig ');
final bool checkForResolveUri =
runWithPackagesArg || !spawnWithPackageConfig;
- await runDotPackagesTest(
- runWithPackagesArg, spawnWithPackageConfig, checkForResolveUri);
+ futures.add(runDotPackagesTest(
+ runWithPackagesArg, spawnWithPackageConfig, checkForResolveUri));
for (final optionalPackageUri in const [true, false]) {
print('TEST optionalPackageUri = $optionalPackageUri');
- await runPackageConfigTest(runWithPackagesArg, spawnWithPackageConfig,
- optionalPackageUri, checkForResolveUri);
+ futures.add(runPackageConfigTest(runWithPackagesArg,
+ spawnWithPackageConfig, optionalPackageUri, checkForResolveUri));
}
}
}
+ await Future.wait(futures);
}
Future runPackageConfigTest(bool withPackagesArg, bool spawnWithArg,
diff --git a/tests/lib_2/isolate/spawn_uri__package_uri__test.dart b/tests/lib_2/isolate/spawn_uri__package_uri__test.dart
index 46d4a14..23d4707 100644
--- a/tests/lib_2/isolate/spawn_uri__package_uri__test.dart
+++ b/tests/lib_2/isolate/spawn_uri__package_uri__test.dart
@@ -14,6 +14,7 @@
main() async {
// Run the Dart VM with or without:
// --packages=<packages|package_config>
+ final futures = <Future>[];
for (final runWithPackagesArg in const [true, false]) {
// Run the isolate with or without
// Isolate.spawnUri(..., packageConfig: <packages|package_config>)
@@ -22,15 +23,16 @@
print('TEST spawnWithPackageConfig = $spawnWithPackageConfig ');
final bool checkForResolveUri =
runWithPackagesArg || !spawnWithPackageConfig;
- await runDotPackagesTest(
- runWithPackagesArg, spawnWithPackageConfig, checkForResolveUri);
+ futures.add(runDotPackagesTest(
+ runWithPackagesArg, spawnWithPackageConfig, checkForResolveUri));
for (final optionalPackageUri in const [true, false]) {
print('TEST optionalPackageUri = $optionalPackageUri');
- await runPackageConfigTest(runWithPackagesArg, spawnWithPackageConfig,
- optionalPackageUri, checkForResolveUri);
+ futures.add(runPackageConfigTest(runWithPackagesArg,
+ spawnWithPackageConfig, optionalPackageUri, checkForResolveUri));
}
}
}
+ await Future.wait(futures);
}
Future runPackageConfigTest(bool withPackagesArg, bool spawnWithArg,
diff --git a/tools/VERSION b/tools/VERSION
index 748f5d3..e732f20 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 17
PATCH 0
-PRERELEASE 221
+PRERELEASE 222
PRERELEASE_PATCH 0
\ No newline at end of file