Version 2.9.0-2.0.dev
Merge commit 'd690a0c7c4353e83e25423d05d5685e7c767efa1' into dev
diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json
index af00b66..9a6403f 100644
--- a/.dart_tool/package_config.json
+++ b/.dart_tool/package_config.json
@@ -263,6 +263,11 @@
"packageUri": ".nonexisting/"
},
{
+ "name": "front_end_nonfunction_type_aliases",
+ "rootUri": "../pkg/front_end/testcases/nonfunction_type_aliases",
+ "packageUri": ".nonexisting/"
+ },
+ {
"name": "frontend_server",
"rootUri": "../pkg/frontend_server",
"packageUri": "lib/",
diff --git a/DEPS b/DEPS
index 1f170d2..3b96c94 100644
--- a/DEPS
+++ b/DEPS
@@ -146,7 +146,7 @@
"usage_tag": "3.4.0",
"watcher_rev": "0.9.7+14",
"web_components_rev": "8f57dac273412a7172c8ade6f361b407e2e4ed02",
- "web_socket_channel_tag": "1.0.15",
+ "web_socket_channel_tag": "1.1.0",
"WebCore_rev": "fb11e887f77919450e497344da570d780e078bc8",
"yaml_tag": "2.2.0",
"zlib_rev": "c44fb7248079cc3d5563b14b3f758aee60d6b415",
diff --git a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
index 2df4e4a..b073f3b 100644
--- a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
@@ -1793,27 +1793,60 @@
// supertype of writtenType and a proper subtype of the currently-promoted
// type). If at any point we find an exact match, we take it immediately.
Type currentlyPromotedType = promotedTypes?.last;
+
+ List<Type> result;
List<Type> candidates = null;
- for (int i = 0; i < tested.length; i++) {
- Type type = tested[i];
+
+ void handleTypeOfInterest(Type type) {
+ // The written type must be a subtype of the type.
if (!typeOperations.isSubtypeOf(writtenType, type)) {
- // Can't promote to this type; the type written is not a subtype of
- // it.
- } else if (currentlyPromotedType != null &&
- !typeOperations.isSubtypeOf(type, currentlyPromotedType)) {
- // Can't promote to this type; it's less specific than the currently
- // promoted type.
- } else if (currentlyPromotedType != null &&
- typeOperations.isSameType(type, currentlyPromotedType)) {
- // Can't promote to this type; it's the same as the currently
- // promoted type.
- } else if (typeOperations.isSameType(type, writtenType)) {
- // This is precisely the type we want to promote to; take it.
- return _addToPromotedTypes(promotedTypes, writtenType);
- } else {
- (candidates ??= []).add(type);
+ return;
+ }
+
+ // Must be more specific that the currently promoted type.
+ if (currentlyPromotedType != null) {
+ if (typeOperations.isSameType(type, currentlyPromotedType)) {
+ return;
+ }
+ if (!typeOperations.isSubtypeOf(type, currentlyPromotedType)) {
+ return;
+ }
+ }
+
+ // This is precisely the type we want to promote to; take it.
+ if (typeOperations.isSameType(type, writtenType)) {
+ result = _addToPromotedTypes(promotedTypes, writtenType);
+ }
+
+ if (candidates == null) {
+ candidates = [type];
+ return;
+ }
+
+ // Add only unique candidates.
+ if (!_typeListContains(typeOperations, candidates, type)) {
+ candidates.add(type);
+ return;
}
}
+
+ for (int i = 0; i < tested.length; i++) {
+ Type type = tested[i];
+
+ handleTypeOfInterest(type);
+ if (result != null) {
+ return result;
+ }
+
+ var typeNonNull = typeOperations.promoteToNonNull(type);
+ if (!typeOperations.isSameType(typeNonNull, type)) {
+ handleTypeOfInterest(typeNonNull);
+ if (result != null) {
+ return result;
+ }
+ }
+ }
+
if (candidates != null) {
// Figure out if we have a unique promotion candidate that's a subtype
// of all the others.
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_test.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_test.dart
index 9b759b1..fc831aa 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_test.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/flow_analysis_test.dart
@@ -1855,7 +1855,7 @@
expect(s2.reachable, true);
expect(s2.variableInfo, {
objectQVar: _matchVariableModel(
- chain: ['num?'],
+ chain: ['num?', 'num'],
ofInterest: ['num?', 'int'],
assigned: true,
unassigned: false)
@@ -1930,6 +1930,50 @@
expect(s2.variableInfo, same(s1.variableInfo));
});
+ group('Promotes to NonNull of a type of interest', () {
+ test('when promoted', () {
+ var h = _Harness();
+ var s1 = FlowModel<_Var, _Type>(true)
+ .declare(objectQVar, true)
+ .tryPromote(h, objectQVar, _Type('int?'))
+ .ifTrue;
+ expect(s1.variableInfo, {
+ objectQVar: _matchVariableModel(
+ chain: ['int?'],
+ ofInterest: ['int?'],
+ ),
+ });
+ var s2 = s1.write(objectQVar, _Type('int'), h);
+ expect(s2.variableInfo, {
+ objectQVar: _matchVariableModel(
+ chain: ['int?', 'int'],
+ ofInterest: ['int?'],
+ ),
+ });
+ });
+
+ test('when not promoted', () {
+ var h = _Harness();
+ var s1 = FlowModel<_Var, _Type>(true)
+ .declare(objectQVar, true)
+ .tryPromote(h, objectQVar, _Type('int?'))
+ .ifFalse;
+ expect(s1.variableInfo, {
+ objectQVar: _matchVariableModel(
+ chain: null,
+ ofInterest: ['int?'],
+ ),
+ });
+ var s2 = s1.write(objectQVar, _Type('int'), h);
+ expect(s2.variableInfo, {
+ objectQVar: _matchVariableModel(
+ chain: ['int'],
+ ofInterest: ['int?'],
+ ),
+ });
+ });
+ });
+
test('Promotes to type of interest when not previously promoted', () {
var h = _Harness();
var s1 = FlowModel<_Var, _Type>(true)
@@ -1964,84 +2008,156 @@
});
});
- test('Multiple candidate types of interest; choose most specific (first)',
- () {
- var h = _Harness();
- var s1 = FlowModel<_Var, _Type>(true)
- .declare(objectQVar, true)
- .tryPromote(h, objectQVar, _Type('int?'))
- .ifFalse
- .tryPromote(h, objectQVar, _Type('num?'))
- .ifFalse;
- expect(s1.variableInfo, {
- objectQVar:
- _matchVariableModel(chain: null, ofInterest: ['num?', 'int?'])
- });
- var s2 = s1.write(objectQVar, _Type('int'), h);
- expect(s2.variableInfo, {
- objectQVar:
- _matchVariableModel(chain: ['int?'], ofInterest: ['num?', 'int?'])
- });
- });
+ group('Multiple candidate types of interest', () {
+ group('; choose most specific', () {
+ _Harness h;
- test(
- 'Multiple candidate types of interest; choose most specific (second)',
- () {
- var h = _Harness();
- var s1 = FlowModel<_Var, _Type>(true)
- .declare(objectQVar, true)
- .tryPromote(h, objectQVar, _Type('num?'))
- .ifFalse
- .tryPromote(h, objectQVar, _Type('int?'))
- .ifFalse;
- expect(s1.variableInfo, {
- objectQVar:
- _matchVariableModel(chain: null, ofInterest: ['num?', 'int?'])
- });
- var s2 = s1.write(objectQVar, _Type('int'), h);
- expect(s2.variableInfo, {
- objectQVar:
- _matchVariableModel(chain: ['int?'], ofInterest: ['num?', 'int?'])
- });
- });
+ setUp(() {
+ h = _Harness();
- test('Multiple candidate types of interest; ambiguous', () {
- var h = _Harness();
- var s1 = FlowModel<_Var, _Type>(true)
- .declare(objectQVar, true)
- .tryPromote(h, objectQVar, _Type('num?'))
- .ifFalse
- .tryPromote(h, objectQVar, _Type('num*'))
- .ifFalse;
- expect(s1.variableInfo, {
- objectQVar:
- _matchVariableModel(chain: null, ofInterest: ['num?', 'num*'])
- });
- var s2 = s1.write(objectQVar, _Type('int'), h);
- // It's ambiguous whether to promote to num? or num*, so we don't
- // promote.
- expect(s2, same(s1));
- });
+ // class A {}
+ // class B extends A {}
+ // class C extends B {}
+ h.addSubtype(_Type('A'), _Type('Object?'), true);
+ h.addSubtype(_Type('A'), _Type('A?'), true);
+ h.addSubtype(_Type('A'), _Type('B?'), false);
+ h.addSubtype(_Type('A?'), _Type('Object?'), true);
+ h.addSubtype(_Type('A?'), _Type('A'), false);
+ h.addSubtype(_Type('A?'), _Type('B?'), false);
+ h.addSubtype(_Type('B'), _Type('A'), true);
+ h.addSubtype(_Type('B'), _Type('A?'), true);
+ h.addSubtype(_Type('B'), _Type('B?'), true);
+ h.addSubtype(_Type('B?'), _Type('Object?'), true);
+ h.addSubtype(_Type('B?'), _Type('A'), false);
+ h.addSubtype(_Type('B?'), _Type('A?'), true);
+ h.addSubtype(_Type('B?'), _Type('B'), false);
+ h.addSubtype(_Type('C'), _Type('A'), true);
+ h.addSubtype(_Type('C'), _Type('A?'), true);
+ h.addSubtype(_Type('C'), _Type('B'), true);
+ h.addSubtype(_Type('C'), _Type('B?'), true);
+ });
- test('Multiple candidate types of interest; ambiguous but exact match',
- () {
- var h = _Harness();
- var s1 = FlowModel<_Var, _Type>(true)
- .declare(objectQVar, true)
- .tryPromote(h, objectQVar, _Type('num?'))
- .ifFalse
- .tryPromote(h, objectQVar, _Type('num*'))
- .ifFalse;
- expect(s1.variableInfo, {
- objectQVar:
- _matchVariableModel(chain: null, ofInterest: ['num?', 'num*'])
+ test('; first', () {
+ var x = _Var('x', _Type('Object?'));
+
+ var s1 = FlowModel<_Var, _Type>(true)
+ .declare(x, true)
+ .tryPromote(h, x, _Type('B?'))
+ .ifFalse
+ .tryPromote(h, x, _Type('A?'))
+ .ifFalse;
+ expect(s1.variableInfo, {
+ x: _matchVariableModel(
+ chain: null,
+ ofInterest: ['A?', 'B?'],
+ ),
+ });
+
+ var s2 = s1.write(x, _Type('C'), h);
+ expect(s2.variableInfo, {
+ x: _matchVariableModel(
+ chain: ['B'],
+ ofInterest: ['A?', 'B?'],
+ ),
+ });
+ });
+
+ test('; second', () {
+ var x = _Var('x', _Type('Object?'));
+
+ var s1 = FlowModel<_Var, _Type>(true)
+ .declare(x, true)
+ .tryPromote(h, x, _Type('A?'))
+ .ifFalse
+ .tryPromote(h, x, _Type('B?'))
+ .ifFalse;
+ expect(s1.variableInfo, {
+ x: _matchVariableModel(
+ chain: null,
+ ofInterest: ['A?', 'B?'],
+ ),
+ });
+
+ var s2 = s1.write(x, _Type('C'), h);
+ expect(s2.variableInfo, {
+ x: _matchVariableModel(
+ chain: ['B'],
+ ofInterest: ['A?', 'B?'],
+ ),
+ });
+ });
+
+ test('; nullable and non-nullable', () {
+ var x = _Var('x', _Type('Object?'));
+
+ var s1 = FlowModel<_Var, _Type>(true)
+ .declare(x, true)
+ .tryPromote(h, x, _Type('A'))
+ .ifFalse
+ .tryPromote(h, x, _Type('A?'))
+ .ifFalse;
+ expect(s1.variableInfo, {
+ x: _matchVariableModel(
+ chain: null,
+ ofInterest: ['A', 'A?'],
+ ),
+ });
+
+ var s2 = s1.write(x, _Type('B'), h);
+ expect(s2.variableInfo, {
+ x: _matchVariableModel(
+ chain: ['A'],
+ ofInterest: ['A', 'A?'],
+ ),
+ });
+ });
});
- var s2 = s1.write(objectQVar, _Type('num?'), h);
- // It's ambiguous whether to promote to num? or num*, but since the
- // written type is exactly num?, we use that.
- expect(s2.variableInfo, {
- objectQVar:
- _matchVariableModel(chain: ['num?'], ofInterest: ['num?', 'num*'])
+
+ group('; ambiguous', () {
+ test('; no promotion', () {
+ var h = _Harness();
+ var s1 = FlowModel<_Var, _Type>(true)
+ .declare(objectQVar, true)
+ .tryPromote(h, objectQVar, _Type('num?'))
+ .ifFalse
+ .tryPromote(h, objectQVar, _Type('num*'))
+ .ifFalse;
+ expect(s1.variableInfo, {
+ objectQVar: _matchVariableModel(
+ chain: null,
+ ofInterest: ['num?', 'num*'],
+ ),
+ });
+ var s2 = s1.write(objectQVar, _Type('int'), h);
+ // It's ambiguous whether to promote to num? or num*, so we don't
+ // promote.
+ expect(s2, same(s1));
+ });
+ });
+
+ test('exact match', () {
+ var h = _Harness();
+ var s1 = FlowModel<_Var, _Type>(true)
+ .declare(objectQVar, true)
+ .tryPromote(h, objectQVar, _Type('num?'))
+ .ifFalse
+ .tryPromote(h, objectQVar, _Type('num*'))
+ .ifFalse;
+ expect(s1.variableInfo, {
+ objectQVar: _matchVariableModel(
+ chain: null,
+ ofInterest: ['num?', 'num*'],
+ ),
+ });
+ var s2 = s1.write(objectQVar, _Type('num?'), h);
+ // It's ambiguous whether to promote to num? or num*, but since the
+ // written type is exactly num?, we use that.
+ expect(s2.variableInfo, {
+ objectQVar: _matchVariableModel(
+ chain: ['num?'],
+ ofInterest: ['num?', 'num*'],
+ ),
+ });
});
});
});
@@ -2899,18 +3015,21 @@
'int <: Object?': true,
'int <: String': false,
'int? <: int': false,
+ 'int? <: num': false,
'int? <: num?': true,
'int? <: Object?': true,
'num <: int': false,
'num <: Iterable': false,
'num <: List': false,
'num <: num?': true,
+ 'num <: num*': true,
'num <: Object': true,
'num <: Object?': true,
'num? <: int?': false,
'num? <: num': false,
'num? <: num*': true,
'num? <: Object?': true,
+ 'num* <: num': true,
'num* <: num?': true,
'num* <: Object?': true,
'Iterable <: int': false,
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/assignment_promoted.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/assignment_promoted.dart
index 051be11..b691511 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/assignment_promoted.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/type_promotion/data/assignment_promoted.dart
@@ -16,6 +16,15 @@
/*int*/ x;
}
+typeOfInterest_is_nullable(Object? x) {
+ if (x is int?) {
+ } else {
+ x = 1;
+ /*int*/ x;
+ }
+ x;
+}
+
typeOfInterest_isNot(Object x) {
if (x is! int) {
x = 1;
@@ -24,6 +33,14 @@
/*int*/ x;
}
+typeOfInterest_isNot_nullable(Object? x) {
+ if (x is! int?) {
+ x = 1;
+ /*int*/ x;
+ }
+ x;
+}
+
notATypeOfInterest_nullability(Object? x) {
x = 1;
x;
diff --git a/pkg/analysis_server/lib/src/cider/completion.dart b/pkg/analysis_server/lib/src/cider/completion.dart
new file mode 100644
index 0000000..0655cf8
--- /dev/null
+++ b/pkg/analysis_server/lib/src/cider/completion.dart
@@ -0,0 +1,135 @@
+// Copyright (c) 2020, 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 'dart:async';
+
+import 'package:analysis_server/src/protocol_server.dart';
+import 'package:analysis_server/src/services/completion/completion_core.dart';
+import 'package:analysis_server/src/services/completion/completion_performance.dart';
+import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
+import 'package:analysis_server/src/services/completion/dart/local_library_contributor.dart';
+import 'package:analyzer/dart/element/element.dart' show LibraryElement;
+import 'package:analyzer/src/dart/analysis/performance_logger.dart';
+import 'package:analyzer/src/dart/micro/resolve_file.dart';
+import 'package:analyzer/src/dartdoc/dartdoc_directive_info.dart';
+import 'package:analyzer_plugin/protocol/protocol_common.dart';
+
+/// The cache that can be reuse for across multiple completion request.
+///
+/// It contains data that is relatively small, and does not include for
+/// example types and elements.
+class CiderCompletionCache {
+ final Map<String, _CiderImportedLibrarySuggestions> _importedLibraries = {};
+}
+
+class CiderCompletionComputer {
+ final PerformanceLog _logger;
+ final CiderCompletionCache _cache;
+ final FileResolver _fileResolver;
+
+ DartCompletionRequestImpl _dartCompletionRequest;
+
+ CiderCompletionComputer(this._logger, this._cache, this._fileResolver);
+
+ Future<List<CompletionSuggestion>> compute(String path, int offset) async {
+ var resolvedUnit = _fileResolver.resolve(path);
+
+ var completionRequest = CompletionRequestImpl(
+ resolvedUnit,
+ offset,
+ false,
+ CompletionPerformance(),
+ );
+ var dartdocDirectiveInfo = DartdocDirectiveInfo();
+
+ var suggestions = await _logger.runAsync('Compute suggestions', () async {
+ var includedElementKinds = <ElementKind>{};
+ var includedElementNames = <String>{};
+ var includedSuggestionRelevanceTags = <IncludedSuggestionRelevanceTag>[];
+
+ var manager = DartCompletionManager(
+ dartdocDirectiveInfo: dartdocDirectiveInfo,
+ includedElementKinds: includedElementKinds,
+ includedElementNames: includedElementNames,
+ includedSuggestionRelevanceTags: includedSuggestionRelevanceTags,
+ );
+
+ return await manager.computeSuggestions(completionRequest);
+ });
+
+ _dartCompletionRequest = await DartCompletionRequestImpl.from(
+ completionRequest,
+ dartdocDirectiveInfo,
+ );
+
+ _logger.run('Add imported suggestions', () {
+ suggestions.addAll(
+ _importedLibrariesSuggestions(
+ resolvedUnit.libraryElement,
+ ),
+ );
+ });
+
+ return suggestions;
+ }
+
+ /// Return suggestions from libraries imported into the [target].
+ ///
+ /// TODO(scheglov) Implement show / hide combinators.
+ /// TODO(scheglov) Implement prefixes.
+ List<CompletionSuggestion> _importedLibrariesSuggestions(
+ LibraryElement target,
+ ) {
+ var suggestions = <CompletionSuggestion>[];
+ for (var importedLibrary in target.importedLibraries) {
+ var importedSuggestions = _importedLibrarySuggestions(importedLibrary);
+ suggestions.addAll(importedSuggestions);
+ }
+ return suggestions;
+ }
+
+ /// Return cached, or compute unprefixed suggestions for all elements
+ /// exported from the library.
+ List<CompletionSuggestion> _importedLibrarySuggestions(
+ LibraryElement element,
+ ) {
+ var path = element.source.fullName;
+ var signature = _fileResolver.getLibraryLinkedSignature(path);
+
+ var cacheEntry = _cache._importedLibraries[path];
+ if (cacheEntry == null || cacheEntry.signature != signature) {
+ var suggestions = _librarySuggestions(element);
+ cacheEntry = _CiderImportedLibrarySuggestions(
+ signature,
+ suggestions,
+ );
+ _cache._importedLibraries[path] = cacheEntry;
+ }
+ return cacheEntry.suggestions;
+ }
+
+ /// Compute all unprefixed suggestions for all elements exported from
+ /// the library.
+ List<CompletionSuggestion> _librarySuggestions(LibraryElement element) {
+ var visitor = LibraryElementSuggestionBuilder(_dartCompletionRequest, '');
+ var exportMap = element.exportNamespace.definedNames;
+ for (var definedElement in exportMap.values) {
+ definedElement.accept(visitor);
+ }
+ return visitor.suggestions;
+ }
+}
+
+class CiderCompletionResult {
+ final List<CompletionSuggestion> suggestions;
+
+ CiderCompletionResult(this.suggestions);
+}
+
+class _CiderImportedLibrarySuggestions {
+ final String signature;
+ final List<CompletionSuggestion> suggestions;
+
+ _CiderImportedLibrarySuggestions(this.signature, this.suggestions);
+}
diff --git a/pkg/analysis_server/lib/src/domains/execution/completion.dart b/pkg/analysis_server/lib/src/domains/execution/completion.dart
index 5839530..55439af 100644
--- a/pkg/analysis_server/lib/src/domains/execution/completion.dart
+++ b/pkg/analysis_server/lib/src/domains/execution/completion.dart
@@ -84,7 +84,9 @@
targetResult = await analysisDriver.getResult(contextPath);
});
- CompletionContributor contributor = DartCompletionManager();
+ CompletionContributor contributor = DartCompletionManager(
+ // dartdocDirectiveInfo: server.getDartdocDirectiveInfoFor(targetResult)
+ );
var request = CompletionRequestImpl(
targetResult,
targetOffset,
diff --git a/pkg/analysis_server/lib/src/edit/nnbd_migration/info_builder.dart b/pkg/analysis_server/lib/src/edit/nnbd_migration/info_builder.dart
index 692059e..69506b5 100644
--- a/pkg/analysis_server/lib/src/edit/nnbd_migration/info_builder.dart
+++ b/pkg/analysis_server/lib/src/edit/nnbd_migration/info_builder.dart
@@ -185,6 +185,13 @@
edits.add(_removeHint('Remove /*!*/ hint'));
edits.add(_changeHint('Change to /*?*/ hint', '/*?*/'));
break;
+ case NullabilityFixKind.nullAwarenessUnnecessaryInStrongMode:
+ case NullabilityFixKind.conditionTrueInStrongMode:
+ case NullabilityFixKind.conditionFalseInStrongMode:
+ // We don't offer any edits around weak-only code.
+ // TODO(paulberry): offer edits to delete the code that would be dead in
+ // strong mode (https://github.com/dart-lang/sdk/issues/41554).
+ break;
}
return edits;
}
@@ -324,19 +331,30 @@
if (description != null) {
var explanation = description.appliedMessage;
var kind = description.kind;
- if (edit.isInformative) {
- regions.add(RegionInfo(RegionType.informative, offset,
- replacement.length, lineNumber, explanation, kind, isCounted,
- edits: edits, traces: traces));
- } else if (edit.isInsertion) {
- regions.add(RegionInfo(RegionType.add, offset, replacement.length,
- lineNumber, explanation, kind, isCounted,
- edits: edits, traces: traces));
+ if (edit.isInsertion) {
+ regions.add(RegionInfo(
+ edit.isInformative ? RegionType.informative : RegionType.add,
+ offset,
+ replacement.length,
+ lineNumber,
+ explanation,
+ kind,
+ isCounted,
+ edits: edits,
+ traces: traces));
} else if (edit.isDeletion) {
- regions.add(RegionInfo(RegionType.remove, offset, length,
- lineNumber, explanation, kind, isCounted,
- edits: edits, traces: traces));
+ regions.add(RegionInfo(
+ edit.isInformative ? RegionType.informative : RegionType.remove,
+ offset,
+ length,
+ lineNumber,
+ explanation,
+ kind,
+ isCounted,
+ edits: edits,
+ traces: traces));
} else if (edit.isReplacement) {
+ assert(!edit.isInformative);
regions.add(RegionInfo(RegionType.remove, offset, length,
lineNumber, explanation, kind, isCounted,
edits: edits, traces: traces));
@@ -373,7 +391,7 @@
codeReference?.function,
codeReference == null
? null
- : NavigationTarget(codeReference.path, codeReference.column,
+ : NavigationTarget(codeReference.path, codeReference.offset,
codeReference.line, length));
}
diff --git a/pkg/analysis_server/lib/src/edit/nnbd_migration/migration_info.dart b/pkg/analysis_server/lib/src/edit/nnbd_migration/migration_info.dart
index e563269..adb8601 100644
--- a/pkg/analysis_server/lib/src/edit/nnbd_migration/migration_info.dart
+++ b/pkg/analysis_server/lib/src/edit/nnbd_migration/migration_info.dart
@@ -286,7 +286,9 @@
if (region.offset < offset) {
return region;
}
- // TODO: adjust traces
+ // TODO: perhaps this should be handled by offset mapper instead, since
+ // offset mapper handles navigation, edits, and traces, and this is the
+ // odd ball out.
return RegionInfo(
region.regionType,
region.offset + length,
diff --git a/pkg/analysis_server/lib/src/edit/nnbd_migration/unit_renderer.dart b/pkg/analysis_server/lib/src/edit/nnbd_migration/unit_renderer.dart
index 4ec259f..080d2c1 100644
--- a/pkg/analysis_server/lib/src/edit/nnbd_migration/unit_renderer.dart
+++ b/pkg/analysis_server/lib/src/edit/nnbd_migration/unit_renderer.dart
@@ -24,6 +24,9 @@
@visibleForTesting
static const List<NullabilityFixKind> kindPriorityOrder = [
NullabilityFixKind.removeDeadCode,
+ NullabilityFixKind.conditionTrueInStrongMode,
+ NullabilityFixKind.conditionFalseInStrongMode,
+ NullabilityFixKind.nullAwarenessUnnecessaryInStrongMode,
NullabilityFixKind.otherCastExpression,
NullabilityFixKind.checkExpression,
NullabilityFixKind.addRequired,
@@ -67,7 +70,7 @@
/// Returns the list of edits, as JSON.
Map<String, List<EditListItem>> _computeEditList() {
var editListsByKind = <NullabilityFixKind, List<EditListItem>>{};
- for (var region in unitInfo.fixRegions) {
+ for (var region in unitInfo.regions) {
var kind = region.kind;
if (kind != null && region.isCounted) {
(editListsByKind[kind] ??= []).add(EditListItem(
@@ -240,11 +243,14 @@
String _headerForKind(NullabilityFixKind kind, int count) {
var s = count == 1 ? '' : 's';
+ var es = count == 1 ? '' : 'es';
switch (kind) {
case NullabilityFixKind.addLateDueToHint:
return '$count late hint$s converted to late keyword$s';
case NullabilityFixKind.addRequired:
return '$count required keyword$s added';
+ case NullabilityFixKind.addType:
+ return '$count type$s added';
case NullabilityFixKind.downcastExpression:
return '$count downcast$s added';
case NullabilityFixKind.otherCastExpression:
@@ -253,17 +259,22 @@
return '$count null check$s added';
case NullabilityFixKind.checkExpressionDueToHint:
return '$count null check hint$s converted to null check$s';
- case NullabilityFixKind.addType:
- return '$count type$s added';
+ case NullabilityFixKind.conditionTrueInStrongMode:
+ return '$count condition$s will be true in strong checking mode';
+ break;
+ case NullabilityFixKind.conditionFalseInStrongMode:
+ return '$count condition$s will be false in strong checking mode';
+ break;
case NullabilityFixKind.makeTypeNullable:
return '$count type$s made nullable';
case NullabilityFixKind.makeTypeNullableDueToHint:
return '$count nullability hint$s converted to ?$s';
+ case NullabilityFixKind.nullAwarenessUnnecessaryInStrongMode:
+ return '$count null-aware access$es will be unnecessary in strong '
+ 'checking mode';
case NullabilityFixKind.removeAs:
return '$count cast$s now unnecessary';
case NullabilityFixKind.removeDeadCode:
- // TODO(paulberry): when we change to not removing dead code, change
- // this description string.
return '$count dead code removal$s';
case NullabilityFixKind.removeLanguageVersionComment:
return '$count language version comment$s removed';
diff --git a/pkg/analysis_server/lib/src/edit/preview/preview_site.dart b/pkg/analysis_server/lib/src/edit/preview/preview_site.dart
index 3cebbbf..96941ce 100644
--- a/pkg/analysis_server/lib/src/edit/preview/preview_site.dart
+++ b/pkg/analysis_server/lib/src/edit/preview/preview_site.dart
@@ -200,6 +200,9 @@
// Perform a full check that no files have changed before touching the disk.
for (final fileEdit in edits) {
final file = pathMapper.provider.getFile(fileEdit.file);
+ if (!file.path.endsWith('.dart')) {
+ continue;
+ }
var code = file.exists ? file.readAsStringSync() : '';
if (!unitInfoMap[file.path].hadDiskContent(code)) {
throw StateError('${file.path} has changed, rerun migration to apply.');
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart
index bee5664..04f7092 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart
@@ -148,6 +148,8 @@
try {
CompletionContributor contributor = DartCompletionManager(
+ dartdocDirectiveInfo:
+ server.getDartdocDirectiveInfoFor(completionRequest.result),
includedElementKinds: includedElementKinds,
includedElementNames: includedElementNames,
includedSuggestionRelevanceTags: includedSuggestionRelevanceTags,
diff --git a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart
index ebb6ea1..cf04772 100644
--- a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart
+++ b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart
@@ -6,6 +6,7 @@
import 'package:analysis_server/src/provisional/completion/completion_core.dart';
import 'package:analysis_server/src/services/completion/dart/feature_computer.dart';
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -23,8 +24,10 @@
abstract class DartCompletionContributor {
/// Return a [Future] that completes with a list of suggestions
/// for the given completion [request].
+ // TODO(brianwilkerson) When all of the suggestions are being built using the
+ // builder, change the return type to `Future<void>`.
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request);
+ DartCompletionRequest request, SuggestionBuilder builder);
}
/// The information about a requested list of completions within a Dart file.
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
index ca9e826..29c8cda 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
@@ -8,6 +8,7 @@
import 'package:analysis_server/src/protocol_server.dart'
hide Element, ElementKind;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analysis_server/src/services/completion/dart/utilities.dart';
import 'package:analysis_server/src/utilities/flutter.dart';
import 'package:analyzer/dart/ast/ast.dart';
@@ -33,7 +34,7 @@
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var executable = request.target.executableElement;
if (executable == null) {
return const <CompletionSuggestion>[];
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart
index 6220845..da7524d 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart
@@ -16,7 +16,7 @@
class CombinatorContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var node = request.target.containingNode;
if (node is! Combinator) {
return const <CompletionSuggestion>[];
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
index c70981b..8a72ce7 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
@@ -30,6 +30,7 @@
import 'package:analysis_server/src/services/completion/dart/named_constructor_contributor.dart';
import 'package:analysis_server/src/services/completion/dart/override_contributor.dart';
import 'package:analysis_server/src/services/completion/dart/static_member_contributor.dart';
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analysis_server/src/services/completion/dart/type_member_contributor.dart';
import 'package:analysis_server/src/services/completion/dart/uri_contributor.dart';
import 'package:analysis_server/src/services/completion/dart/variable_name_contributor.dart';
@@ -122,6 +123,7 @@
// Request Dart specific completions from each contributor
var suggestionMap = <String, CompletionSuggestion>{};
var constructorMap = <String, List<String>>{};
+ var builder = SuggestionBuilder(dartRequest);
var contributors = <DartCompletionContributor>[
ArgListContributor(),
CombinatorContributor(),
@@ -150,39 +152,48 @@
contributors.add(ImportedReferenceContributor());
}
+ void addSuggestionToMap(CompletionSuggestion newSuggestion) {
+ // TODO(brianwilkerson) After all contributors are using SuggestionBuilder
+ // move this logic into SuggestionBuilder.
+ var key = newSuggestion.completion;
+
+ // Append parenthesis for constructors to disambiguate from classes.
+ if (_isConstructor(newSuggestion)) {
+ key += '()';
+ var className = _getConstructorClassName(newSuggestion);
+ _ensureList(constructorMap, className).add(key);
+ }
+
+ // Local declarations hide both the class and its constructors.
+ if (!_isClass(newSuggestion)) {
+ var constructorKeys = constructorMap[key];
+ constructorKeys?.forEach(suggestionMap.remove);
+ }
+
+ var oldSuggestion = suggestionMap[key];
+ if (oldSuggestion == null ||
+ oldSuggestion.relevance < newSuggestion.relevance) {
+ suggestionMap[key] = newSuggestion;
+ }
+ }
+
try {
for (var contributor in contributors) {
var contributorTag =
'DartCompletionManager - ${contributor.runtimeType}';
performance.logStartTime(contributorTag);
var contributorSuggestions =
- await contributor.computeSuggestions(dartRequest);
+ await contributor.computeSuggestions(dartRequest, builder);
performance.logElapseTime(contributorTag);
request.checkAborted();
for (var newSuggestion in contributorSuggestions) {
- var key = newSuggestion.completion;
-
- // Append parenthesis for constructors to disambiguate from classes.
- if (_isConstructor(newSuggestion)) {
- key += '()';
- var className = _getConstructorClassName(newSuggestion);
- _ensureList(constructorMap, className).add(key);
- }
-
- // Local declarations hide both the class and its constructors.
- if (!_isClass(newSuggestion)) {
- var constructorKeys = constructorMap[key];
- constructorKeys?.forEach(suggestionMap.remove);
- }
-
- var oldSuggestion = suggestionMap[key];
- if (oldSuggestion == null ||
- oldSuggestion.relevance < newSuggestion.relevance) {
- suggestionMap[key] = newSuggestion;
- }
+ addSuggestionToMap(newSuggestion);
}
}
+ for (var newSuggestion in builder.suggestions) {
+ addSuggestionToMap(newSuggestion);
+ }
} on InconsistentAnalysisException {
// The state of the code being analyzed has changed, so results are likely
// to be inconsistent. Just abort the operation.
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart
index 8a4ead8..19d6d70 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart
@@ -20,11 +20,11 @@
/// A contributor that produces suggestions based on the members of an
/// extension.
class ExtensionMemberContributor extends DartCompletionContributor {
- MemberSuggestionBuilder builder;
+ MemberSuggestionBuilder memberBuilder;
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var containingLibrary = request.libraryElement;
// Gracefully degrade if the library could not be determined, such as with a
// detached part file or source change.
@@ -32,7 +32,7 @@
return const <CompletionSuggestion>[];
}
- builder = MemberSuggestionBuilder(request);
+ memberBuilder = MemberSuggestionBuilder(request);
// Recompute the target because resolution might have changed it.
var expression = request.dotTarget;
@@ -54,7 +54,7 @@
for (var type in types) {
double inheritanceDistance;
if (request.useNewRelevance) {
- inheritanceDistance = builder.request.featureComputer
+ inheritanceDistance = memberBuilder.request.featureComputer
.inheritanceDistanceFeature(
extendedType.element, type.element);
}
@@ -64,7 +64,7 @@
}
}
- return builder.suggestions.toList();
+ return memberBuilder.suggestions.toList();
}
if (expression.isSynthetic) {
@@ -97,7 +97,7 @@
_addExtensionMembers(containingLibrary, type);
expression.staticType;
}
- return builder.suggestions.toList();
+ return memberBuilder.suggestions.toList();
}
void _addExtensionMembers(LibraryElement containingLibrary, DartType type) {
@@ -108,8 +108,8 @@
_resolveExtendedType(containingLibrary, extension, type);
if (extendedType != null && typeSystem.isSubtypeOf(type, extendedType)) {
double inheritanceDistance;
- if (builder.request.useNewRelevance) {
- inheritanceDistance = builder.request.featureComputer
+ if (memberBuilder.request.useNewRelevance) {
+ inheritanceDistance = memberBuilder.request.featureComputer
.inheritanceDistanceFeature(type.element, extendedType.element);
}
// TODO(brianwilkerson) We might want to apply the substitution to the
@@ -123,13 +123,13 @@
ExtensionElement extension, double inheritanceDistance) {
for (var method in extension.methods) {
if (!method.isStatic) {
- builder.addSuggestionForMethod(
+ memberBuilder.addSuggestionForMethod(
method: method, inheritanceDistance: inheritanceDistance);
}
}
for (var accessor in extension.accessors) {
if (!accessor.isStatic) {
- builder.addSuggestionForAccessor(
+ memberBuilder.addSuggestionForAccessor(
accessor: accessor, inheritanceDistance: inheritanceDistance);
}
}
@@ -137,11 +137,11 @@
void _addTypeMembers(InterfaceType type, double inheritanceDistance) {
for (var method in type.methods) {
- builder.addSuggestionForMethod(
+ memberBuilder.addSuggestionForMethod(
method: method, inheritanceDistance: inheritanceDistance);
}
for (var accessor in type.accessors) {
- builder.addSuggestionForAccessor(
+ memberBuilder.addSuggestionForAccessor(
accessor: accessor, inheritanceDistance: inheritanceDistance);
}
}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart
index aa8c9a4..f82ddfb 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart
@@ -17,7 +17,7 @@
class FieldFormalContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var node = request.target.containingNode;
if (node is! FieldFormalParameter) {
return const <CompletionSuggestion>[];
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/imported_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/imported_reference_contributor.dart
index 972878a..15aad2a 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/imported_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/imported_reference_contributor.dart
@@ -6,6 +6,8 @@
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
import 'package:analysis_server/src/services/completion/dart/local_library_contributor.dart';
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart'
+ show SuggestionBuilder;
import 'package:analyzer/src/generated/resolver.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart' as protocol;
@@ -15,7 +17,7 @@
class ImportedReferenceContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
if (!request.includeIdentifiers) {
return const <CompletionSuggestion>[];
}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/inherited_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/inherited_reference_contributor.dart
index 28242f3..7be25c6 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/inherited_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/inherited_reference_contributor.dart
@@ -21,14 +21,14 @@
/// via an implicit target of `this`.
class InheritedReferenceContributor extends DartCompletionContributor {
/// The builder used to build the suggestions.
- MemberSuggestionBuilder builder;
+ MemberSuggestionBuilder memberBuilder;
/// The kind of suggestion to make.
CompletionSuggestionKind kind;
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
if (!request.includeIdentifiers) {
return const <CompletionSuggestion>[];
}
@@ -40,7 +40,7 @@
var classOrMixin = member.parent;
if (classOrMixin is ClassOrMixinDeclaration &&
classOrMixin.declaredElement != null) {
- builder = MemberSuggestionBuilder(request);
+ memberBuilder = MemberSuggestionBuilder(request);
return _computeSuggestionsForClass(classOrMixin.declaredElement, request);
}
return const <CompletionSuggestion>[];
@@ -54,12 +54,12 @@
for (var accessor in type.accessors) {
if (accessor.isGetter) {
if (opType.includeReturnValueSuggestions) {
- builder.addSuggestionForAccessor(
+ memberBuilder.addSuggestionForAccessor(
accessor: accessor, inheritanceDistance: inheritanceDistance);
}
} else {
if (opType.includeVoidReturnSuggestions) {
- builder.addSuggestionForAccessor(
+ memberBuilder.addSuggestionForAccessor(
accessor: accessor, inheritanceDistance: inheritanceDistance);
}
}
@@ -67,20 +67,20 @@
}
for (var method in type.methods) {
if (method.returnType == null) {
- builder.addSuggestionForMethod(
+ memberBuilder.addSuggestionForMethod(
method: method,
inheritanceDistance: inheritanceDistance,
kind: kind);
} else if (!method.returnType.isVoid) {
if (opType.includeReturnValueSuggestions) {
- builder.addSuggestionForMethod(
+ memberBuilder.addSuggestionForMethod(
method: method,
inheritanceDistance: inheritanceDistance,
kind: kind);
}
} else {
if (opType.includeVoidReturnSuggestions) {
- var suggestion = builder.addSuggestionForMethod(
+ var suggestion = memberBuilder.addSuggestionForMethod(
method: method,
inheritanceDistance: inheritanceDistance,
kind: kind);
@@ -105,7 +105,7 @@
_addSuggestionsForType(type, request, inheritanceDistance,
isFunctionalArgument: isFunctionalArgument);
}
- return builder.suggestions.toList();
+ return memberBuilder.suggestions.toList();
}
/// Return the class member containing the target or `null` if the target is
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
index 886dffa..bbe61ce 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
@@ -6,6 +6,7 @@
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/token.dart';
@@ -28,7 +29,7 @@
class KeywordContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var suggestions = <CompletionSuggestion>[];
// Don't suggest anything right after double or integer literals.
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart
index 4d4940e..fb3b718 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/label_contributor.dart
@@ -9,6 +9,7 @@
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart'
show DartCompletionRequestImpl;
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analysis_server/src/services/completion/dart/utilities.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart' as protocol
@@ -22,7 +23,7 @@
class LabelContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var optype = (request as DartCompletionRequestImpl).opType;
// Collect suggestions from the specific child [AstNode] that contains
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart
index 8735a3b..24e45fc 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart
@@ -19,7 +19,7 @@
class LibraryMemberContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
// Determine if the target looks like a library prefix.
var targetId = request.dotTarget;
if (targetId is SimpleIdentifier && !request.target.isCascade) {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/library_prefix_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/library_prefix_contributor.dart
index e41db25..c837cb4 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/library_prefix_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/library_prefix_contributor.dart
@@ -15,7 +15,7 @@
class LibraryPrefixContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
if (!request.includeIdentifiers) {
return const <CompletionSuggestion>[];
}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart
index 76944901..81d91a5 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_constructor_contributor.dart
@@ -28,7 +28,7 @@
class LocalConstructorContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var optype = (request as DartCompletionRequestImpl).opType;
// Collect suggestions from the specific child [AstNode] that contains
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart
index d463c27..2f2f80c 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart
@@ -7,7 +7,7 @@
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
import 'package:analysis_server/src/services/completion/dart/feature_computer.dart';
import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart'
- show createSuggestion, ElementSuggestionBuilder;
+ show createSuggestion, ElementSuggestionBuilder, SuggestionBuilder;
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/nullability_suffix.dart';
@@ -23,6 +23,7 @@
/// the source in which the completions are being requested.
class LibraryElementSuggestionBuilder extends GeneralizingElementVisitor
with ElementSuggestionBuilder {
+ @override
final DartCompletionRequest request;
final OpType optype;
@@ -301,7 +302,7 @@
class LocalLibraryContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
if (!request.includeIdentifiers) {
return const <CompletionSuggestion>[];
}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
index 1dc2aee..5681497 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
@@ -9,6 +9,7 @@
show CompletionSuggestion, CompletionSuggestionKind, Location;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
import 'package:analysis_server/src/services/completion/dart/feature_computer.dart';
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analysis_server/src/services/completion/dart/utilities.dart';
import 'package:analysis_server/src/utilities/strings.dart';
import 'package:analyzer/dart/analysis/features.dart';
@@ -30,7 +31,7 @@
class LocalReferenceContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var opType = request.opType;
var node = request.target.containingNode;
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart
index 56cb00e..3472d5d 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/named_constructor_contributor.dart
@@ -17,7 +17,7 @@
class NamedConstructorContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var node = request.target.containingNode;
var libraryElement = request.libraryElement;
if (libraryElement == null) {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart
index bfecf44..28c0d6f 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/override_contributor.dart
@@ -9,6 +9,7 @@
import 'package:analysis_server/src/protocol_server.dart' as protocol
hide CompletionSuggestion, CompletionSuggestionKind;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -24,7 +25,7 @@
class OverrideContributor implements DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var targetId = _getTargetId(request.target);
if (targetId == null) {
return const <CompletionSuggestion>[];
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/static_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/static_member_contributor.dart
index a82924b..9f9f584 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/static_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/static_member_contributor.dart
@@ -22,7 +22,7 @@
class StaticMemberContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var targetId = request.dotTarget;
if (targetId is Identifier && !request.target.isCascade) {
var elem = targetId.staticElement;
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
index 9d05145..bdf356d 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
@@ -543,3 +543,17 @@
return toRelevance(score, Relevance.member);
}
}
+
+/// An object used to build a list of suggestions in response to a single
+/// completion request.
+class SuggestionBuilder {
+ /// The completion request for which suggestions are being built.
+ final DartCompletionRequest request;
+
+ /// A collection of completion suggestions.
+ final List<CompletionSuggestion> suggestions = <CompletionSuggestion>[];
+
+ /// Initialize a newly created suggestion builder to build suggestions for the
+ /// given [request].
+ SuggestionBuilder(this.request);
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
index e43b3bf..6852927 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
@@ -23,7 +23,7 @@
class TypeMemberContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var containingLibrary = request.libraryElement;
// Gracefully degrade if the library could not be determined, such as with a
// detached part file or source change.
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart
index 245e9d6..cc6bad1 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart
@@ -8,6 +8,7 @@
import 'package:analysis_server/src/protocol_server.dart'
show CompletionSuggestion, CompletionSuggestionKind;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/file_system/file_system.dart';
@@ -25,7 +26,7 @@
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var builder = _UriSuggestionBuilder(request);
request.target.containingNode.accept(builder);
return builder.suggestions;
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart
index a0ee964..b40435c 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/variable_name_contributor.dart
@@ -7,6 +7,7 @@
import 'package:analysis_server/src/protocol_server.dart'
show CompletionSuggestion, CompletionSuggestionKind;
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analysis_server/src/services/correction/name_suggestion.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer_plugin/src/utilities/completion/completion_target.dart';
@@ -16,7 +17,7 @@
class VariableNameContributor extends DartCompletionContributor {
@override
Future<List<CompletionSuggestion>> computeSuggestions(
- DartCompletionRequest request) async {
+ DartCompletionRequest request, SuggestionBuilder builder) async {
var opType = request.opType;
// Collect suggestions from the specific child [AstNode] that contains
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_question_mark.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_question_mark.dart
new file mode 100644
index 0000000..c14f141
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_question_mark.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2020, 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 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analysis_server/src/services/correction/fix.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_dart.dart';
+import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
+
+class RemoveQuestionMark extends CorrectionProducer {
+ @override
+ FixKind get fixKind => DartFixKind.REMOVE_QUESTION_MARK;
+
+ @override
+ Future<void> compute(DartChangeBuilder builder) async {
+ if (node is! SimpleIdentifier || node.parent is! TypeName) {
+ return;
+ }
+ var typeName = node.parent as TypeName;
+ var questionMark = typeName.question;
+ if (questionMark == null) {
+ return;
+ }
+ await builder.addFileEdit(file, (DartFileEditBuilder builder) {
+ builder.addDeletion(range.token(questionMark));
+ });
+ }
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index 51a755e..07bf305 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -354,6 +354,8 @@
'dart.fix.remove.parenthesisInGetterInvocation',
50,
'Remove parentheses in getter invocation');
+ static const REMOVE_QUESTION_MARK =
+ FixKind('dart.fix.remove.questionMark', 50, "Remove the '?'");
static const REMOVE_THIS_EXPRESSION =
FixKind('dart.fix.remove.thisExpression', 50, 'Remove this expression');
static const REMOVE_TYPE_ANNOTATION =
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 1965a45..56b9ab1 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -23,6 +23,7 @@
import 'package:analysis_server/src/services/correction/dart/inline_typedef.dart';
import 'package:analysis_server/src/services/correction/dart/remove_dead_if_null.dart';
import 'package:analysis_server/src/services/correction/dart/remove_if_null_operator.dart';
+import 'package:analysis_server/src/services/correction/dart/remove_question_mark.dart';
import 'package:analysis_server/src/services/correction/dart/remove_unused.dart';
import 'package:analysis_server/src/services/correction/dart/remove_unused_local_variable.dart';
import 'package:analysis_server/src/services/correction/dart/replace_with_eight_digit_hex.dart';
@@ -4499,12 +4500,24 @@
}
var errorCode = error.errorCode;
- if (errorCode == HintCode.UNUSED_ELEMENT) {
+ if (errorCode == HintCode.NULLABLE_TYPE_IN_CATCH_CLAUSE) {
+ await compute(RemoveQuestionMark());
+ } else if (errorCode == HintCode.UNUSED_ELEMENT) {
await compute(RemoveUnusedElement());
} else if (errorCode == HintCode.UNUSED_FIELD) {
await compute(RemoveUnusedField());
} else if (errorCode == HintCode.UNUSED_LOCAL_VARIABLE) {
await compute(RemoveUnusedLocalVariable());
+ } else if (errorCode ==
+ CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE) {
+ await compute(RemoveQuestionMark());
+ } else if (errorCode ==
+ CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE) {
+ await compute(RemoveQuestionMark());
+ } else if (errorCode == CompileTimeErrorCode.NULLABLE_TYPE_IN_ON_CLAUSE) {
+ await compute(RemoveQuestionMark());
+ } else if (errorCode == CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE) {
+ await compute(RemoveQuestionMark());
} else if (errorCode == StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE) {
await compute(WrapInText());
} else if (errorCode == StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION) {
diff --git a/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart b/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
index 82556d2..cd6b0a1 100644
--- a/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
+++ b/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
@@ -9,6 +9,7 @@
import 'package:analysis_server/src/services/completion/completion_performance.dart';
import 'package:analysis_server/src/services/completion/dart/completion_manager.dart'
show DartCompletionManager, DartCompletionRequestImpl;
+import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
import 'package:analysis_server/src/services/completion/dart/utilities.dart';
import 'package:analyzer/src/dartdoc/dartdoc_directive_info.dart';
import 'package:analyzer/src/generated/parser.dart' as analyzer;
@@ -53,7 +54,9 @@
@override
Future<List<CompletionSuggestion>> computeContributedSuggestions(
DartCompletionRequest request) async {
- return contributor.computeSuggestions(request);
+ var builder = SuggestionBuilder(request);
+ var suggestions = await contributor.computeSuggestions(request, builder);
+ return [...suggestions, ...builder.suggestions];
}
DartCompletionContributor createContributor();
diff --git a/pkg/analysis_server/test/src/edit/fix/dartfix_listener_test.dart b/pkg/analysis_server/test/src/edit/fix/dartfix_listener_test.dart
index 09382eb..a904622 100644
--- a/pkg/analysis_server/test/src/edit/fix/dartfix_listener_test.dart
+++ b/pkg/analysis_server/test/src/edit/fix/dartfix_listener_test.dart
@@ -23,11 +23,11 @@
void test_clear_clears_edits() {
listener.addSourceChange(
- "Example",
+ 'Example',
null,
- SourceChange("foo")
+ SourceChange('foo')
..edits = [
- SourceFileEdit("foo", 2, edits: [SourceEdit(0, 0, "foo")])
+ SourceFileEdit('foo', 2, edits: [SourceEdit(0, 0, 'foo')])
]);
expect(listener.sourceChange.edits, hasLength(1));
listener.reset();
diff --git a/pkg/analysis_server/test/src/edit/nnbd_migration/info_builder_test.dart b/pkg/analysis_server/test/src/edit/nnbd_migration/info_builder_test.dart
index 17cb33b..06f77f0 100644
--- a/pkg/analysis_server/test/src/edit/nnbd_migration/info_builder_test.dart
+++ b/pkg/analysis_server/test/src/edit/nnbd_migration/info_builder_test.dart
@@ -6,7 +6,6 @@
import 'package:analysis_server/src/edit/nnbd_migration/migration_info.dart';
import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/source/line_info.dart';
import 'package:meta/meta.dart';
import 'package:nnbd_migration/nnbd_migration.dart';
import 'package:test/test.dart';
@@ -251,18 +250,6 @@
return true;
}
- void assertTraceEntry(UnitInfo unit, TraceEntryInfo entryInfo,
- String function, int offset, Object descriptionMatcher) {
- assert(offset >= 0);
- var lineInfo = LineInfo.fromContent(unit.content);
- var expectedLocation = lineInfo.getLocation(offset);
- expect(entryInfo.target.filePath, unit.path);
- expect(entryInfo.target.line, expectedLocation.lineNumber);
- expect(entryInfo.target.offset, expectedLocation.columnNumber);
- expect(entryInfo.function, function);
- expect(entryInfo.description, descriptionMatcher);
- }
-
List<RegionInfo> getNonInformativeRegions(List<RegionInfo> regions) {
return regions
.where((region) =>
@@ -293,6 +280,68 @@
replacement: ''));
}
+ Future<void> test_conditionFalseInStrongMode() async {
+ var unit = await buildInfoForSingleTestFile('''
+int f(String s) {
+ if (s == null) {
+ return 0;
+ } else {
+ return s.length;
+ }
+}
+''', migratedContent: '''
+int f(String s) {
+ if (s == null /* == false */) {
+ return 0;
+ } else {
+ return s.length;
+ }
+}
+''', warnOnWeakCode: true);
+ var insertedComment = '/* == false */';
+ var insertedCommentOffset = unit.content.indexOf(insertedComment);
+ var region = unit.regions
+ .where((region) => region.offset == insertedCommentOffset)
+ .single;
+ assertRegion(
+ region: region,
+ length: insertedComment.length,
+ explanation: 'Condition will always be false in strong checking mode',
+ kind: NullabilityFixKind.conditionFalseInStrongMode,
+ edits: isEmpty);
+ }
+
+ Future<void> test_conditionTrueInStrongMode() async {
+ var unit = await buildInfoForSingleTestFile('''
+int f(String s) {
+ if (s != null) {
+ return s.length;
+ } else {
+ return 0;
+ }
+}
+''', migratedContent: '''
+int f(String s) {
+ if (s != null /* == true */) {
+ return s.length;
+ } else {
+ return 0;
+ }
+}
+''', warnOnWeakCode: true);
+ var insertedComment = '/* == true */';
+ var insertedCommentOffset = unit.content.indexOf(insertedComment);
+ var region = unit.regions
+ .where((region) => region.offset == insertedCommentOffset)
+ .single;
+ assertRegion(
+ region: region,
+ length: insertedComment.length,
+ explanation: 'Condition will always be true in strong checking mode',
+ kind: NullabilityFixKind.conditionTrueInStrongMode,
+ edits: isEmpty);
+ }
+
Future<void> test_discardCondition() async {
var unit = await buildInfoForSingleTestFile('''
void g(int i) {
@@ -418,13 +467,11 @@
for (var trace in region.traces)
trace.description: trace.entries[0].target.offset
};
- // Note: +1's below are because trace offsets are actually column numbers.
expect(traceDescriptionToOffset, {
- 'Nullability reason': content.indexOf('List<int/*?*/>/*?*/') + 1,
- 'Non-nullability reason': content.indexOf('List<int/*!*/>/*!*/') + 1,
- 'Nullability reason for type argument 0': content.indexOf('int/*?*/') + 1,
- 'Non-nullability reason for type argument 0':
- content.indexOf('int/*!*/') + 1
+ 'Nullability reason': content.indexOf('List<int/*?*/>/*?*/'),
+ 'Non-nullability reason': content.indexOf('List<int/*!*/>/*!*/'),
+ 'Nullability reason for type argument 0': content.indexOf('int/*?*/'),
+ 'Non-nullability reason for type argument 0': content.indexOf('int/*!*/')
});
}
@@ -565,6 +612,25 @@
kind: NullabilityFixKind.checkExpression);
}
+ void test_nullAwarenessUnnecessaryInStrongMode() async {
+ var unit = await buildInfoForSingleTestFile('''
+int f(String s) => s?.length;
+''', migratedContent: '''
+int f(String s) => s?.length;
+''', warnOnWeakCode: true);
+ var question = '?';
+ var questionOffset = unit.content.indexOf(question);
+ var region =
+ unit.regions.where((region) => region.offset == questionOffset).single;
+ assertRegion(
+ region: region,
+ length: question.length,
+ explanation:
+ 'Null-aware access will be unnecessary in strong checking mode',
+ kind: NullabilityFixKind.nullAwarenessUnnecessaryInStrongMode,
+ edits: isEmpty);
+ }
+
Future<void> test_nullCheck_dueToHint() async {
var content = 'int f(int/*?*/ x) => x/*!*/;';
var migratedContent = 'int f(int/*?*/ x) => x/*!*/;';
@@ -838,17 +904,12 @@
var entries = trace.entries;
expect(entries, hasLength(2));
// Entry 0 is the nullability of the type of i.
- // TODO(paulberry): -1 is a bug.
- assertTraceEntry(unit, entries[0], 'f',
- unit.content.indexOf('int/*?*/') - 1, contains('parameter 0 of f'));
+ assertTraceEntry(unit, entries[0], 'f', unit.content.indexOf('int/*?*/'),
+ contains('parameter 0 of f'));
// Entry 1 is the edge from always to the type of i.
// TODO(paulberry): this edge provides no additional useful information and
// shouldn't be included in the trace.
- assertTraceEntry(
- unit,
- entries[1],
- 'f',
- unit.content.indexOf('int/*?*/') - 1,
+ assertTraceEntry(unit, entries[1], 'f', unit.content.indexOf('int/*?*/'),
'explicitly hinted to be nullable');
}
@@ -916,9 +977,8 @@
var trace = region.traces.single;
expect(trace.description, 'Reason');
expect(trace.entries, hasLength(1));
- // TODO(paulberry): -1 is a bug.
assertTraceEntry(unit, trace.entries.single, 'f',
- unit.content.indexOf('i/*!*/') - 1, 'Null check hint');
+ unit.content.indexOf('i/*!*/'), 'Null check hint');
}
Future<void> test_trace_substitutionNode() async {
diff --git a/pkg/analysis_server/test/src/edit/nnbd_migration/nnbd_migration_test_base.dart b/pkg/analysis_server/test/src/edit/nnbd_migration/nnbd_migration_test_base.dart
index d8a281a..6591ced 100644
--- a/pkg/analysis_server/test/src/edit/nnbd_migration/nnbd_migration_test_base.dart
+++ b/pkg/analysis_server/test/src/edit/nnbd_migration/nnbd_migration_test_base.dart
@@ -9,6 +9,7 @@
import 'package:analysis_server/src/edit/nnbd_migration/migration_info.dart';
import 'package:analysis_server/src/edit/nnbd_migration/offset_mapper.dart';
import 'package:analyzer/dart/analysis/results.dart';
+import 'package:analyzer/source/line_info.dart';
import 'package:meta/meta.dart';
import 'package:nnbd_migration/nnbd_migration.dart';
import 'package:test/test.dart';
@@ -54,6 +55,8 @@
if (offset != null) {
expect(region.offset, offset);
expect(region.length, length ?? 1);
+ } else if (length != null) {
+ expect(region.length, length);
}
expect(region.kind, kind);
expect(region.edits, edits);
@@ -91,13 +94,28 @@
kind: kind);
}
+ void assertTraceEntry(UnitInfo unit, TraceEntryInfo entryInfo,
+ String function, int offset, Object descriptionMatcher) {
+ assert(offset >= 0);
+ var lineInfo = LineInfo.fromContent(unit.content);
+ var expectedLocation = lineInfo.getLocation(offset);
+ expect(entryInfo.target.filePath, unit.path);
+ expect(entryInfo.target.line, expectedLocation.lineNumber);
+ expect(unit.offsetMapper.map(entryInfo.target.offset), offset);
+ expect(entryInfo.function, function);
+ expect(entryInfo.description, descriptionMatcher);
+ }
+
/// Uses the InfoBuilder to build information for [testFile].
///
/// The information is stored in [infos].
- Future<void> buildInfo({bool removeViaComments = true}) async {
+ Future<void> buildInfo(
+ {bool removeViaComments = true, bool warnOnWeakCode = false}) async {
var includedRoot = resourceProvider.pathContext.dirname(testFile);
await _buildMigrationInfo([testFile],
- includedRoot: includedRoot, removeViaComments: removeViaComments);
+ includedRoot: includedRoot,
+ removeViaComments: removeViaComments,
+ warnOnWeakCode: warnOnWeakCode);
}
/// Uses the InfoBuilder to build information for a single test file.
@@ -105,9 +123,12 @@
/// Asserts that [originalContent] is migrated to [migratedContent]. Returns
/// the singular UnitInfo which was built.
Future<UnitInfo> buildInfoForSingleTestFile(String originalContent,
- {@required String migratedContent, bool removeViaComments = true}) async {
+ {@required String migratedContent,
+ bool removeViaComments = true,
+ bool warnOnWeakCode = false}) async {
addTestFile(originalContent);
- await buildInfo(removeViaComments: removeViaComments);
+ await buildInfo(
+ removeViaComments: removeViaComments, warnOnWeakCode: warnOnWeakCode);
// Ignore info for dart:core.
var filteredInfos = [
for (var info in infos) if (!info.path.contains('core.dart')) info
@@ -141,7 +162,9 @@
/// Uses the InfoBuilder to build information for files at [testPaths], which
/// should all share a common parent directory, [includedRoot].
Future<void> _buildMigrationInfo(List<String> testPaths,
- {String includedRoot, bool removeViaComments = true}) async {
+ {String includedRoot,
+ bool removeViaComments = true,
+ bool warnOnWeakCode = false}) async {
// Compute the analysis results.
server.setAnalysisRoots('0', [includedRoot], [], {});
// Run the migration engine.
@@ -151,7 +174,8 @@
var migration = NullabilityMigration(adapter,
permissive: false,
instrumentation: instrumentationListener,
- removeViaComments: removeViaComments);
+ removeViaComments: removeViaComments,
+ warnOnWeakCode: warnOnWeakCode);
Future<void> _forEachPath(
void Function(ResolvedUnitResult) callback) async {
for (var testPath in testPaths) {
diff --git a/pkg/analysis_server/test/src/edit/nnbd_migration/unit_renderer_test.dart b/pkg/analysis_server/test/src/edit/nnbd_migration/unit_renderer_test.dart
index 5ab9abf..0e7bd9a 100644
--- a/pkg/analysis_server/test/src/edit/nnbd_migration/unit_renderer_test.dart
+++ b/pkg/analysis_server/test/src/edit/nnbd_migration/unit_renderer_test.dart
@@ -36,6 +36,60 @@
return contents;
}
+ void test_conditionFalseInStrongMode() async {
+ await buildInfoForSingleTestFile('''
+int f(String s) {
+ if (s == null) {
+ return 0;
+ } else {
+ return s.length;
+ }
+}
+''', migratedContent: '''
+int f(String s) {
+ if (s == null /* == false */) {
+ return 0;
+ } else {
+ return s.length;
+ }
+}
+''', warnOnWeakCode: true);
+ var output = renderUnits()[0];
+ expect(
+ _stripDataAttributes(output.regions),
+ contains(
+ '<span class="region informative-region">/* == false */</span>'));
+ expect(output.edits.keys,
+ contains('1 condition will be false in strong checking mode'));
+ }
+
+ void test_conditionTrueInStrongMode() async {
+ await buildInfoForSingleTestFile('''
+int f(String s) {
+ if (s != null) {
+ return s.length;
+ } else {
+ return 0;
+ }
+}
+''', migratedContent: '''
+int f(String s) {
+ if (s != null /* == true */) {
+ return s.length;
+ } else {
+ return 0;
+ }
+}
+''', warnOnWeakCode: true);
+ var output = renderUnits()[0];
+ expect(
+ _stripDataAttributes(output.regions),
+ contains(
+ '<span class="region informative-region">/* == true */</span>'));
+ expect(output.edits.keys,
+ contains('1 condition will be true in strong checking mode'));
+ }
+
Future<void> test_editList_containsCount() async {
await buildInfoForSingleTestFile('''
int a = null;
@@ -207,6 +261,21 @@
r'<span id="o13">a</span> = null;'));
}
+ void test_nullAwarenessUnnecessaryInStrongMode() async {
+ await buildInfoForSingleTestFile('''
+int f(String s) => s?.length;
+''', migratedContent: '''
+int f(String s) => s?.length;
+''', warnOnWeakCode: true);
+ var output = renderUnits()[0];
+ expect(_stripDataAttributes(output.regions),
+ contains('s<span class="region informative-region">?</span>.length'));
+ expect(
+ output.edits.keys,
+ contains(
+ '1 null-aware access will be unnecessary in strong checking mode'));
+ }
+
Future<void> test_outputContains_addedType() async {
await buildInfoForSingleTestFile('''
void f() {
diff --git a/pkg/analysis_server/test/src/edit/preview/preview_site_test.dart b/pkg/analysis_server/test/src/edit/preview/preview_site_test.dart
index bc66122..fd1d4b0 100644
--- a/pkg/analysis_server/test/src/edit/preview/preview_site_test.dart
+++ b/pkg/analysis_server/test/src/edit/preview/preview_site_test.dart
@@ -26,6 +26,7 @@
@reflectiveTest
class PreviewSiteTest with ResourceProviderMixin, PreviewSiteTestMixin {
+ @override
Future<void> performEdit(String path, int offset, String replacement) {
final pathUri = Uri.file(path).path;
return site
@@ -47,6 +48,33 @@
});
}
+ void test_apply_regress41391() async {
+ final path = convertPath('/test.dart');
+ final file = getFile(path);
+ final analysisOptionsPath = convertPath('/analysis_options.yaml');
+ final analysisOptions = getFile(analysisOptionsPath);
+ analysisOptions.writeAsStringSync('analyzer:');
+ final content = 'void main() {}';
+ file.writeAsStringSync(content);
+ site.unitInfoMap[path] = UnitInfo(path)..diskContent = content;
+ // Add a source change for analysis_options, which has no UnitInfo.
+ dartfixListener.addSourceChange(
+ 'enable experiment',
+ Location(analysisOptionsPath, 9, 0, 1, 9),
+ SourceChange('enable experiment', edits: [
+ SourceFileEdit(analysisOptionsPath, 0, edits: [
+ SourceEdit(9, 0, '\n enable-experiment:\n - non-nullable')
+ ])
+ ]));
+ // This should not crash.
+ site.performApply();
+ expect(analysisOptions.readAsStringSync(), '''
+analyzer:
+ enable-experiment:
+ - non-nullable''');
+ expect(state.hasBeenApplied, true);
+ }
+
void test_applyChangesEmpty() {
final file = getFile('/test.dart');
file.writeAsStringSync('void main() {}');
@@ -221,6 +249,11 @@
targets: targets,
offset: unitInfo.content.indexOf('y'),
offsetMapper: unitInfo.offsetMapper);
+ var trace = unitInfo.regions[1].traces[0];
+ assertTraceEntry(unitInfo, trace.entries[0], null,
+ unitInfo.content.indexOf('int/*?*/? y'), contains('explicit type'));
+ assertTraceEntry(unitInfo, trace.entries[1], 'y',
+ unitInfo.content.indexOf('= x;') + '= '.length, contains('data flow'));
expect(state.hasBeenApplied, false);
expect(state.needsRerun, true);
expect(reranPaths, null);
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_question_mark_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_question_mark_test.dart
new file mode 100644
index 0000000..428f1d6
--- /dev/null
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_question_mark_test.dart
@@ -0,0 +1,101 @@
+// Copyright (c) 2020, 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 'package:analysis_server/src/services/correction/fix.dart';
+import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'fix_processor.dart';
+
+void main() {
+ defineReflectiveSuite(() {
+ defineReflectiveTests(RemoveQuestionMarkTest);
+ });
+}
+
+@reflectiveTest
+class RemoveQuestionMarkTest extends FixProcessorTest {
+ @override
+ FixKind get kind => DartFixKind.REMOVE_QUESTION_MARK;
+
+ @override
+ void setUp() {
+ super.setUp();
+ createAnalysisOptionsFile(experiments: ['non-nullable']);
+ }
+
+ Future<void> test_catchClause() async {
+ await resolveTestUnit('''
+class A {}
+void f() {
+ try {
+ } on A? {
+ }
+}
+''');
+ await assertHasFix('''
+class A {}
+void f() {
+ try {
+ } on A {
+ }
+}
+''');
+ }
+
+ Future<void> test_extendsClause() async {
+ await resolveTestUnit('''
+class A {}
+class B extends A? {}
+''');
+ await assertHasFix('''
+class A {}
+class B extends A {}
+''');
+ }
+
+ Future<void> test_implementsClause() async {
+ await resolveTestUnit('''
+class A {}
+class B implements A? {}
+''');
+ await assertHasFix('''
+class A {}
+class B implements A {}
+''');
+ }
+
+ Future<void> test_onClause_class() async {
+ await resolveTestUnit('''
+class A {}
+mixin B on A? {}
+''');
+ await assertHasFix('''
+class A {}
+mixin B on A {}
+''');
+ }
+
+ Future<void> test_withClause_class() async {
+ await resolveTestUnit('''
+class A {}
+class B with A? {}
+''');
+ await assertHasFix('''
+class A {}
+class B with A {}
+''');
+ }
+
+ Future<void> test_withClause_mixin() async {
+ await resolveTestUnit('''
+mixin A {}
+class B with A? {}
+''');
+ await assertHasFix('''
+mixin A {}
+class B with A {}
+''');
+ }
+}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/test_all.dart b/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
index af23d15..843263f 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/test_all.dart
@@ -111,6 +111,7 @@
as remove_parameters_in_getter_declaration;
import 'remove_parentheses_in_getter_invocation_test.dart'
as remove_parentheses_in_getter_invocation;
+import 'remove_question_mark_test.dart' as remove_question_mark;
import 'remove_this_expression_test.dart' as remove_this_expression;
import 'remove_type_annotation_test.dart' as remove_type_annotation;
import 'remove_type_arguments_test.dart' as remove_type_arguments;
@@ -252,6 +253,7 @@
remove_operator.main();
remove_parameters_in_getter_declaration.main();
remove_parentheses_in_getter_invocation.main();
+ remove_question_mark.main();
remove_this_expression.main();
remove_type_annotation.main();
remove_type_arguments.main();
diff --git a/pkg/analysis_server/tool/completion_metrics/relevance_metrics.dart b/pkg/analysis_server/tool/completion_metrics/relevance_metrics.dart
index 7c0157d..21ff025 100644
--- a/pkg/analysis_server/tool/completion_metrics/relevance_metrics.dart
+++ b/pkg/analysis_server/tool/completion_metrics/relevance_metrics.dart
@@ -138,6 +138,10 @@
/// A table mapping counter names to counts.
Map<String, int> simpleCounts = {};
+ /// A table mapping the length of identifiers to the number of identifiers
+ /// found of that length.
+ Map<int, int> identifierLengths = {};
+
/// A table mapping distances from an identifier to the nearest previous token
/// with the same lexeme to the number of times that distance was found.
Map<int, int> tokenDistances = {};
@@ -189,6 +193,11 @@
contextMap[key] = (contextMap[key] ?? 0) + 1;
}
+ /// Record that an identifier of the given [length] was found.
+ void recordIdentifierOfLength(int length) {
+ identifierLengths[length] = (identifierLengths[length] ?? 0) + 1;
+ }
+
/// Record information about the distance between recurring tokens.
void recordTokenStream(int distance) {
tokenDistances[distance] = (tokenDistances[distance] ?? 0) + 1;
@@ -1243,6 +1252,12 @@
}
@override
+ void visitSimpleIdentifier(SimpleIdentifier node) {
+ data.recordIdentifierOfLength(node.name.length);
+ super.visitSimpleIdentifier(node);
+ }
+
+ @override
void visitSimpleStringLiteral(SimpleStringLiteral node) {
// There are no completions.
super.visitSimpleStringLiteral(node);
@@ -2013,21 +2028,22 @@
}
}
- sink.writeln('');
+ sink.writeln();
_writeCounts(sink, data.simpleCounts);
- sink.writeln('');
+ sink.writeln();
_writeSideBySide(sink, [data.byTokenType, data.byElementKind],
['Token Types', 'Element Kinds']);
- sink.writeln('');
+ sink.writeln();
sink.writeln('Type relationships');
_writeSideBySide(sink, [first, whole], ['First Token', 'Whole Expression']);
_writeContextMap(sink, rest);
- sink.writeln('');
+ sink.writeln();
sink.writeln('Structural indicators');
_writeContextMap(sink, data.byDistance);
- sink.writeln('');
+ sink.writeln();
sink.writeln('Distance to member (left) by depth of target class (top)');
_writeMatrix(sink, data.distanceByDepthMap);
+ _writeIdentifierLengths(sink, data.identifierLengths);
_writeTokenData(sink, data.tokenDistances);
}
@@ -2218,6 +2234,14 @@
}
}
+ /// Write information about the [lengths] of identifiers to the given [sink].
+ void _writeIdentifierLengths(StringSink sink, Map<int, int> lengths) {
+ sink.writeln();
+ var column = _convertMap('identifier lengths', lengths);
+ var table = _convertColumnsToRows([column]).toList();
+ _writeTable(sink, table);
+ }
+
/// Write the given [matrix] to the [sink]. The keys of the outer map will be
/// the row titles; the keys of the inner map will be the column titles.
void _writeMatrix(StringSink sink, Map<int, Map<int, int>> matrix) {
@@ -2310,7 +2334,7 @@
secondColumn.add(' $percent%: $i');
}
- sink.writeln('');
+ sink.writeln();
sink.writeln('Token stream analysis');
var table = _convertColumnsToRows([firstColumn, secondColumn]).toList();
_writeTable(sink, table);
diff --git a/pkg/analyzer/lib/src/dart/error/hint_codes.dart b/pkg/analyzer/lib/src/dart/error/hint_codes.dart
index 3128a5d..0890f77 100644
--- a/pkg/analyzer/lib/src/dart/error/hint_codes.dart
+++ b/pkg/analyzer/lib/src/dart/error/hint_codes.dart
@@ -1306,9 +1306,43 @@
"as an operand of a logical operator.");
/**
- * If it is not allowed to throw a nullable expression, there is not
- * need to catch it.
+ * No parameters.
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when the type following `on` in a
+ // catch clause is a nullable type. It isn't valid to specify a nullable type
+ // because it isn't possible to catch `null` (because it's a runtime error to
+ // throw `null`).
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because the exception type is
+ // specified to allow `null` when `null` can't be thrown:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f() {
+ // try {
+ // // ...
+ // } on [!FormatException?!] {
+ // }
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // Remove the question mark from the type:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f() {
+ // try {
+ // // ...
+ // } on FormatException {
+ // }
+ // }
+ // ```
static const HintCode NULLABLE_TYPE_IN_CATCH_CLAUSE = HintCode(
'NULLABLE_TYPE_IN_CATCH_CLAUSE',
"A potentially nullable type can't be used in an 'on' clause because it "
@@ -2238,6 +2272,61 @@
/**
* No parameters.
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when it finds an equality comparison
+ // (either `==` or `!=`) with one operand of `null` and the other operand
+ // can't be `null`. Such comparisons are always either `true` or `false`, so
+ // they serve no purpose.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `x` can never be
+ // `null`, so the comparison always evaluates to `true`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(int x) {
+ // if (x [!!= null!]) {
+ // print(x);
+ // }
+ // }
+ // ```
+ //
+ // The following code produces this diagnostic because `x` can never be
+ // `null`, so the comparison always evaluates to `false`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(int x) {
+ // if (x [!== null!]) {
+ // throw ArgumentError("x can't be null");
+ // }
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If the other operand should be able to be `null`, then change the type of
+ // the operand:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(int? x) {
+ // if (x != null) {
+ // print(x);
+ // }
+ // }
+ // ```
+ //
+ // If the other operand really can't be `null`, then remove the condition:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(int x) {
+ // print(x);
+ // }
+ // ```
static const HintCode UNNECESSARY_NULL_COMPARISON_FALSE =
HintCodeWithUniqueName(
'UNNECESSARY_NULL_COMPARISON',
diff --git a/pkg/analyzer/lib/src/dart/micro/library_graph.dart b/pkg/analyzer/lib/src/dart/micro/library_graph.dart
index 8875b3e..e0d05e7 100644
--- a/pkg/analyzer/lib/src/dart/micro/library_graph.dart
+++ b/pkg/analyzer/lib/src/dart/micro/library_graph.dart
@@ -28,6 +28,7 @@
show DependencyWalker, Node;
import 'package:analyzer/src/summary2/informative_data.dart';
import 'package:collection/collection.dart';
+import 'package:convert/convert.dart';
/// Ensure that the [FileState.libraryCycle] for the [file] and anything it
/// depends on is computed.
@@ -430,6 +431,10 @@
LibraryCycle();
+ String get signatureStr {
+ return hex.encode(signature);
+ }
+
@override
String toString() {
return '[' + libraries.join(', ') + ']';
diff --git a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
index 1ce64a5..57506b2 100644
--- a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
+++ b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
@@ -82,7 +82,9 @@
_throwIfNotAbsoluteNormalizedPath(path);
return logger.run('Get errors for $path', () {
- var fileContext = _createFileContext(path);
+ var fileContext = logger.run('Get file $path', () {
+ return _createFileContext(path);
+ });
var file = fileContext.file;
var errorsSignatureBuilder = ApiSignature();
@@ -125,11 +127,21 @@
});
}
+ String getLibraryLinkedSignature(String path) {
+ _throwIfNotAbsoluteNormalizedPath(path);
+
+ var fileContext = _createFileContext(path);
+ var file = fileContext.file;
+ return file.libraryCycle.signatureStr;
+ }
+
ResolvedUnitResult resolve(String path) {
_throwIfNotAbsoluteNormalizedPath(path);
return logger.run('Resolve $path', () {
- var fileContext = _createFileContext(path);
+ var fileContext = logger.run('Get file $path', () {
+ return _createFileContext(path);
+ });
var file = fileContext.file;
libraryContext.load2(file);
@@ -258,10 +270,7 @@
_createContext(analysisOptions);
- var file = logger.run('Get file $path', () {
- return fsState.getFileForPath(path);
- });
-
+ var file = fsState.getFileForPath(path);
return _FileContext(analysisOptions, file);
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart b/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
index 7382c03..4340e9d 100644
--- a/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
@@ -181,8 +181,10 @@
element.isFinal = true;
if (exceptionTypeNode == null) {
element.hasImplicitType = true;
- element.type = _dynamicType;
- exceptionNode.staticType = _dynamicType;
+ var type =
+ _isNonNullableByDefault ? _typeProvider.objectType : _dynamicType;
+ element.type = type;
+ exceptionNode.staticType = type;
} else {
element.type = exceptionTypeNode.type;
exceptionNode.staticType = exceptionTypeNode.type;
diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart
index 1f1150b..8212c01 100644
--- a/pkg/analyzer/lib/src/error/codes.dart
+++ b/pkg/analyzer/lib/src/error/codes.dart
@@ -483,16 +483,88 @@
"Try marking the function body with either 'async' or 'async*'.");
/**
- * It is an error if the body of a method, function, getter, or function
- * expression with a potentially non-nullable return type may completely
- * normally.
+ * No parameters.
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when a method or function has a
+ // return type that's <a href=”#potentially-non-nullable”>potentially
+ // non-nullable</a> but would implicitly return `null` if control reached the
+ // end of the function.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because the method `m` has an
+ // implicit return of `null` inserted at the end of the method, but the method
+ // is declared to not return `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // int [!m!](int t) {
+ // print(t);
+ // }
+ // }
+ // ```
+ //
+ // The following code produces this diagnostic because the method `m` has an
+ // implicit return of `null` inserted at the end of the method, but because
+ // the class `C` can be instantiated with a non-nullable type argument, the
+ // method is effectively declared to not return `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C<T> {
+ // T [!m!](T t) {
+ // print(t);
+ // }
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If there's a reasonable value that can be returned, then add a return
+ // statement at the end of the method:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C<T> {
+ // T m(T t) {
+ // print(t);
+ // return t;
+ // }
+ // }
+ // ```
+ //
+ // If the method won't reach the implicit return, then add a throw at the end
+ // of the method:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C<T> {
+ // T m(T t) {
+ // print(t);
+ // throw '';
+ // }
+ // }
+ // ```
+ //
+ // If the method intentionally returns `null` at the end, then change the
+ // return type so that it's valid to return `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C<T> {
+ // T? m(T t) {
+ // print(t);
+ // }
+ // }
+ // ```
static const CompileTimeErrorCode BODY_MIGHT_COMPLETE_NORMALLY =
CompileTimeErrorCode(
'BODY_MIGHT_COMPLETE_NORMALLY',
- "The body might complete normally, which would cause 'null' to be "
- "returned, but the return type is a potentially "
- "non-nullable type.",
+ "The body might complete normally, causing 'null' to be returned, "
+ "but the return type is a potentially non-nullable type.",
correction:
"Try adding either a return or a throw statement at the end.");
@@ -625,11 +697,59 @@
"The switch case expression type '{0}' can't override the == "
"operator.");
- /// Given a switch statement which switches over an expression `e` of type
- /// `T`, where the cases are dispatched based on expressions `e0` ... `ek`:
- ///
- /// It is an error if any of the `ei` evaluate to a value whose static type
- /// is not a subtype of `T`.
+ /**
+ * Parameters:
+ * 0: the type of the case expression
+ * 1: the type of the switch expression
+ */
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when the expression following `case`
+ // in a switch statement has a static type that isn't a subtype of the static
+ // type of the expression following `switch`.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `1` is an `int`, which
+ // isn't a subtype of `String` (the type of `s`):
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(String s) {
+ // switch (s) {
+ // case [!1!]:
+ // break;
+ // }
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If the value of the case expression is wrong, then change the case
+ // expression so that it has the required type:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(String s) {
+ // switch (s) {
+ // case '1':
+ // break;
+ // }
+ // }
+ // ```
+ //
+ // If the value of the case expression is correct, then change the switch
+ // expression to have the required type:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(int s) {
+ // switch (s) {
+ // case 1:
+ // break;
+ // }
+ // }
+ // ```
static const CompileTimeErrorCode
CASE_EXPRESSION_TYPE_IS_NOT_SWITCH_EXPRESSION_SUBTYPE =
CompileTimeErrorCode(
@@ -1348,12 +1468,53 @@
"A continue label resolves to switch, must be loop or switch member");
/**
- * It is an error to call the default `List` constructor.
+ * No parameters.
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when it finds a use of the default
+ // constructor for the class `List` in code that has opted in to null safety.
+ //
+ // #### Example
+ //
+ // Assuming the following code is opted in to null safety, it produces this
+ // diagnostic because it uses the default `List` constructor:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // var l = [!List<int>!]();
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If no initial size is provided, then convert the code to use a list
+ // literal:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // var l = <int>[];
+ // ```
+ //
+ // If an initial size needs to be provided and there is a single reasonable
+ // initial value for the elements, then use `List.filled`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // var l = List.filled(3, 0);
+ // ```
+ //
+ // If an initial size needs to be provided but each element needs to be
+ // computed, then use `List.generate`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // var l = List.generate(3, (i) => i);
+ // ```
static const CompileTimeErrorCode DEFAULT_LIST_CONSTRUCTOR =
CompileTimeErrorCode('DEFAULT_LIST_CONSTRUCTOR',
- "It is an error to call the default List constructor.",
- correction: "Try using 'List.filled' or 'List.generate'.");
+ "Calling the default 'List' constructor causes an error.",
+ correction: "Try using a list literal, 'List.filled' or "
+ "'List.generate'.");
/**
* 6.2.1 Required Formals: By means of a function signature that names the
@@ -1427,17 +1588,46 @@
"extensions.");
/**
- * It is a compile time error to read a local variable marked `late` when the
- * variable is definitely unassigned. This includes all forms of reads,
- * including implicit reads via the composite assignment operators as well
- * as pre and post-fix operators.
- *
* Parameters:
* 0: the name of the variable that is invalid
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when
+ // [definite assignment](https://github.com/dart-lang/language/blob/master/resources/type-system/flow-analysis.md)
+ // analysis shows that a local variable that's marked as `late` is read before
+ // being assigned.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `x` was not assigned a
+ // value before being read:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(bool b) {
+ // late int x;
+ // print([!x!]);
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // Assign a value to the variable before reading from it:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(bool b) {
+ // late int x;
+ // x = b ? 1 : 0;
+ // print(x);
+ // }
+ // ```
static const CompileTimeErrorCode DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE =
- CompileTimeErrorCode('DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE',
- "The late local variable '{0}' is definitely unassigned.",
+ CompileTimeErrorCode(
+ 'DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE',
+ "The late local variable '{0}' is definitely unassigned at this "
+ "point.",
correction:
"Ensure that it is assigned on necessary execution paths.");
@@ -1730,18 +1920,61 @@
"The library '{0}' is internal and can't be exported.");
/**
- * It is an error for an opted-in library to re-export symbols which are
- * defined in a legacy library.
- *
* Parameters:
* 0: the name of a symbol defined in a legacy library
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when a library that was opted in to
+ // null safety exports another library, and the exported library is opted out
+ // of null safety.
+ //
+ // #### Example
+ //
+ // Given a library that is opted out of null safety:
+ //
+ // ```dart
+ // %uri="lib/optedOut.dart"
+ // // @dart = 2.9
+ // String s;
+ // ```
+ //
+ // The following code produces this diagnostic because it's exporting symbols
+ // from an opted-out library:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // export [!'optedOut.dart'!];
+ //
+ // class C {}
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If you're able to do so, migrate the exported library so that it doesn't
+ // need to opt out:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // String? s;
+ // ```
+ //
+ // If you can't migrate the library, then remove the export:
+ //
+ // ```dart
+ // class C {}
+ // ```
+ //
+ // If the exported library (the one that is opted out) itself exports an
+ // opted-in library, then it's valid for your library to indirectly export the
+ // symbols from the opted-in library. You can do so by adding a hide
+ // combinator to the export directive in your library that hides all of the
+ // names declared in the opted-out library.
static const CompileTimeErrorCode EXPORT_LEGACY_SYMBOL = CompileTimeErrorCode(
'EXPORT_LEGACY_SYMBOL',
"The symbol '{0}' is defined in a legacy library, and can't be "
"re-exported from a non-nullable by default library.",
- correction: "Use show / hide combinators to avoid exporting these"
- "symbols, or migrate the legacy library.");
+ correction: "Try removing the export or migrating the legacy library.");
/**
* 14.2 Exports: It is a compile-time error if the compilation unit found at
@@ -3549,63 +3782,104 @@
/**
* No parameters.
*/
- /* #### Description
+ // #### Description
//
- // The analyzer produces this diagnostic when an optional parameter doesn't
- // have a default value, but has a
- // <a href=”#potentially-non-nullable”>potentially non-nullable</a> type.
- // Optional parameters that have no explicit default value have an implicit
- // default value of `null`. If the type of the parameter doesn't allow the
- // parameter to have a value of null, then the implicit default value is not
- // valid.
+ // The analyzer produces this diagnostic when an optional parameter, whether
+ // positional or named, has a <a href=”#potentially-non-nullable”>potentially
+ // non-nullable</a> type and doesn't specify a default value. Optional
+ // parameters that have no explicit default value have an implicit default
+ // value of `null`. If the type of the parameter doesn't allow the parameter
+ // to have a value of `null`, then the implicit default value isn't valid.
//
- // #### Examples
+ // #### Example
//
- // The following code generates this diagnostic:
+ // The following code produces this diagnostic because `x` can't be `null`,
+ // and no non-`null` default value is specified:
//
// ```dart
- // void log({String [!message!]}) {}
+ // %experiments=non-nullable
+ // void f([int [!x!]]) {}
+ // ```
+ //
+ // As does this:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void g({int [!x!]}) {}
// ```
//
// #### Common fixes
//
- // If the parameter can have the value `null`, then add a question mark after
- // the type annotation:
+ // If you want to use `null` to indicate that no value was provided, then you
+ // need to make the type nullable:
//
// ```dart
- // void log({String? message}) {}
+ // %experiments=non-nullable
+ // void f([int? x]) {}
+ // void g({int? x}) {}
// ```
//
// If the parameter can't be null, then either provide a default value:
//
// ```dart
- // void log({String message = ''}) {}
+ // %experiments=non-nullable
+ // void f([int x = 1]) {}
+ // void g({int x = 2}) {}
// ```
//
- // or add the `required` modifier to the parameter:
+ // or make the parameter a required parameter:
//
// ```dart
- // void log({required String message}) {}
- // ``` */
+ // %experiments=non-nullable
+ // void f(int x) {}
+ // void g({required int x}) {}
+ // ```
static const CompileTimeErrorCode MISSING_DEFAULT_VALUE_FOR_PARAMETER =
CompileTimeErrorCode(
'MISSING_DEFAULT_VALUE_FOR_PARAMETER',
"The parameter '{0}' can't have a value of 'null' because of its "
- "type, so it must either be a required parameter or have a "
- "default value.",
+ "type, and no non-null default value is provided.",
correction:
"Try adding either a default value or the 'required' modifier.");
/**
- * It is an error if a named parameter that is marked as being required is
- * not bound to an argument at a call site.
- *
* Parameters:
* 0: the name of the parameter
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when an invocation of a function is
+ // missing a required named parameter.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because the invocation of `f`
+ // doesn't include a value for the required named parameter `end`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(int start, {required int end}) {}
+ // void g() {
+ // [!f!](3);
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // Add a named argument corresponding to the missing required parameter:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(int start, {required int end}) {}
+ // void g() {
+ // f(3, end: 5);
+ // }
+ // ```
static const CompileTimeErrorCode MISSING_REQUIRED_ARGUMENT =
- CompileTimeErrorCode('MISSING_REQUIRED_ARGUMENT',
- "The named parameter '{0}' is required but was not provided.",
+ CompileTimeErrorCode(
+ 'MISSING_REQUIRED_ARGUMENT',
+ "The named parameter '{0}' is required, but there's no corresponding "
+ "argument.",
correction: "Try adding the required argument.");
/**
@@ -4378,22 +4652,135 @@
"Factory bodies can't use 'async', 'async*', or 'sync*'.");
/**
- * It is an error if a potentially non-nullable local variable which has no
- * initializer expression and is not marked `late` is used before it is
- * definitely assigned.
- *
* Parameters:
* 0: the name of the variable that is invalid
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when a local variable is referenced
+ // and has all these characteristics:
+ // - Has a type that's <a href=”#potentially-non-nullable”>potentially
+ // non-nullable</a>.
+ // - Doesn't have an initializer.
+ // - Isn't marked as `late`.
+ // - The analyzer can't prove that the local variable will be assigned before
+ // the reference based on the specification of
+ // [definite assignment](https://github.com/dart-lang/language/blob/master/resources/type-system/flow-analysis.md).
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `x` can't have a value
+ // of `null`, but is referenced before a value was assigned to it:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // String f() {
+ // int x;
+ // return [!x!].toString();
+ // }
+ // ```
+ //
+ // The following code produces this diagnostic because the assignment to `x`
+ // might not be executed, so it might have a value of `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int g(bool b) {
+ // int x;
+ // if (b) {
+ // x = 1;
+ // }
+ // return [!x!] * 2;
+ // }
+ // ```
+ //
+ // The following code produces this diagnostic because the analyzer can't
+ // prove, based on definite assignment analysis, that `x` won't be referenced
+ // without having a value assigned to it:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int h(bool b) {
+ // int x;
+ // if (b) {
+ // x = 1;
+ // }
+ // if (b) {
+ // return [!x!] * 2;
+ // }
+ // return 0;
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If `null` is a valid value, then make the variable nullable:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // String f() {
+ // int? x;
+ // return x!.toString();
+ // }
+ // ```
+ //
+ // If `null` isn’t a valid value, and there's a reasonable default value, then
+ // add an initializer:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int g(bool b) {
+ // int x = 2;
+ // if (b) {
+ // x = 1;
+ // }
+ // return x * 2;
+ // }
+ // ```
+ //
+ // Otherwise, ensure that a value was assigned on every possible code path
+ // before the value is accessed:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int g(bool b) {
+ // int x;
+ // if (b) {
+ // x = 1;
+ // } else {
+ // x = 2;
+ // }
+ // return x * 2;
+ // }
+ // ```
+ //
+ // You can also mark the variable as `late`, which removes the diagnostic, but
+ // if the variable isn't assigned a value before it's accessed, then it
+ // results in an exception being thrown at runtime. This approach should only
+ // be used if you're sure that the variable will always be assigned, even
+ // though the analyzer can't prove it based on definite assignment analysis.
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int h(bool b) {
+ // late int x;
+ // if (b) {
+ // x = 1;
+ // }
+ // if (b) {
+ // return x * 2;
+ // }
+ // return 0;
+ // }
+ // ```
static const CompileTimeErrorCode
NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE =
CompileTimeErrorCode(
'NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE',
"The non-nullable local variable '{0}' must be assigned before it "
"can be used.",
- correction: "Try giving it an initializer expression, "
- "or ensure that it is assigned on every execution path, "
- "or mark it 'late'.");
+ correction: "Try giving it an initializer expression, or ensure that "
+ "it's assigned on every execution path.");
/**
* Parameters:
@@ -4439,14 +4826,82 @@
NOT_ENOUGH_POSITIONAL_ARGUMENTS;
/**
- * It is an error if an instance field with potentially non-nullable type has
- * no initializer expression and is not initialized in a constructor via an
- * initializing formal or an initializer list entry, unless the field is
- * marked with the `late` modifier.
- *
* Parameters:
* 0: the name of the field that is not initialized
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when a field is declared and has all
+ // these characteristics:
+ // - Has a type that's <a href=”#potentially-non-nullable”>potentially
+ // non-nullable</a>
+ // - Doesn't have an initializer
+ // - Isn't marked as `late`
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `x` is implicitly
+ // initialized to `null` when it isn't allowed to be `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // int [!x!];
+ // }
+ // ```
+ //
+ // Similarly, the following code produces this diagnostic because `x` is
+ // implicitly initialized to `null`, when it isn't allowed to be `null`, by
+ // one of the constructors, even though it's initialized by other
+ // constructors:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // int x;
+ //
+ // C(this.x);
+ //
+ // [!C!].n();
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If there's a reasonable default value for the field that’s the same for all
+ // instances, then add an initializer expression:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // int x = 0;
+ // }
+ // ```
+ //
+ // If the value of the field should be provided when an instance is created,
+ // then add a constructor that sets the value of the field or update an
+ // existing constructor:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // int x;
+ //
+ // C(this.x);
+ // }
+ // ```
+ //
+ // You can also mark the field as `late`, which removes the diagnostic, but if
+ // the field isn't assigned a value before it's accessed, then it results in
+ // an exception being thrown at runtime. This approach should only be used if
+ // you're sure that the field will always be assigned before it's referenced.
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // late int x;
+ // }
+ // ```
static const CompileTimeErrorCode
NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD = CompileTimeErrorCode(
'NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD',
@@ -4456,11 +4911,6 @@
"or mark it 'late'.");
/**
- * It is an error if an instance field with potentially non-nullable type has
- * no initializer expression and is not initialized in a constructor via an
- * initializing formal or an initializer list entry, unless the field is
- * marked with the `late` modifier.
- *
* Parameters:
* 0: the name of the field that is not initialized
*/
@@ -4475,12 +4925,66 @@
"or mark it 'late'.");
/**
- * It is an error if a static field or top-level variable with potentially
- * non-nullable type has no initializer expression.
- *
* Parameters:
* 0: the name of the variable that is invalid
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when a static field or top-level
+ // variable has a type that's non-nullable and doesn't have an initializer.
+ // Fields and variables that don't have an initializer are normally
+ // initialized to `null`, but the type of the field or variable doesn't allow
+ // it to be set to `null`, so an explicit initializer must be provided.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because the field `f` can't be
+ // initialized to `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // static int [!f!];
+ // }
+ // ```
+ //
+ // Similarly, the following code produces this diagnostic because the
+ // top-level variable `v` can't be initialized to `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int [!v!];
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If the field or variable can't be initialized to `null`, then add an
+ // initializer that sets it to a non-null value:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // static int f = 0;
+ // }
+ // ```
+ //
+ // If the field or variable should be initialized to `null`, then change the
+ // type to be nullable:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int? v;
+ // ```
+ //
+ // If the field or variable can't be initialized in the declaration but will
+ // always be initialized before it's referenced, then mark it as being `late`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // static late int f;
+ // }
+ // ```
static const CompileTimeErrorCode NOT_INITIALIZED_NON_NULLABLE_VARIABLE =
CompileTimeErrorCode('NOT_INITIALIZED_NON_NULLABLE_VARIABLE',
"The non-nullable variable '{0}' must be initialized.",
@@ -4549,6 +5053,9 @@
'NOT_MAP_SPREAD', "Spread elements in map literals must implement 'Map'.",
hasPublishedDocs: true);
+ /**
+ * No parameters.
+ */
static const CompileTimeErrorCode NOT_NULL_AWARE_NULL_SPREAD =
CompileTimeErrorCode(
'NOT_NULL_AWARE_NULL_SPREAD',
@@ -4558,61 +5065,162 @@
/**
* No parameters.
*/
- /* #### Description
+ // #### Description
//
// The analyzer produces this diagnostic when a class declaration uses an
- // extends clause to specify a superclass, and the type that's specified is a
- // nullable type.
+ // extends clause to specify a superclass, and the superclass is followed by a
+ // `?`.
//
- // The reason the supertype is a _type_ rather than a class name is to allow
- // you to control the signatures of the members to be inherited from the
- // supertype, such as by specifying type arguments. However, the nullability
- // of a type doesn't change the signatures of any members, so there isn't any
- // reason to allow the nullability to be specified when used in the extends
- // clause.
+ // It isn't valid to specify a nullable superclass because doing so would have
+ // no meaning; it wouldn't change either the interface or implementation being
+ // inherited by the class containing the extends clause.
//
- // #### Examples
+ // Note, however, that it _is_ valid to use a nullable type as a type argument
+ // to the superclass, such as `class A extends B<C?> {}`.
//
- // The following code generates this diagnostic:
+ // #### Example
+ //
+ // The following code produces this diagnostic because `A?` is a nullable
+ // type, and nullable types can't be used in an extends clause:
//
// ```dart
- // class Invalid extends [!Duration?!] {}
+ // %experiments=non-nullable
+ // class A {}
+ // class B extends [!A?!] {}
// ```
//
// #### Common fixes
//
- // The most common fix is to remove the question mark:
+ // Remove the question mark from the type:
//
// ```dart
- // class Invalid extends Duration {}
- // ``` */
+ // %experiments=non-nullable
+ // class A {}
+ // class B extends A {}
+ // ```
static const CompileTimeErrorCode NULLABLE_TYPE_IN_EXTENDS_CLAUSE =
CompileTimeErrorCode('NULLABLE_TYPE_IN_EXTENDS_CLAUSE',
"A class can't extend a nullable type.",
correction: "Try removing the question mark.");
/**
- * It is a compile-time error for a class to extend, implement, or mixin a
- * type of the form T? for any T.
+ * No parameters.
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when a class or mixin declaration has
+ // an implements clause, and an interface is followed by a `?`.
+ //
+ // It isn't valid to specify a nullable interface because doing so would have
+ // no meaning; it wouldn't change the interface being inherited by the class
+ // containing the implements clause.
+ //
+ // Note, however, that it _is_ valid to use a nullable type as a type argument
+ // to the interface, such as `class A implements B<C?> {}`.
+ //
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `A?` is a nullable
+ // type, and nullable types can't be used in an implements clause:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class A {}
+ // class B implements [!A?!] {}
+ // ```
+ //
+ // #### Common fixes
+ //
+ // Remove the question mark from the type:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class A {}
+ // class B implements A {}
+ // ```
static const CompileTimeErrorCode NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE =
CompileTimeErrorCode('NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE',
"A class or mixin can't implement a nullable type.",
correction: "Try removing the question mark.");
/**
- * It is a compile-time error for a class to extend, implement, or mixin a
- * type of the form T? for any T.
+ * No parameters.
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when a mixin declaration uses an on
+ // clause to specify a superclass constraint, and the class that's specified
+ // is followed by a `?`.
+ //
+ // It isn't valid to specify a nullable superclass constraint because doing so
+ // would have no meaning; it wouldn't change the interface being depended on
+ // by the mixin containing the on clause.
+ //
+ // Note, however, that it _is_ valid to use a nullable type as a type argument
+ // to the superclass constraint, such as `mixin A on B<C?> {}`.
+ //
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `A?` is a nullable type
+ // and nullable types can't be used in an on clause:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {}
+ // mixin M on [!C?!] {}
+ // ```
+ //
+ // #### Common fixes
+ //
+ // Remove the question mark from the type:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {}
+ // mixin M on C {}
+ // ```
static const CompileTimeErrorCode NULLABLE_TYPE_IN_ON_CLAUSE =
CompileTimeErrorCode('NULLABLE_TYPE_IN_ON_CLAUSE',
"A mixin can't have a nullable type as a superclass constraint.",
correction: "Try removing the question mark.");
/**
- * It is a compile-time error for a class to extend, implement, or mixin a
- * type of the form T? for any T.
+ * No parameters.
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when a class or mixin declaration has
+ // a with clause, and a mixin is followed by a `?`.
+ //
+ // It isn't valid to specify a nullable mixin because doing so would have no
+ // meaning; it wouldn't change either the interface or implementation being
+ // inherited by the class containing the with clause.
+ //
+ // Note, however, that it _is_ valid to use a nullable type as a type argument
+ // to the mixin, such as `class A with B<C?> {}`.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `A?` is a nullable
+ // type, and nullable types can't be used in a with clause:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // mixin M {}
+ // class C with [!M?!] {}
+ // ```
+ //
+ // #### Common fixes
+ //
+ // Remove the question mark from the type:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // mixin M {}
+ // class C with M {}
+ // ```
static const CompileTimeErrorCode NULLABLE_TYPE_IN_WITH_CLAUSE =
CompileTimeErrorCode('NULLABLE_TYPE_IN_WITH_CLAUSE',
"A class or mixin can't mix in a nullable type.",
@@ -5158,12 +5766,40 @@
correction: "Try adding 'break', or 'return', etc.");
/**
- * It is an error if the static type of `e` in the expression `throw e` is
- * not assignable to `Object`.
+ * Parameters:
+ * 0: the type that can't be thrown
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when the type of the expression in a
+ // throw expression is not assignable to `Object`. It’s not valid to throw
+ // `null`, so it isn't valid to use an expression that might evaluate to
+ // `null`.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `s` might be `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(String? s) {
+ // throw [!s!];
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // Add an explicit null check to the expression:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(String? s) {
+ // throw s!;
+ // }
+ // ```
static const CompileTimeErrorCode THROW_OF_INVALID_TYPE = CompileTimeErrorCode(
'THROW_OF_INVALID_TYPE',
- "The type '{0}' of the thrown expression must be assignable to Object.");
+ "The type '{0}' of the thrown expression must be assignable to 'Object'.");
/**
* Parameters:
@@ -7758,15 +8394,90 @@
INSTANTIATE_ABSTRACT_CLASS;
/**
- * It is a warning to use null aware operators '??' or '??=' on an
- * expression of type `T` if `T` is strictly non-nullable.
- *
* No parameters.
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic in two cases.
+ //
+ // The first is when the left operand of an `??` operator can't be `null`.
+ // The right operand is only evaluated if the left operand has the value
+ // `null`, and because the left operand can't be `null`, the right operand is
+ // never evaluated.
+ //
+ // The second is when the left-hand side of an assignment using the `??=`
+ // operator can't be `null`. The right-hand side is only evaluated if the
+ // left-hand side has the value `null`, and because the left-hand side can't
+ // be `null`, the right-hand side is never evaluated.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `x` can't be `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int f(int x) {
+ // return x ?? [!0!];
+ // }
+ // ```
+ //
+ // The following code produces this diagnostic because `f` can't be `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // int f = -1;
+ //
+ // void m(int x) {
+ // f ??= [!x!];
+ // }
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If the diagnostic is reported for an `??` operator, then remove the `??`
+ // operator and the right operand:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int f(int x) {
+ // return x;
+ // }
+ // ```
+ //
+ // If the diagnostic is reported for an assignment, and the assignment isn't
+ // needed, then remove the assignment:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // int f = -1;
+ //
+ // void m(int x) {
+ // }
+ // }
+ // ```
+ //
+ // If the assignment is needed, but should be based on a different condition,
+ // then rewrite the code to use `=` and the different condition:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // class C {
+ // int f = -1;
+ //
+ // void m(int x) {
+ // if (f < 0) {
+ // f = x;
+ // }
+ // }
+ // }
+ // ```
static const StaticWarningCode DEAD_NULL_AWARE_EXPRESSION = StaticWarningCode(
'DEAD_NULL_AWARE_EXPRESSION',
"The left operand can't be null, so the right operand is never executed.",
- correction: "Try removing the right operand.",
+ correction: "Try removing the operator and the right operand.",
errorSeverity: ErrorSeverity.WARNING);
/**
@@ -8130,6 +8841,45 @@
* 0: The null-aware operator that is invalid
* 1: The non-null-aware operator that can replace the invalid operator
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when a null-aware operator (`?.`,
+ // `?..`, `?[`, `?..[`, or `...?`) is used on a target that's known to be
+ // non-nullable.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `s` can't be `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int? getLength(String s) {
+ // return s[!?.!]length;
+ // }
+ // ```
+ //
+ // The following code produces this diagnostic because `a` can't be `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // var a = [];
+ // var b = [[!...?!]a];
+ // ```
+ //
+ // #### Common fixes
+ //
+ // Replace the null-aware operator with a non-null-aware equivalent, such as
+ // replacing '?.' with '.':
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int getLength(String s) {
+ // return s.length;
+ // }
+ // ```
+ //
+ // (Note that the return type was also changed to be non-nullable, which might
+ // not be appropriate in some cases.)
static const StaticWarningCode INVALID_NULL_AWARE_OPERATOR =
StaticWarningCode(
'INVALID_NULL_AWARE_OPERATOR',
@@ -8170,24 +8920,40 @@
errorSeverity: ErrorSeverity.WARNING);
/**
- * For the purposes of experimenting with potential non-null type semantics.
- *
- * Whereas [UNCHECKED_USE_OF_NULLABLE] refers to using a value of type T? as
- * if it were a T, this refers to using a value of type [Null] itself. These
- * occur at many of the same times ([Null] is a potentially nullable type) but
- * it indicates a different type of programmer error and has different
- * corrections.
- *
* No parameters.
*/
- static const StaticWarningCode INVALID_USE_OF_NULL_VALUE =
- StaticWarningCodeWithUniqueName(
- 'USE_OF_NULLABLE_VALUE',
- 'INVALID_USE_OF_NULL_VALUE',
- "This expression is invalid as it will always be null.",
- correction:
- "Try changing the type, or casting, to a more useful type like "
- "dynamic.");
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when an expression whose value will
+ // always be `null` is dererenced.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `x` will always be
+ // `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int f(Null x) {
+ // return [!x!].length;
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If the value is allowed to be something other than `null`, then change the
+ // type of the expression:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int f(String? x) {
+ // return x!.length;
+ // }
+ // ```
+ static const StaticWarningCode INVALID_USE_OF_NULL_VALUE = StaticWarningCode(
+ 'INVALID_USE_OF_NULL_VALUE',
+ "An expression whose value is always 'null' can't be dereferenced.",
+ correction: "Try changing the type of the expression.");
/**
* Parameters:
@@ -9133,29 +9899,111 @@
CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER;
/**
- * For the purposes of experimenting with potential non-null type semantics.
- *
* No parameters.
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when an expression whose type is
+ // <a href=”#potentially-non-nullable”>potentially non-nullable</a> is
+ // dereferenced without first verifying that the value isn't `null`.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `s` can be `null` at
+ // the point where it's referenced:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(String? s) {
+ // if ([!s!].length > 3) {
+ // // ...
+ // }
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // If the value really can be `null`, then add a test to ensure that members
+ // are only accessed when the value isn't `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(String? s) {
+ // if (s != null && s.length > 3) {
+ // // ...
+ // }
+ // }
+ // ```
+ //
+ // If the expression is a variable and the value should never be `null`, then
+ // change the type of the variable to be non-nullable:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(String s) {
+ // if (s.length > 3) {
+ // // ...
+ // }
+ // }
+ // ```
+ //
+ // If you believe that the value of the expression should never be `null`, but
+ // you can't change the type of the variable, and you're willing to risk
+ // having an exception thrown at runtime if you're wrong, then you can assert
+ // that the value isn't null:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // void f(String? s) {
+ // if (s!.length > 3) {
+ // // ...
+ // }
+ // }
+ // ```
static const StaticWarningCode UNCHECKED_USE_OF_NULLABLE_VALUE =
- StaticWarningCodeWithUniqueName(
- 'USE_OF_NULLABLE_VALUE',
+ StaticWarningCode(
'UNCHECKED_USE_OF_NULLABLE_VALUE',
- "The expression is nullable and must be null-checked before it can "
- "be used.",
+ "An expression whose value can be 'null' must be null-checked before "
+ "it can be dereferenced.",
correction:
- "Try checking that the value isn't null before using it.");
+ "Try checking that the value isn't 'null' before dereferencing "
+ "it.");
/**
- * When the '!' operator is used on a value that we know to be non-null,
- * it is unnecessary.
+ * No parameters.
*/
+ // #### Description
+ //
+ // The analyzer produces this diagnostic when the operand of the `!` operator
+ // can't be `null`.
+ //
+ // #### Example
+ //
+ // The following code produces this diagnostic because `x` can't be `null`:
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int f(int x) {
+ // return x[!!!];
+ // }
+ // ```
+ //
+ // #### Common fixes
+ //
+ // Remove the null check operator (`!`):
+ //
+ // ```dart
+ // %experiments=non-nullable
+ // int f(int x) {
+ // return x;
+ // }
+ // ```
static const StaticWarningCode UNNECESSARY_NON_NULL_ASSERTION =
StaticWarningCode(
'UNNECESSARY_NON_NULL_ASSERTION',
- "The '!' will have no effect because the target expression cannot be"
+ "The '!' will have no effect because the target expression can't be"
" null.",
- correction: "Try removing the '!' operator here.",
+ correction: "Try removing the '!' operator.",
errorSeverity: ErrorSeverity.WARNING);
/**
diff --git a/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart b/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
index c91c0d1..8571632 100644
--- a/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
+++ b/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
@@ -27,11 +27,11 @@
part 'stream.dart';
abstract class Future<T> {
- factory Future(computation()) {
+ factory Future(FutureOr<T> computation()) {
throw 0;
}
- factory Future.delayed(Duration duration, [T computation()?]) {
+ factory Future.delayed(Duration duration, [FutureOr<T> computation()?]) {
throw 0;
}
@@ -251,6 +251,10 @@
void print(Object? object) {}
+class ArgumentError extends Error {
+ ArgumentError([message]);
+}
+
abstract class bool extends Object {
external const factory bool.fromEnvironment(String name,
{bool defaultValue: false});
diff --git a/pkg/analyzer/test/src/dart/resolution/try_statement_test.dart b/pkg/analyzer/test/src/dart/resolution/try_statement_test.dart
index 6f5c306..2b544e6 100644
--- a/pkg/analyzer/test/src/dart/resolution/try_statement_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/try_statement_test.dart
@@ -5,15 +5,21 @@
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
+import '../constant/potentially_constant_test.dart';
import 'driver_resolution.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(TryStatementTest);
+ defineReflectiveTests(TryStatementNullSafetyTest);
});
}
@reflectiveTest
+class TryStatementNullSafetyTest extends TryStatementTest
+ with WithNullSafetyMixin {}
+
+@reflectiveTest
class TryStatementTest extends DriverResolutionTest {
test_catch_withoutType() async {
await assertNoErrorsInCode(r'''
@@ -26,7 +32,10 @@
var e = findElement.localVar('e');
expect(e.isFinal, isTrue);
- assertTypeDynamic(e.type);
+ assertType(
+ e.type,
+ typeStringByNullability(nullable: 'Object', legacy: 'dynamic'),
+ );
var st = findElement.localVar('st');
expect(st.isFinal, isTrue);
diff --git a/pkg/analyzer/test/verify_diagnostics_test.dart b/pkg/analyzer/test/verify_diagnostics_test.dart
index 97dd440..5cd6fd9 100644
--- a/pkg/analyzer/test/verify_diagnostics_test.dart
+++ b/pkg/analyzer/test/verify_diagnostics_test.dart
@@ -49,8 +49,14 @@
'HintCode.DEPRECATED_MEMBER_USE',
// Needs to be able to specify two expected diagnostics.
'StaticWarningCode.AMBIGUOUS_IMPORT',
+ // Produces two diagnostics when it should only produce one.
+ 'StaticWarningCode.INVALID_USE_OF_NULL_VALUE',
];
+ /// The prefix used on directive lines to specify the experiments that should
+ /// be enabled for a snippet.
+ static const String experimentsPrefix = '%experiments=';
+
/// The prefix used on directive lines to indicate the uri of an auxiliary
/// file that is needed for testing purposes.
static const String uriDirectivePrefix = '%uri="';
@@ -130,19 +136,19 @@
return docs;
}
- _SnippetData _extractSnippetData(
- String snippet, bool errorRequired, Map<String, String> auxiliaryFiles) {
+ _SnippetData _extractSnippetData(String snippet, bool errorRequired,
+ Map<String, String> auxiliaryFiles, List<String> experiments) {
int rangeStart = snippet.indexOf(errorRangeStart);
if (rangeStart < 0) {
if (errorRequired) {
_reportProblem('No error range in example');
}
- return _SnippetData(snippet, -1, 0, auxiliaryFiles);
+ return _SnippetData(snippet, -1, 0, auxiliaryFiles, experiments);
}
int rangeEnd = snippet.indexOf(errorRangeEnd, rangeStart + 1);
if (rangeEnd < 0) {
_reportProblem('No end of error range in example');
- return _SnippetData(snippet, -1, 0, auxiliaryFiles);
+ return _SnippetData(snippet, -1, 0, auxiliaryFiles, experiments);
} else if (snippet.indexOf(errorRangeStart, rangeEnd) > 0) {
_reportProblem('More than one error range in example');
}
@@ -152,33 +158,43 @@
snippet.substring(rangeEnd + errorRangeEnd.length),
rangeStart,
rangeEnd - rangeStart - 2,
- auxiliaryFiles);
+ auxiliaryFiles,
+ experiments);
}
/// Extract the snippets of Dart code between the start (inclusive) and end
/// (exclusive) indexes.
List<_SnippetData> _extractSnippets(
List<String> lines, int start, int end, bool errorRequired) {
- List<_SnippetData> snippets = [];
- Map<String, String> auxiliaryFiles = <String, String>{};
- int currentStart = -1;
- for (int i = start; i < end; i++) {
- String line = lines[i];
+ var snippets = <_SnippetData>[];
+ var auxiliaryFiles = <String, String>{};
+ List<String> experiments;
+ var currentStart = -1;
+ for (var i = start; i < end; i++) {
+ var line = lines[i];
if (line == '```') {
if (currentStart < 0) {
_reportProblem('Snippet without file type on line $i.');
return snippets;
}
- String secondLine = lines[currentStart + 1];
+ var secondLine = lines[currentStart + 1];
if (secondLine.startsWith(uriDirectivePrefix)) {
- String name = secondLine.substring(
+ var name = secondLine.substring(
uriDirectivePrefix.length, secondLine.length - 1);
- String content = lines.sublist(currentStart + 2, i).join('\n');
+ var content = lines.sublist(currentStart + 2, i).join('\n');
auxiliaryFiles[name] = content;
} else if (lines[currentStart] == '```dart') {
- String content = lines.sublist(currentStart + 1, i).join('\n');
- snippets
- .add(_extractSnippetData(content, errorRequired, auxiliaryFiles));
+ if (secondLine.startsWith(experimentsPrefix)) {
+ experiments = secondLine
+ .substring(experimentsPrefix.length)
+ .split(',')
+ .map((e) => e.trim())
+ .toList();
+ currentStart++;
+ }
+ var content = lines.sublist(currentStart + 1, i).join('\n');
+ snippets.add(_extractSnippetData(
+ content, errorRequired, auxiliaryFiles, experiments));
auxiliaryFiles = <String, String>{};
}
currentStart = -1;
@@ -246,6 +262,9 @@
if (docs != null) {
VariableDeclaration variable = member.fields.variables[0];
codeName = _extractCodeName(variable);
+ if (codeName == 'NULLABLE_TYPE_IN_CATCH_CLAUSE') {
+ DateTime.now();
+ }
variableName = '$className.${variable.name.name}';
if (unverifiedDocs.contains(variableName)) {
continue;
@@ -366,8 +385,10 @@
final int offset;
final int length;
final Map<String, String> auxiliaryFiles;
+ final List<String> experiments;
- _SnippetData(this.content, this.offset, this.length, this.auxiliaryFiles);
+ _SnippetData(this.content, this.offset, this.length, this.auxiliaryFiles,
+ this.experiments);
}
/// A test class that creates an environment suitable for analyzing the
@@ -381,9 +402,8 @@
/// Initialize a newly created test to test the given [snippet].
_SnippetTest(this.snippet) {
- analysisOptions.contextFeatures = FeatureSet.fromEnableFlags(
- ['extension-methods'],
- );
+ analysisOptions.contextFeatures =
+ FeatureSet.fromEnableFlags(snippet.experiments ?? []);
String pubspecContent = snippet.auxiliaryFiles['pubspec.yaml'];
if (pubspecContent != null) {
for (String line in pubspecContent.split('\n')) {
diff --git a/pkg/analyzer/tool/diagnostics/diagnostics.md b/pkg/analyzer/tool/diagnostics/diagnostics.md
index bd24cb1..4ac0e53 100644
--- a/pkg/analyzer/tool/diagnostics/diagnostics.md
+++ b/pkg/analyzer/tool/diagnostics/diagnostics.md
@@ -57,6 +57,22 @@
}
```
+### Potentially non-nullable
+
+A type is _potentially non-nullable_ if it's either explicitly non-nullable or
+if it's a type parameter.
+
+A type is explicitly non-nullable if it is a type name that is not followed by a
+question mark. Note that there are a few types that are always nullable, such as
+`Null` and `dynamic`, and that `FutureOr` is only non-nullable if it is not
+followed by a question mark _and_ the type argument is non-nullable (such as
+`FutureOr<String>`).
+
+Type parameters are potentially non-nullable because the actual runtime type
+(the type specified as a type argument) might be non-nullable. For example,
+given a declaration of `class C<T> {}`, the type `C` could be used with a
+non-nullable type argument as in `C<int>`.
+
## Diagnostics
The analyzer produces the following diagnostics for code that
@@ -557,6 +573,82 @@
Rewrite the code so that there isn't an assignment to a method.
+### body_might_complete_normally
+
+_The body might complete normally, causing 'null' to be returned, but the return
+type is a potentially non-nullable type._
+
+#### Description
+
+The analyzer produces this diagnostic when a method or function has a
+return type that's <a href=”#potentially-non-nullable”>potentially
+non-nullable</a> but would implicitly return `null` if control reached the
+end of the function.
+
+#### Example
+
+The following code produces this diagnostic because the method `m` has an
+implicit return of `null` inserted at the end of the method, but the method
+is declared to not return `null`:
+
+{% prettify dart %}
+class C {
+ int [!m!](int t) {
+ print(t);
+ }
+}
+{% endprettify %}
+
+The following code produces this diagnostic because the method `m` has an
+implicit return of `null` inserted at the end of the method, but because
+the class `C` can be instantiated with a non-nullable type argument, the
+method is effectively declared to not return `null`:
+
+{% prettify dart %}
+class C<T> {
+ T [!m!](T t) {
+ print(t);
+ }
+}
+{% endprettify %}
+
+#### Common fixes
+
+If there's a reasonable value that can be returned, then add a return
+statement at the end of the method:
+
+{% prettify dart %}
+class C<T> {
+ T m(T t) {
+ print(t);
+ return t;
+ }
+}
+{% endprettify %}
+
+If the method won't reach the implicit return, then add a throw at the end
+of the method:
+
+{% prettify dart %}
+class C<T> {
+ T m(T t) {
+ print(t);
+ throw '';
+ }
+}
+{% endprettify %}
+
+If the method intentionally returns `null` at the end, then change the
+return type so that it's valid to return `null`:
+
+{% prettify dart %}
+class C<T> {
+ T? m(T t) {
+ print(t);
+ }
+}
+{% endprettify %}
+
### built_in_identifier_as_extension_name
_The built-in identifier '{0}' can't be used as an extension name._
@@ -648,6 +740,57 @@
}
{% endprettify %}
+### case_expression_type_is_not_switch_expression_subtype
+
+_The switch case expression type '{0}' must be a subtype of the switch
+expression type '{1}'._
+
+#### Description
+
+The analyzer produces this diagnostic when the expression following `case`
+in a switch statement has a static type that isn't a subtype of the static
+type of the expression following `switch`.
+
+#### Example
+
+The following code produces this diagnostic because `1` is an `int`, which
+isn't a subtype of `String` (the type of `s`):
+
+{% prettify dart %}
+void f(String s) {
+ switch (s) {
+ case [!1!]:
+ break;
+ }
+}
+{% endprettify %}
+
+#### Common fixes
+
+If the value of the case expression is wrong, then change the case
+expression so that it has the required type:
+
+{% prettify dart %}
+void f(String s) {
+ switch (s) {
+ case '1':
+ break;
+ }
+}
+{% endprettify %}
+
+If the value of the case expression is correct, then change the switch
+expression to have the required type:
+
+{% prettify dart %}
+void f(int s) {
+ switch (s) {
+ case 1:
+ break;
+ }
+}
+{% endprettify %}
+
### cast_to_non_type
_The name '{0}' isn't a type, so it can't be used in an 'as' expression._
@@ -1156,6 +1299,160 @@
}
{% endprettify %}
+### dead_null_aware_expression
+
+_The left operand can't be null, so the right operand is never executed._
+
+#### Description
+
+The analyzer produces this diagnostic in two cases.
+
+The first is when the left operand of an `??` operator can't be `null`.
+The right operand is only evaluated if the left operand has the value
+`null`, and because the left operand can't be `null`, the right operand is
+never evaluated.
+
+The second is when the left-hand side of an assignment using the `??=`
+operator can't be `null`. The right-hand side is only evaluated if the
+left-hand side has the value `null`, and because the left-hand side can't
+be `null`, the right-hand side is never evaluated.
+
+#### Example
+
+The following code produces this diagnostic because `x` can't be `null`:
+
+{% prettify dart %}
+int f(int x) {
+ return x ?? [!0!];
+}
+{% endprettify %}
+
+The following code produces this diagnostic because `f` can't be `null`:
+
+{% prettify dart %}
+class C {
+ int f = -1;
+
+ void m(int x) {
+ f ??= [!x!];
+ }
+}
+{% endprettify %}
+
+#### Common fixes
+
+If the diagnostic is reported for an `??` operator, then remove the `??`
+operator and the right operand:
+
+{% prettify dart %}
+int f(int x) {
+ return x;
+}
+{% endprettify %}
+
+If the diagnostic is reported for an assignment, and the assignment isn't
+needed, then remove the assignment:
+
+{% prettify dart %}
+class C {
+ int f = -1;
+
+ void m(int x) {
+ }
+}
+{% endprettify %}
+
+If the assignment is needed, but should be based on a different condition,
+then rewrite the code to use `=` and the different condition:
+
+{% prettify dart %}
+class C {
+ int f = -1;
+
+ void m(int x) {
+ if (f < 0) {
+ f = x;
+ }
+ }
+}
+{% endprettify %}
+
+### default_list_constructor
+
+_Calling the default 'List' constructor causes an error._
+
+#### Description
+
+The analyzer produces this diagnostic when it finds a use of the default
+constructor for the class `List` in code that has opted in to null safety.
+
+#### Example
+
+Assuming the following code is opted in to null safety, it produces this
+diagnostic because it uses the default `List` constructor:
+
+{% prettify dart %}
+var l = [!List<int>!]();
+{% endprettify %}
+
+#### Common fixes
+
+If no initial size is provided, then convert the code to use a list
+literal:
+
+{% prettify dart %}
+var l = <int>[];
+{% endprettify %}
+
+If an initial size needs to be provided and there is a single reasonable
+initial value for the elements, then use `List.filled`:
+
+{% prettify dart %}
+var l = List.filled(3, 0);
+{% endprettify %}
+
+If an initial size needs to be provided but each element needs to be
+computed, then use `List.generate`:
+
+{% prettify dart %}
+var l = List.generate(3, (i) => i);
+{% endprettify %}
+
+### definitely_unassigned_late_local_variable
+
+_The late local variable '{0}' is definitely unassigned at this point._
+
+#### Description
+
+The analyzer produces this diagnostic when
+[definite assignment](https://github.com/dart-lang/language/blob/master/resources/type-system/flow-analysis.md)
+analysis shows that a local variable that's marked as `late` is read before
+being assigned.
+
+#### Example
+
+The following code produces this diagnostic because `x` was not assigned a
+value before being read:
+
+{% prettify dart %}
+void f(bool b) {
+ late int x;
+ print([!x!]);
+}
+{% endprettify %}
+
+#### Common fixes
+
+Assign a value to the variable before reading from it:
+
+{% prettify dart %}
+void f(bool b) {
+ late int x;
+ x = b ? 1 : 0;
+ print(x);
+}
+{% endprettify %}
+
### deprecated_member_use
_'{0}' is deprecated and shouldn't be used._
@@ -1468,6 +1765,56 @@
of which entry to remove might affect the order in which keys and values
are returned by an iterator.
+### export_legacy_symbol
+
+_The symbol '{0}' is defined in a legacy library, and can't be re-exported from
+a non-nullable by default library._
+
+#### Description
+
+The analyzer produces this diagnostic when a library that was opted in to
+null safety exports another library, and the exported library is opted out
+of null safety.
+
+#### Example
+
+Given a library that is opted out of null safety:
+
+{% prettify dart %}
+// @dart = 2.9
+String s;
+{% endprettify %}
+
+The following code produces this diagnostic because it's exporting symbols
+from an opted-out library:
+
+{% prettify dart %}
+export [!'optedOut.dart'!];
+
+class C {}
+{% endprettify %}
+
+#### Common fixes
+
+If you're able to do so, migrate the exported library so that it doesn't
+need to opt out:
+
+{% prettify dart %}
+String? s;
+{% endprettify %}
+
+If you can't migrate the library, then remove the export:
+
+{% prettify dart %}
+class C {}
+{% endprettify %}
+
+If the exported library (the one that is opted out) itself exports an
+opted-in library, then it's valid for your library to indirectly export the
+symbols from the opted-in library. You can do so by adding a hide
+combinator to the export directive in your library that hides all of the
+names declared in the opted-out library.
+
### expression_in_map
_Expressions can't be used in a map literal._
@@ -2749,6 +3096,48 @@
var x;
{% endprettify %}
+### invalid_null_aware_operator
+
+_The target expression can't be null, so the null-aware operator '{0}' can't be
+used._
+
+#### Description
+
+The analyzer produces this diagnostic when a null-aware operator (`?.`,
+`?..`, `?[`, `?..[`, or `...?`) is used on a target that's known to be
+non-nullable.
+
+#### Example
+
+The following code produces this diagnostic because `s` can't be `null`:
+
+{% prettify dart %}
+int? getLength(String s) {
+ return s[!?.!]length;
+}
+{% endprettify %}
+
+The following code produces this diagnostic because `a` can't be `null`:
+
+{% prettify dart %}
+var a = [];
+var b = [[!...?!]a];
+{% endprettify %}
+
+#### Common fixes
+
+Replace the null-aware operator with a non-null-aware equivalent, such as
+replacing '?.' with '.':
+
+{% prettify dart %}
+int getLength(String s) {
+ return s.length;
+}
+{% endprettify %}
+
+(Note that the return type was also changed to be non-nullable, which might
+not be appropriate in some cases.)
+
### invalid_override
_'{1}.{0}' ('{2}') isn't a valid override of '{3}.{0}' ('{4}')._
@@ -2897,6 +3286,37 @@
}
{% endprettify %}
+### invalid_use_of_null_value
+
+_An expression whose value is always 'null' can't be dereferenced._
+
+#### Description
+
+The analyzer produces this diagnostic when an expression whose value will
+always be `null` is dererenced.
+
+#### Example
+
+The following code produces this diagnostic because `x` will always be
+`null`:
+
+{% prettify dart %}
+int f(Null x) {
+ return [!x!].length;
+}
+{% endprettify %}
+
+#### Common fixes
+
+If the value is allowed to be something other than `null`, then change the
+type of the expression:
+
+{% prettify dart %}
+int f(String? x) {
+ return x!.length;
+}
+{% endprettify %}
+
### invalid_visibility_annotation
_The member '{0}' is annotated with '{1}', but this annotation is only
@@ -3205,6 +3625,59 @@
var m = <String, int>{'a' : 2};
{% endprettify %}
+### missing_default_value_for_parameter
+
+_The parameter '{0}' can't have a value of 'null' because of its type, and no
+non-null default value is provided._
+
+#### Description
+
+The analyzer produces this diagnostic when an optional parameter, whether
+positional or named, has a <a href=”#potentially-non-nullable”>potentially
+non-nullable</a> type and doesn't specify a default value. Optional
+parameters that have no explicit default value have an implicit default
+value of `null`. If the type of the parameter doesn't allow the parameter
+to have a value of `null`, then the implicit default value isn't valid.
+
+#### Example
+
+The following code produces this diagnostic because `x` can't be `null`,
+and no non-`null` default value is specified:
+
+{% prettify dart %}
+void f([int [!x!]]) {}
+{% endprettify %}
+
+As does this:
+
+{% prettify dart %}
+void g({int [!x!]}) {}
+{% endprettify %}
+
+#### Common fixes
+
+If you want to use `null` to indicate that no value was provided, then you
+need to make the type nullable:
+
+{% prettify dart %}
+void f([int? x]) {}
+void g({int? x}) {}
+{% endprettify %}
+
+If the parameter can't be null, then either provide a default value:
+
+{% prettify dart %}
+void f([int x = 1]) {}
+void g({int x = 2}) {}
+{% endprettify %}
+
+or make the parameter a required parameter:
+
+{% prettify dart %}
+void f(int x) {}
+void g({required int x}) {}
+{% endprettify %}
+
### missing_enum_constant_in_switch
_Missing case clause for '{0}'._
@@ -3267,6 +3740,38 @@
}
{% endprettify %}
+### missing_required_argument
+
+_The named parameter '{0}' is required, but there's no corresponding argument._
+
+#### Description
+
+The analyzer produces this diagnostic when an invocation of a function is
+missing a required named parameter.
+
+#### Example
+
+The following code produces this diagnostic because the invocation of `f`
+doesn't include a value for the required named parameter `end`:
+
+{% prettify dart %}
+void f(int start, {required int end}) {}
+void g() {
+ [!f!](3);
+}
+{% endprettify %}
+
+#### Common fixes
+
+Add a named argument corresponding to the missing required parameter:
+
+{% prettify dart %}
+void f(int start, {required int end}) {}
+void g() {
+ f(3, end: 5);
+}
+{% endprettify %}
+
### missing_required_param
_The parameter '{0}' is required._
@@ -4159,6 +4664,122 @@
}
{% endprettify %}
+### not_assigned_potentially_non_nullable_local_variable
+
+_The non-nullable local variable '{0}' must be assigned before it can be used._
+
+#### Description
+
+The analyzer produces this diagnostic when a local variable is referenced
+and has all these characteristics:
+- Has a type that's <a href=”#potentially-non-nullable”>potentially
+ non-nullable</a>.
+- Doesn't have an initializer.
+- Isn't marked as `late`.
+- The analyzer can't prove that the local variable will be assigned before
+ the reference based on the specification of
+ [definite assignment](https://github.com/dart-lang/language/blob/master/resources/type-system/flow-analysis.md).
+
+#### Example
+
+The following code produces this diagnostic because `x` can't have a value
+of `null`, but is referenced before a value was assigned to it:
+
+{% prettify dart %}
+String f() {
+ int x;
+ return [!x!].toString();
+}
+{% endprettify %}
+
+The following code produces this diagnostic because the assignment to `x`
+might not be executed, so it might have a value of `null`:
+
+{% prettify dart %}
+int g(bool b) {
+ int x;
+ if (b) {
+ x = 1;
+ }
+ return [!x!] * 2;
+}
+{% endprettify %}
+
+The following code produces this diagnostic because the analyzer can't
+prove, based on definite assignment analysis, that `x` won't be referenced
+without having a value assigned to it:
+
+{% prettify dart %}
+int h(bool b) {
+ int x;
+ if (b) {
+ x = 1;
+ }
+ if (b) {
+ return [!x!] * 2;
+ }
+ return 0;
+}
+{% endprettify %}
+
+#### Common fixes
+
+If `null` is a valid value, then make the variable nullable:
+
+{% prettify dart %}
+String f() {
+ int? x;
+ return x!.toString();
+}
+{% endprettify %}
+
+If `null` isn’t a valid value, and there's a reasonable default value, then
+add an initializer:
+
+{% prettify dart %}
+int g(bool b) {
+ int x = 2;
+ if (b) {
+ x = 1;
+ }
+ return x * 2;
+}
+{% endprettify %}
+
+Otherwise, ensure that a value was assigned on every possible code path
+before the value is accessed:
+
+{% prettify dart %}
+int g(bool b) {
+ int x;
+ if (b) {
+ x = 1;
+ } else {
+ x = 2;
+ }
+ return x * 2;
+}
+{% endprettify %}
+
+You can also mark the variable as `late`, which removes the diagnostic, but
+if the variable isn't assigned a value before it's accessed, then it
+results in an exception being thrown at runtime. This approach should only
+be used if you're sure that the variable will always be assigned, even
+though the analyzer can't prove it based on definite assignment analysis.
+
+{% prettify dart %}
+int h(bool b) {
+ late int x;
+ if (b) {
+ x = 1;
+ }
+ if (b) {
+ return x * 2;
+ }
+ return 0;
+}
+{% endprettify %}
+
### not_a_type
_{0} isn't a type._
@@ -4214,6 +4835,138 @@
}
{% endprettify %}
+### not_initialized_non_nullable_instance_field
+
+_Non-nullable instance field '{0}' must be initialized._
+
+_Non-nullable instance field '{0}' must be initialized._
+
+#### Description
+
+The analyzer produces this diagnostic when a field is declared and has all
+these characteristics:
+- Has a type that's <a href=”#potentially-non-nullable”>potentially
+ non-nullable</a>
+- Doesn't have an initializer
+- Isn't marked as `late`
+
+#### Example
+
+The following code produces this diagnostic because `x` is implicitly
+initialized to `null` when it isn't allowed to be `null`:
+
+{% prettify dart %}
+class C {
+ int [!x!];
+}
+{% endprettify %}
+
+Similarly, the following code produces this diagnostic because `x` is
+implicitly initialized to `null`, when it isn't allowed to be `null`, by
+one of the constructors, even though it's initialized by other
+constructors:
+
+{% prettify dart %}
+class C {
+ int x;
+
+ C(this.x);
+
+ [!C!].n();
+}
+{% endprettify %}
+
+#### Common fixes
+
+If there's a reasonable default value for the field that’s the same for all
+instances, then add an initializer expression:
+
+{% prettify dart %}
+class C {
+ int x = 0;
+}
+{% endprettify %}
+
+If the value of the field should be provided when an instance is created,
+then add a constructor that sets the value of the field or update an
+existing constructor:
+
+{% prettify dart %}
+class C {
+ int x;
+
+ C(this.x);
+}
+{% endprettify %}
+
+You can also mark the field as `late`, which removes the diagnostic, but if
+the field isn't assigned a value before it's accessed, then it results in
+an exception being thrown at runtime. This approach should only be used if
+you're sure that the field will always be assigned before it's referenced.
+
+{% prettify dart %}
+class C {
+ late int x;
+}
+{% endprettify %}
+
+### not_initialized_non_nullable_variable
+
+_The non-nullable variable '{0}' must be initialized._
+
+#### Description
+
+The analyzer produces this diagnostic when a static field or top-level
+variable has a type that's non-nullable and doesn't have an initializer.
+Fields and variables that don't have an initializer are normally
+initialized to `null`, but the type of the field or variable doesn't allow
+it to be set to `null`, so an explicit initializer must be provided.
+
+#### Example
+
+The following code produces this diagnostic because the field `f` can't be
+initialized to `null`:
+
+{% prettify dart %}
+class C {
+ static int [!f!];
+}
+{% endprettify %}
+
+Similarly, the following code produces this diagnostic because the
+top-level variable `v` can't be initialized to `null`:
+
+{% prettify dart %}
+int [!v!];
+{% endprettify %}
+
+#### Common fixes
+
+If the field or variable can't be initialized to `null`, then add an
+initializer that sets it to a non-null value:
+
+{% prettify dart %}
+class C {
+ static int f = 0;
+}
+{% endprettify %}
+
+If the field or variable should be initialized to `null`, then change the
+type to be nullable:
+
+{% prettify dart %}
+int? v;
+{% endprettify %}
+
+If the field or variable can't be initialized in the declaration but will
+always be initialized before it's referenced, then mark it as being `late`:
+
+{% prettify dart %}
+class C {
+ static late int f;
+}
+{% endprettify %}
+
### not_iterable_spread
_Spread elements in list or set literals must implement 'Iterable'._
@@ -4311,6 +5064,189 @@
var x;
{% endprettify %}
+### nullable_type_in_catch_clause
+
+_A potentially nullable type can't be used in an 'on' clause because it isn't
+valid to throw a nullable expression._
+
+#### Description
+
+The analyzer produces this diagnostic when the type following `on` in a
+catch clause is a nullable type. It isn't valid to specify a nullable type
+because it isn't possible to catch `null` (because it's a runtime error to
+throw `null`).
+
+#### Example
+
+The following code produces this diagnostic because the exception type is
+specified to allow `null` when `null` can't be thrown:
+
+{% prettify dart %}
+void f() {
+ try {
+ // ...
+ } on [!FormatException?!] {
+ }
+}
+{% endprettify %}
+
+#### Common fixes
+
+Remove the question mark from the type:
+
+{% prettify dart %}
+void f() {
+ try {
+ // ...
+ } on FormatException {
+ }
+}
+{% endprettify %}
+
+### nullable_type_in_extends_clause
+
+_A class can't extend a nullable type._
+
+#### Description
+
+The analyzer produces this diagnostic when a class declaration uses an
+extends clause to specify a superclass, and the superclass is followed by a
+`?`.
+
+It isn't valid to specify a nullable superclass because doing so would have
+no meaning; it wouldn't change either the interface or implementation being
+inherited by the class containing the extends clause.
+
+Note, however, that it _is_ valid to use a nullable type as a type argument
+to the superclass, such as `class A extends B<C?> {}`.
+
+#### Example
+
+The following code produces this diagnostic because `A?` is a nullable
+type, and nullable types can't be used in an extends clause:
+
+{% prettify dart %}
+class A {}
+class B extends [!A?!] {}
+{% endprettify %}
+
+#### Common fixes
+
+Remove the question mark from the type:
+
+{% prettify dart %}
+class A {}
+class B extends A {}
+{% endprettify %}
+
+### nullable_type_in_implements_clause
+
+_A class or mixin can't implement a nullable type._
+
+#### Description
+
+The analyzer produces this diagnostic when a class or mixin declaration has
+an implements clause, and an interface is followed by a `?`.
+
+It isn't valid to specify a nullable interface because doing so would have
+no meaning; it wouldn't change the interface being inherited by the class
+containing the implements clause.
+
+Note, however, that it _is_ valid to use a nullable type as a type argument
+to the interface, such as `class A implements B<C?> {}`.
+
+
+#### Example
+
+The following code produces this diagnostic because `A?` is a nullable
+type, and nullable types can't be used in an implements clause:
+
+{% prettify dart %}
+class A {}
+class B implements [!A?!] {}
+{% endprettify %}
+
+#### Common fixes
+
+Remove the question mark from the type:
+
+{% prettify dart %}
+class A {}
+class B implements A {}
+{% endprettify %}
+
+### nullable_type_in_on_clause
+
+_A mixin can't have a nullable type as a superclass constraint._
+
+#### Description
+
+The analyzer produces this diagnostic when a mixin declaration uses an on
+clause to specify a superclass constraint, and the class that's specified
+is followed by a `?`.
+
+It isn't valid to specify a nullable superclass constraint because doing so
+would have no meaning; it wouldn't change the interface being depended on
+by the mixin containing the on clause.
+
+Note, however, that it _is_ valid to use a nullable type as a type argument
+to the superclass constraint, such as `mixin A on B<C?> {}`.
+
+
+#### Example
+
+The following code produces this diagnostic because `A?` is a nullable type
+and nullable types can't be used in an on clause:
+
+{% prettify dart %}
+class C {}
+mixin M on [!C?!] {}
+{% endprettify %}
+
+#### Common fixes
+
+Remove the question mark from the type:
+
+{% prettify dart %}
+class C {}
+mixin M on C {}
+{% endprettify %}
+
+### nullable_type_in_with_clause
+
+_A class or mixin can't mix in a nullable type._
+
+#### Description
+
+The analyzer produces this diagnostic when a class or mixin declaration has
+a with clause, and a mixin is followed by a `?`.
+
+It isn't valid to specify a nullable mixin because doing so would have no
+meaning; it wouldn't change either the interface or implementation being
+inherited by the class containing the with clause.
+
+Note, however, that it _is_ valid to use a nullable type as a type argument
+to the mixin, such as `class A with B<C?> {}`.
+
+#### Example
+
+The following code produces this diagnostic because `A?` is a nullable
+type, and nullable types can't be used in a with clause:
+
+{% prettify dart %}
+mixin M {}
+class C with [!M?!] {}
+{% endprettify %}
+
+#### Common fixes
+
+Remove the question mark from the type:
+
+{% prettify dart %}
+mixin M {}
+class C with M {}
+{% endprettify %}
+
### override_on_non_overriding_member
_The field doesn't override an inherited getter or setter._
@@ -5295,6 +6231,37 @@
Rewrite the code to not use `super`.
+### throw_of_invalid_type
+
+_The type '{0}' of the thrown expression must be assignable to 'Object'._
+
+#### Description
+
+The analyzer produces this diagnostic when the type of the expression in a
+throw expression is not assignable to `Object`. It’s not valid to throw
+`null`, so it isn't valid to use an expression that might evaluate to
+`null`.
+
+#### Example
+
+The following code produces this diagnostic because `s` might be `null`:
+
+{% prettify dart %}
+void f(String? s) {
+ throw [!s!];
+}
+{% endprettify %}
+
+#### Common fixes
+
+Add an explicit null check to the expression:
+
+{% prettify dart %}
+void f(String? s) {
+ throw s!;
+}
+{% endprettify %}
+
### type_argument_not_matching_bounds
_'{0}' doesn't extend '{1}'._
@@ -5359,6 +6326,67 @@
}
{% endprettify %}
+### unchecked_use_of_nullable_value
+
+_An expression whose value can be 'null' must be null-checked before it can be
+dereferenced._
+
+#### Description
+
+The analyzer produces this diagnostic when an expression whose type is
+<a href=”#potentially-non-nullable”>potentially non-nullable</a> is
+dereferenced without first verifying that the value isn't `null`.
+
+#### Example
+
+The following code produces this diagnostic because `s` can be `null` at
+the point where it's referenced:
+
+{% prettify dart %}
+void f(String? s) {
+ if ([!s!].length > 3) {
+ // ...
+ }
+}
+{% endprettify %}
+
+#### Common fixes
+
+If the value really can be `null`, then add a test to ensure that members
+are only accessed when the value isn't `null`:
+
+{% prettify dart %}
+void f(String? s) {
+ if (s != null && s.length > 3) {
+ // ...
+ }
+}
+{% endprettify %}
+
+If the expression is a variable and the value should never be `null`, then
+change the type of the variable to be non-nullable:
+
+{% prettify dart %}
+void f(String s) {
+ if (s.length > 3) {
+ // ...
+ }
+}
+{% endprettify %}
+
+If you believe that the value of the expression should never be `null`, but
+you can't change the type of the variable, and you're willing to risk
+having an exception thrown at runtime if you're wrong, then you can assert
+that the value isn't null:
+
+{% prettify dart %}
+void f(String? s) {
+ if (s!.length > 3) {
+ // ...
+ }
+}
+{% endprettify %}
+
### undefined_annotation
_Undefined name '{0}' used as an annotation._
@@ -6212,6 +7240,93 @@
}
{% endprettify %}
+### unnecessary_non_null_assertion
+
+_The '!' will have no effect because the target expression can't be null._
+
+#### Description
+
+The analyzer produces this diagnostic when the operand of the `!` operator
+can't be `null`.
+
+#### Example
+
+The following code produces this diagnostic because `x` can't be `null`:
+
+{% prettify dart %}
+int f(int x) {
+ return x[!!!];
+}
+{% endprettify %}
+
+#### Common fixes
+
+Remove the null check operator (`!`):
+
+{% prettify dart %}
+int f(int x) {
+ return x;
+}
+{% endprettify %}
+
+### unnecessary_null_comparison
+
+_The operand can't be null, so the condition is always false._
+
+_The operand can't be null, so the condition is always true._
+
+#### Description
+
+The analyzer produces this diagnostic when it finds an equality comparison
+(either `==` or `!=`) with one operand of `null` and the other operand
+can't be `null`. Such comparisons are always either `true` or `false`, so
+they serve no purpose.
+
+#### Example
+
+The following code produces this diagnostic because `x` can never be
+`null`, so the comparison always evaluates to `true`:
+
+{% prettify dart %}
+void f(int x) {
+ if (x [!!= null!]) {
+ print(x);
+ }
+}
+{% endprettify %}
+
+The following code produces this diagnostic because `x` can never be
+`null`, so the comparison always evaluates to `false`:
+
+{% prettify dart %}
+void f(int x) {
+ if (x [!== null!]) {
+ throw ArgumentError("x can't be null");
+ }
+}
+{% endprettify %}
+
+#### Common fixes
+
+If the other operand should be able to be `null`, then change the type of
+the operand:
+
+{% prettify dart %}
+void f(int? x) {
+ if (x != null) {
+ print(x);
+ }
+}
+{% endprettify %}
+
+If the other operand really can't be `null`, then remove the condition:
+
+{% prettify dart %}
+void f(int x) {
+ print(x);
+}
+{% endprettify %}
+
### unqualified_reference_to_static_member_of_extended_type
_Static members from the extended type or one of its superclasses must be
diff --git a/pkg/analyzer/tool/diagnostics/generate.dart b/pkg/analyzer/tool/diagnostics/generate.dart
index dbb0f84..61ea2d7 100644
--- a/pkg/analyzer/tool/diagnostics/generate.dart
+++ b/pkg/analyzer/tool/diagnostics/generate.dart
@@ -429,13 +429,23 @@
}
}
```
-''');
-//### Potentially non-nullable
-//
-//A type is _potentially non-nullable_ if it's either explicitly non-nullable or
-//if it's a type parameter. The latter case is included because the actual runtime
-//type might be non-nullable.
+### Potentially non-nullable
+
+A type is _potentially non-nullable_ if it's either explicitly non-nullable or
+if it's a type parameter.
+
+A type is explicitly non-nullable if it is a type name that is not followed by a
+question mark. Note that there are a few types that are always nullable, such as
+`Null` and `dynamic`, and that `FutureOr` is only non-nullable if it is not
+followed by a question mark _and_ the type argument is non-nullable (such as
+`FutureOr<String>`).
+
+Type parameters are potentially non-nullable because the actual runtime type
+(the type specified as a type argument) might be non-nullable. For example,
+given a declaration of `class C<T> {}`, the type `C` could be used with a
+non-nullable type argument as in `C<int>`.
+''');
}
/// Write the header of the file.
diff --git a/pkg/compiler/lib/src/common_elements.dart b/pkg/compiler/lib/src/common_elements.dart
index 925f3d8..80b1a65 100644
--- a/pkg/compiler/lib/src/common_elements.dart
+++ b/pkg/compiler/lib/src/common_elements.dart
@@ -520,13 +520,23 @@
FunctionEntity get specializedIsTop;
FunctionEntity get specializedAsTop;
FunctionEntity get specializedIsBool;
+ FunctionEntity get specializedAsBool;
+ FunctionEntity get specializedAsBoolLegacy;
FunctionEntity get specializedAsBoolNullable;
+ FunctionEntity get specializedAsDouble;
+ FunctionEntity get specializedAsDoubleLegacy;
FunctionEntity get specializedAsDoubleNullable;
FunctionEntity get specializedIsInt;
+ FunctionEntity get specializedAsInt;
+ FunctionEntity get specializedAsIntLegacy;
FunctionEntity get specializedAsIntNullable;
FunctionEntity get specializedIsNum;
+ FunctionEntity get specializedAsNum;
+ FunctionEntity get specializedAsNumLegacy;
FunctionEntity get specializedAsNumNullable;
FunctionEntity get specializedIsString;
+ FunctionEntity get specializedAsString;
+ FunctionEntity get specializedAsStringLegacy;
FunctionEntity get specializedAsStringNullable;
FunctionEntity get instantiatedGenericFunctionTypeNewRti;
@@ -2004,33 +2014,62 @@
FunctionEntity get specializedIsBool => _findRtiFunction('_isBool');
@override
- FunctionEntity get specializedAsBoolNullable =>
- _findRtiFunction('_asBoolNullable');
+ FunctionEntity get specializedAsBool => _findRtiFunction('_asBool');
+
+ @override
+ FunctionEntity get specializedAsBoolLegacy => _findRtiFunction('_asBoolS');
+
+ @override
+ FunctionEntity get specializedAsBoolNullable => _findRtiFunction('_asBoolQ');
+
+ @override
+ FunctionEntity get specializedAsDouble => _findRtiFunction('_asDouble');
+
+ @override
+ FunctionEntity get specializedAsDoubleLegacy =>
+ _findRtiFunction('_asDoubleS');
@override
FunctionEntity get specializedAsDoubleNullable =>
- _findRtiFunction('_asDoubleNullable');
+ _findRtiFunction('_asDoubleQ');
@override
FunctionEntity get specializedIsInt => _findRtiFunction('_isInt');
@override
- FunctionEntity get specializedAsIntNullable =>
- _findRtiFunction('_asIntNullable');
+ FunctionEntity get specializedAsInt => _findRtiFunction('_asInt');
+
+ @override
+ FunctionEntity get specializedAsIntLegacy => _findRtiFunction('_asIntS');
+
+ @override
+ FunctionEntity get specializedAsIntNullable => _findRtiFunction('_asIntQ');
@override
FunctionEntity get specializedIsNum => _findRtiFunction('_isNum');
@override
- FunctionEntity get specializedAsNumNullable =>
- _findRtiFunction('_asNumNullable');
+ FunctionEntity get specializedAsNum => _findRtiFunction('_asNum');
+
+ @override
+ FunctionEntity get specializedAsNumLegacy => _findRtiFunction('_asNumS');
+
+ @override
+ FunctionEntity get specializedAsNumNullable => _findRtiFunction('_asNumQ');
@override
FunctionEntity get specializedIsString => _findRtiFunction('_isString');
@override
+ FunctionEntity get specializedAsString => _findRtiFunction('_asString');
+
+ @override
+ FunctionEntity get specializedAsStringLegacy =>
+ _findRtiFunction('_asStringS');
+
+ @override
FunctionEntity get specializedAsStringNullable =>
- _findRtiFunction('_asStringNullable');
+ _findRtiFunction('_asStringQ');
@override
FunctionEntity get instantiatedGenericFunctionTypeNewRti =>
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
index 644e4cb..d757f43 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -663,6 +663,8 @@
final CompilerOptions _options;
bool get terse => _options?.terseDiagnostics ?? false;
bool get _printLegacyStars => _options?.printLegacyStars ?? false;
+ bool get _useNullSafety => _options?.useNullSafety ?? true;
+ bool get _useLegacySubtyping => _options?.useLegacySubtyping ?? false;
String message;
Message(this.template, this.arguments, this._options) {
@@ -712,7 +714,10 @@
String convertToString(value) {
if (value is DartType) {
- value = value.toStructuredText(printLegacyStars: _printLegacyStars);
+ value = value.toStructuredText(
+ printLegacyStars: _printLegacyStars,
+ useNullSafety: _useNullSafety,
+ useLegacySubtyping: _useLegacySubtyping);
} else if (value is ConstantValue) {
value = value.toDartText();
} else {
diff --git a/pkg/compiler/lib/src/elements/types.dart b/pkg/compiler/lib/src/elements/types.dart
index 9cf992b..7b56319 100644
--- a/pkg/compiler/lib/src/elements/types.dart
+++ b/pkg/compiler/lib/src/elements/types.dart
@@ -130,8 +130,13 @@
@override
String toString() => toStructuredText();
- String toStructuredText({bool printLegacyStars = true}) =>
- _DartTypeToStringVisitor(printLegacyStars).run(this);
+ String toStructuredText(
+ {bool printLegacyStars = true,
+ bool useNullSafety = true,
+ bool useLegacySubtyping = false}) =>
+ _DartTypeToStringVisitor(
+ printLegacyStars, useNullSafety, useLegacySubtyping)
+ .run(this);
}
/// Pairs of [FunctionTypeVariable]s that are currently assumed to be
@@ -1502,13 +1507,16 @@
class _DartTypeToStringVisitor extends DartTypeVisitor<void, void> {
final bool _printLegacyStars;
+ final bool _useNullSafety;
+ final bool _useLegacySubtyping;
final List _fragments = []; // Strings and _DeferredNames
bool _lastIsIdentifier = false;
List<FunctionTypeVariable> _boundVariables;
Map<FunctionTypeVariable, _DeferredName> _variableToName;
Set<FunctionType> _genericFunctions;
- _DartTypeToStringVisitor(this._printLegacyStars);
+ _DartTypeToStringVisitor(
+ this._printLegacyStars, this._useNullSafety, this._useLegacySubtyping);
String run(DartType type) {
_visit(type);
@@ -1660,9 +1668,10 @@
needsComma = _comma(needsComma);
_visit(typeVariable);
DartType bound = typeVariable.bound;
- if (!bound.isObject) {
+ if (!bound._isTop(_useNullSafety) &&
+ (!_useLegacySubtyping || !bound.isObject)) {
_token(' extends ');
- _visit(typeVariable.bound);
+ _visit(bound);
}
}
_token('>');
diff --git a/pkg/compiler/lib/src/js_backend/backend_impact.dart b/pkg/compiler/lib/src/js_backend/backend_impact.dart
index 7d50038..d22ce35 100644
--- a/pkg/compiler/lib/src/js_backend/backend_impact.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_impact.dart
@@ -820,14 +820,24 @@
],
// Specialized checks.
_commonElements.specializedIsBool,
+ _commonElements.specializedAsBool,
+ _commonElements.specializedAsBoolLegacy,
_commonElements.specializedAsBoolNullable,
// no specializedIsDouble.
+ _commonElements.specializedAsDouble,
+ _commonElements.specializedAsDoubleLegacy,
_commonElements.specializedAsDoubleNullable,
_commonElements.specializedIsInt,
+ _commonElements.specializedAsInt,
+ _commonElements.specializedAsIntLegacy,
_commonElements.specializedAsIntNullable,
_commonElements.specializedIsNum,
+ _commonElements.specializedAsNum,
+ _commonElements.specializedAsNumLegacy,
_commonElements.specializedAsNumNullable,
_commonElements.specializedIsString,
+ _commonElements.specializedAsString,
+ _commonElements.specializedAsStringLegacy,
_commonElements.specializedAsStringNullable,
_commonElements.specializedIsTop,
_commonElements.specializedAsTop,
diff --git a/pkg/compiler/lib/src/js_backend/specialized_checks.dart b/pkg/compiler/lib/src/js_backend/specialized_checks.dart
index 8651bf2..ca83fd1 100644
--- a/pkg/compiler/lib/src/js_backend/specialized_checks.dart
+++ b/pkg/compiler/lib/src/js_backend/specialized_checks.dart
@@ -98,48 +98,76 @@
return null;
}
- static MemberEntity findAsCheck(
- DartType dartType, JCommonElements commonElements) {
+ static MemberEntity findAsCheck(DartType dartType,
+ JCommonElements commonElements, bool useLegacySubtyping) {
if (dartType is InterfaceType) {
if (dartType.typeArguments.isNotEmpty) return null;
- return _findAsCheck(dartType.element, commonElements, isNullable: true);
+ return _findAsCheck(dartType.element, commonElements,
+ nullable: false, legacy: useLegacySubtyping);
+ }
+ if (dartType is LegacyType) {
+ DartType baseType = dartType.baseType;
+ if (baseType is InterfaceType && baseType.typeArguments.isEmpty) {
+ return _findAsCheck(baseType.element, commonElements,
+ nullable: false, legacy: true);
+ }
+ return null;
+ }
+ if (dartType is NullableType) {
+ DartType baseType = dartType.baseType;
+ if (baseType is InterfaceType && baseType.typeArguments.isEmpty) {
+ return _findAsCheck(baseType.element, commonElements,
+ nullable: true, legacy: false);
+ }
+ return null;
}
return null;
}
+ /// Finds the method that implements the specialized check for a simple type.
+ /// The specialized method will report a TypeError that includes a reported
+ /// type.
+ ///
+ /// [nullable]: Find specialization for `element?`.
+ /// [legacy]: Find specialization for non-nullable `element?` but with legacy
+ /// semantics (accepting null).
+ ///
+ /// element options reported accepts
+ /// type null
+ ///
+ /// String nullable: true legacy: --- String? yes
+ /// String nullable: false legacy: true String yes
+ /// String nullable: false legacy: false String no
+ ///
static MemberEntity _findAsCheck(
ClassEntity element, JCommonElements commonElements,
- {bool isNullable}) {
+ {bool nullable, bool legacy}) {
if (element == commonElements.jsStringClass ||
element == commonElements.stringClass) {
- if (isNullable) {
- return commonElements.specializedAsStringNullable;
- }
- return null;
+ if (legacy) return commonElements.specializedAsStringLegacy;
+ if (nullable) return commonElements.specializedAsStringNullable;
+ return commonElements.specializedAsString;
}
if (element == commonElements.jsBoolClass ||
element == commonElements.boolClass) {
- if (isNullable) {
- return commonElements.specializedAsBoolNullable;
- }
- return null;
+ if (legacy) return commonElements.specializedAsBoolLegacy;
+ if (nullable) return commonElements.specializedAsBoolNullable;
+ return commonElements.specializedAsBool;
}
if (element == commonElements.jsDoubleClass ||
element == commonElements.doubleClass) {
- if (isNullable) {
- return commonElements.specializedAsDoubleNullable;
- }
- return null;
+ if (legacy) return commonElements.specializedAsDoubleLegacy;
+ if (nullable) return commonElements.specializedAsDoubleNullable;
+ return commonElements.specializedAsDouble;
}
if (element == commonElements.jsNumberClass ||
element == commonElements.numClass) {
- if (isNullable) {
- return commonElements.specializedAsNumNullable;
- }
- return null;
+ if (legacy) return commonElements.specializedAsNumLegacy;
+ if (nullable) return commonElements.specializedAsNumNullable;
+ return commonElements.specializedAsNum;
}
if (element == commonElements.jsIntClass ||
@@ -147,10 +175,9 @@
element == commonElements.jsUInt32Class ||
element == commonElements.jsUInt31Class ||
element == commonElements.jsPositiveIntClass) {
- if (isNullable) {
- return commonElements.specializedAsIntNullable;
- }
- return null;
+ if (legacy) return commonElements.specializedAsIntLegacy;
+ if (nullable) return commonElements.specializedAsIntNullable;
+ return commonElements.specializedAsInt;
}
return null;
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 1efc55b..6b65f2a 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -2133,8 +2133,8 @@
if (typeInput is HLoadType) {
TypeExpressionRecipe recipe = typeInput.typeExpression;
DartType dartType = recipe.type;
- MemberEntity specializedCheck =
- SpecializedChecks.findAsCheck(dartType, _closedWorld.commonElements);
+ MemberEntity specializedCheck = SpecializedChecks.findAsCheck(
+ dartType, _closedWorld.commonElements, _options.useLegacySubtyping);
if (specializedCheck != null) {
AbstractValueWithPrecision checkedType =
_abstractValueDomain.createFromStaticType(dartType, nullable: true);
diff --git a/pkg/dds/lib/dds.dart b/pkg/dds/lib/dds.dart
index d2bb5ea..03ced9f 100644
--- a/pkg/dds/lib/dds.dart
+++ b/pkg/dds/lib/dds.dart
@@ -7,15 +7,24 @@
library dds;
import 'dart:async';
+import 'dart:convert';
import 'dart:io';
+import 'dart:typed_data';
+import 'package:async/async.dart';
+import 'package:json_rpc_2/json_rpc_2.dart' as json_rpc;
+import 'package:pedantic/pedantic.dart';
import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart' as io;
import 'package:shelf_proxy/shelf_proxy.dart';
import 'package:shelf_web_socket/shelf_web_socket.dart';
+import 'package:stream_channel/stream_channel.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
+part 'src/binary_compatible_peer.dart';
+part 'src/client.dart';
part 'src/dds_impl.dart';
+part 'src/stream_manager.dart';
/// An intermediary between a Dart VM service and its clients that offers
/// additional functionality on top of the standard VM service protocol.
diff --git a/pkg/dds/lib/src/binary_compatible_peer.dart b/pkg/dds/lib/src/binary_compatible_peer.dart
new file mode 100644
index 0000000..7c5b83b
--- /dev/null
+++ b/pkg/dds/lib/src/binary_compatible_peer.dart
@@ -0,0 +1,60 @@
+// Copyright (c) 2020, 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 dds;
+
+/// Adds support for binary events send from the VM service, which are not part
+/// of the official JSON RPC 2.0 specification.
+///
+/// A binary event from the VM service has the form:
+/// ```
+/// type BinaryEvent {
+/// dataOffset : uint32,
+/// metadata : uint8[dataOffset-4],
+/// data : uint8[],
+/// }
+/// ```
+/// where `metadata` is the JSON body of the event.
+///
+/// [_BinaryCompatiblePeer] assumes that only stream events can contain a
+/// binary payload (e.g., clients cannot send a `BinaryEvent` to the VM service).
+class _BinaryCompatiblePeer extends json_rpc.Peer {
+ _BinaryCompatiblePeer(WebSocketChannel ws, _StreamManager streamManager)
+ : super(
+ ws.transform<String>(
+ StreamChannelTransformer(
+ StreamTransformer<dynamic, String>.fromHandlers(
+ handleData: (data, EventSink<String> sink) =>
+ _transformStream(streamManager, data, sink)),
+ StreamSinkTransformer<String, dynamic>.fromHandlers(
+ handleData: (String data, EventSink<dynamic> sink) {
+ sink.add(data);
+ },
+ ),
+ ),
+ ),
+ );
+
+ static void _transformStream(
+ _StreamManager streamManager, dynamic data, EventSink<String> sink) {
+ if (data is String) {
+ // Non-binary messages come in as Strings. Simply forward to the sink.
+ sink.add(data);
+ } else if (data is Uint8List) {
+ // Only binary events will result in `data` being of type Uint8List. We
+ // need to manually forward them here.
+ final bytesView =
+ ByteData.view(data.buffer, data.offsetInBytes, data.lengthInBytes);
+ const metadataOffset = 4;
+ final dataOffset = bytesView.getUint32(0, Endian.little);
+ final metadataLength = dataOffset - metadataOffset;
+ final metadata = Utf8Decoder().convert(new Uint8List.view(
+ bytesView.buffer,
+ bytesView.offsetInBytes + metadataOffset,
+ metadataLength));
+ final decodedMetadata = json.decode(metadata);
+ streamManager.streamNotify(decodedMetadata['params']['streamId'], data);
+ }
+ }
+}
diff --git a/pkg/dds/lib/src/client.dart b/pkg/dds/lib/src/client.dart
new file mode 100644
index 0000000..11dac82
--- /dev/null
+++ b/pkg/dds/lib/src/client.dart
@@ -0,0 +1,68 @@
+// Copyright (c) 2020, 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 dds;
+
+/// Representation of a single DDS client which manages the connection and
+/// DDS request intercepting / forwarding.
+class _DartDevelopmentServiceClient {
+ _DartDevelopmentServiceClient(
+ this.dds,
+ this.ws,
+ json_rpc.Peer vmServicePeer,
+ ) : _vmServicePeer = vmServicePeer {
+ _clientPeer = json_rpc.Peer(ws.cast<String>());
+ _registerJsonRpcMethods();
+ }
+
+ /// Start receiving JSON RPC requests from the client.
+ ///
+ /// Returned future completes when the peer is closed.
+ Future<void> listen() => _clientPeer.listen().then(
+ (_) => dds.streamManager.clientDisconnect(this),
+ );
+
+ /// Close the connection to the client.
+ Future<void> close() async {
+ // Cleanup the JSON RPC server for this connection if DDS has shutdown.
+ await _clientPeer.close();
+ }
+
+ /// Send a JSON RPC notification to the client.
+ void sendNotification(String method, [dynamic parameters]) async {
+ if (_clientPeer.isClosed) {
+ return;
+ }
+ _clientPeer.sendNotification(method, parameters);
+ }
+
+ /// Registers handlers for JSON RPC methods which need to be intercepted by
+ /// DDS as well as fallback request forwarder.
+ void _registerJsonRpcMethods() {
+ _clientPeer.registerMethod('streamListen', (parameters) async {
+ final streamId = parameters['streamId'].asString;
+ await dds.streamManager.streamListen(this, streamId);
+ return _success;
+ });
+
+ _clientPeer.registerMethod('streamCancel', (parameters) async {
+ final streamId = parameters['streamId'].asString;
+ await dds.streamManager.streamCancel(this, streamId);
+ return _success;
+ });
+
+ // Unless otherwise specified, the request is forwarded to the VM service.
+ _clientPeer.registerFallback((parameters) async =>
+ await _vmServicePeer.sendRequest(parameters.method, parameters.asMap));
+ }
+
+ static const _success = <String, dynamic>{
+ 'type': 'Success',
+ };
+
+ final _DartDevelopmentService dds;
+ final json_rpc.Peer _vmServicePeer;
+ final WebSocketChannel ws;
+ json_rpc.Peer _clientPeer;
+}
diff --git a/pkg/dds/lib/src/dds_impl.dart b/pkg/dds/lib/src/dds_impl.dart
index 37f019a..fb2bf74 100644
--- a/pkg/dds/lib/src/dds_impl.dart
+++ b/pkg/dds/lib/src/dds_impl.dart
@@ -5,12 +5,20 @@
part of dds;
class _DartDevelopmentService implements DartDevelopmentService {
- _DartDevelopmentService(this._remoteVmServiceUri, this._uri);
+ _DartDevelopmentService(this._remoteVmServiceUri, this._uri) {
+ _streamManager = _StreamManager(this);
+ }
Future<void> startService() async {
// Establish the connection to the VM service.
- _vmServiceSocket = await WebSocket.connect(remoteVmServiceWsUri.toString());
- _vmServiceStream = _vmServiceSocket.asBroadcastStream();
+ _vmServiceSocket = WebSocketChannel.connect(remoteVmServiceWsUri);
+ _vmServiceClient = _BinaryCompatiblePeer(_vmServiceSocket, _streamManager);
+ // Setup the JSON RPC client with the VM service.
+ unawaited(_vmServiceClient.listen());
+
+ // Setup stream event handling.
+ streamManager.listen();
+
// Once we have a connection to the VM service, we're ready to spawn the intermediary.
await _startDDSServer();
}
@@ -28,8 +36,20 @@
/// Stop accepting requests after gracefully handling existing requests.
Future<void> shutdown() async {
+ // Don't accept anymore HTTP requests.
await _server.close();
- await _vmServiceSocket.close();
+
+ // Close all incoming websocket connections.
+ final futures = <Future>[];
+ for (final client in _clients) {
+ futures.add(client.close());
+ }
+ await Future.wait(futures);
+
+ // Close connection to VM service.
+ await _vmServiceSocket.sink.close();
+
+ _done.complete();
}
// Attempt to upgrade HTTP requests to a websocket before processing them as
@@ -38,16 +58,18 @@
Cascade _handlers() => Cascade().add(_webSocketHandler()).add(_httpHandler());
Handler _webSocketHandler() => webSocketHandler((WebSocketChannel ws) {
- // TODO(bkonyi): actually process requests instead of blindly forwarding them.
- _vmServiceStream.listen(
- (event) => ws.sink.add(event),
- onDone: () => ws.sink.close(),
+ final client = _DartDevelopmentServiceClient(
+ this,
+ ws,
+ _vmServiceClient,
);
- ws.stream.listen((event) => _vmServiceSocket.add(event));
+ _clients.add(client);
+ client.listen().then((_) => _clients.remove(client));
});
Handler _httpHandler() {
- // TODO(bkonyi): actually process requests instead of blindly forwarding them.
+ // DDS doesn't support any HTTP requests itself, so we just forward all of
+ // them to the VM service.
final cascade = Cascade().add(proxyHandler(remoteVmServiceUri));
return cascade.handler;
}
@@ -79,7 +101,15 @@
bool get isRunning => _uri != null;
- WebSocket _vmServiceSocket;
- Stream _vmServiceStream;
+ Future<void> get done => _done.future;
+ Completer _done = Completer<void>();
+
+ _StreamManager get streamManager => _streamManager;
+ _StreamManager _streamManager;
+
+ final List<_DartDevelopmentServiceClient> _clients = [];
+
+ json_rpc.Peer _vmServiceClient;
+ WebSocketChannel _vmServiceSocket;
HttpServer _server;
}
diff --git a/pkg/dds/lib/src/stream_manager.dart b/pkg/dds/lib/src/stream_manager.dart
new file mode 100644
index 0000000..318cc39
--- /dev/null
+++ b/pkg/dds/lib/src/stream_manager.dart
@@ -0,0 +1,113 @@
+// Copyright (c) 2020, 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 dds;
+
+class _StreamManager {
+ _StreamManager(this.dds);
+
+ /// Send `streamNotify` notifications to clients subscribed to `streamId`.
+ ///
+ /// If `data` is of type `Uint8List`, the notification is assumed to be a
+ /// binary event and is forwarded directly over the subscriber's websocket.
+ /// Otherwise, the event is sent via the JSON RPC client.
+ void streamNotify(String streamId, data) {
+ if (streamListeners.containsKey(streamId)) {
+ final listeners = streamListeners[streamId];
+ final isBinaryData = data is Uint8List;
+ for (final listener in listeners) {
+ if (isBinaryData) {
+ listener.ws.sink.add(data);
+ } else {
+ listener.sendNotification('streamNotify', data);
+ }
+ }
+ }
+ }
+
+ /// Start listening for `streamNotify` events from the VM service and forward
+ /// them to the clients which have subscribed to the stream.
+ void listen() => dds._vmServiceClient.registerMethod(
+ 'streamNotify',
+ (parameters) {
+ final streamId = parameters['streamId'].asString;
+ streamNotify(streamId, parameters.value);
+ },
+ );
+
+ /// Subscribes `client` to a stream.
+ ///
+ /// If `client` is the first client to listen to `stream`, DDS will send a
+ /// `streamListen` request for `stream` to the VM service.
+ Future<void> streamListen(
+ _DartDevelopmentServiceClient client,
+ String stream,
+ ) async {
+ assert(stream != null && stream.isNotEmpty);
+ if (!streamListeners.containsKey(stream)) {
+ // This will return an RPC exception if the stream doesn't exist. This
+ // will throw and the exception will be forwarded to the client.
+ final result = await dds._vmServiceClient.sendRequest('streamListen', {
+ 'streamId': stream,
+ });
+ assert(result['type'] == 'Success');
+ streamListeners[stream] = <_DartDevelopmentServiceClient>[];
+ }
+ if (streamListeners[stream].contains(client)) {
+ throw kStreamAlreadySubscribedException;
+ }
+ streamListeners[stream].add(client);
+ }
+
+ /// Unsubscribes `client` from a stream.
+ ///
+ /// If `client` is the last client to unsubscribe from `stream`, DDS will
+ /// send a `streamCancel` request for `stream` to the VM service.
+ Future<void> streamCancel(
+ _DartDevelopmentServiceClient client,
+ String stream,
+ ) async {
+ assert(stream != null && stream.isNotEmpty);
+ final listeners = streamListeners[stream];
+ if (listeners == null || !listeners.contains(client)) {
+ throw kStreamNotSubscribedException;
+ }
+ listeners.remove(client);
+ if (listeners.isEmpty) {
+ streamListeners.remove(stream);
+ final result = await dds._vmServiceClient.sendRequest('streamCancel', {
+ 'streamId': stream,
+ });
+ assert(result['type'] == 'Success');
+ } else {
+ streamListeners[stream] = listeners;
+ }
+ }
+
+ /// Cleanup stream subscriptions for `client` when it has disconnected.
+ void clientDisconnect(_DartDevelopmentServiceClient client) {
+ for (final streamId in streamListeners.keys.toList()) {
+ streamCancel(client, streamId);
+ }
+ }
+
+ // These error codes must be kept in sync with those in vm/json_stream.h and
+ // vmservice.dart.
+ static const kStreamAlreadySubscribed = 103;
+ static const kStreamNotSubscribed = 104;
+
+ // Keep these messages in sync with the VM service.
+ static final kStreamAlreadySubscribedException = json_rpc.RpcException(
+ kStreamAlreadySubscribed,
+ 'Stream already subscribed',
+ );
+
+ static final kStreamNotSubscribedException = json_rpc.RpcException(
+ kStreamNotSubscribed,
+ 'Stream not subscribed',
+ );
+
+ final _DartDevelopmentService dds;
+ final streamListeners = <String, List<_DartDevelopmentServiceClient>>{};
+}
diff --git a/pkg/dds/pubspec.yaml b/pkg/dds/pubspec.yaml
index 8734df5..9dbb70e 100644
--- a/pkg/dds/pubspec.yaml
+++ b/pkg/dds/pubspec.yaml
@@ -11,13 +11,15 @@
sdk: '>=2.6.0 <3.0.0'
dependencies:
+ async: ^2.4.1
json_rpc_2: ^2.1.0
+ pedantic: ^1.7.0
shelf: ^0.7.5
shelf_proxy: ^0.1.0+7
shelf_web_socket: ^0.2.3
+ stream_channel: ^2.0.0
web_socket_channel: ^1.1.0
dev_dependencies:
- pedantic: ^1.7.0
test: ^1.0.0
vm_service: ^4.0.0
diff --git a/pkg/dev_compiler/lib/src/kernel/compiler.dart b/pkg/dev_compiler/lib/src/kernel/compiler.dart
index 584850a..39e6830 100644
--- a/pkg/dev_compiler/lib/src/kernel/compiler.dart
+++ b/pkg/dev_compiler/lib/src/kernel/compiler.dart
@@ -2748,35 +2748,28 @@
helperCall = 'gFnType(#)';
- /// Whether the type parameter [t] has an explicit bound, like
- /// `<T extends C>`, `<T extends Object>` or `<T extends dynamic>`.
+ /// Returns `true` when the type parameter [t] has a `Object*` bound
+ /// either implicit `<T>` or explicit `<T extends Object>` written in a
+ /// legacy library.
///
- /// In contrast, a type parameter like `<T>` has an implicit bound.
- /// Implicit bounds are a bit unusual, in that `Object` is used as the
- /// bound for checking, but `dynamic` is filled in as the default value.
- ///
- /// Kernel represents `<T>` as `<T extends Object = dynamic>`. We can find
- /// explicit bounds by looking for anything *except* that.
- bool typeParameterHasExplicitBound(TypeParameter t) =>
- t.bound != _types.coreTypes.objectLegacyRawType ||
- t.defaultType != const DynamicType();
+ /// Note: Kernel represents these differently in the default values.
+ /// `<T extends Object* = dynamic>` vs `<T extends Object* = Object*>` but
+ /// at runtime we treat both as having a default value of dynamic as it is
+ /// correct for the cases that appear more frequently.
+ bool typeParameterHasLegacyTopBound(TypeParameter t) =>
+ t.bound == _types.coreTypes.objectLegacyRawType;
- // If any explicit bounds were passed, emit them.
- if (typeFormals.any(typeParameterHasExplicitBound)) {
+ // Avoid emitting these bounds when possible and interpret the empty
+ // bounds at runtime to mean all bounds are `Object*`.
+ // TODO(nshahan) Revisit this representation when more libraries have
+ // migrated to null safety.
+ if (!typeFormals.every(typeParameterHasLegacyTopBound)) {
/// Emits the bound of the type parameter [t] for use in runtime
- /// checking and the default value (e.g. for dynamic class).
+ /// checking.
///
- /// For most type parameters we can use [TypeParameter.bound]. However,
- /// for *implicit* bounds such as `<T>` (represented in Kernel as
- /// `<T extends Object = dynamic>`) we need to emit `dynamic` so we use
- /// the correct default value at runtime.
- ///
- /// Because `dynamic` and `Object` are both top types, they'll behave
- /// identically for the purposes of type checks.
+ /// Default values e.g. dynamic get replaced at runtime.
js_ast.Expression emitTypeParameterBound(TypeParameter t) =>
- typeParameterHasExplicitBound(t)
- ? _emitType(t.bound)
- : visitDynamicType(const DynamicType());
+ _emitType(t.bound);
var bounds = typeFormals.map(emitTypeParameterBound).toList();
typeParts.add(addTypeFormalsAsParameters(bounds));
diff --git a/pkg/dev_compiler/tool/dart2js_nnbd_sdk_error_golden.txt b/pkg/dev_compiler/tool/dart2js_nnbd_sdk_error_golden.txt
index 1140c53..51310b9 100644
--- a/pkg/dev_compiler/tool/dart2js_nnbd_sdk_error_golden.txt
+++ b/pkg/dev_compiler/tool/dart2js_nnbd_sdk_error_golden.txt
@@ -8,3 +8,4 @@
ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1656|17|1|The operator '&' isn't defined for the type 'JSInt'.
ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1661|18|1|The operator '&' isn't defined for the type 'JSInt'.
ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1661|44|1|The operator '&' isn't defined for the type 'JSInt'.
+ERROR|STATIC_WARNING|ARGUMENT_TYPE_NOT_ASSIGNABLE|lib/io/io.dart|6334|51|12|The argument type 'Object' can't be assigned to the parameter type 'String'.
diff --git a/pkg/dev_compiler/tool/dartdevc_nnbd_sdk_error_golden.txt b/pkg/dev_compiler/tool/dartdevc_nnbd_sdk_error_golden.txt
index 80acd97..b093430 100644
--- a/pkg/dev_compiler/tool/dartdevc_nnbd_sdk_error_golden.txt
+++ b/pkg/dev_compiler/tool/dartdevc_nnbd_sdk_error_golden.txt
@@ -2,6 +2,7 @@
ERROR|COMPILE_TIME_ERROR|CONST_CONSTRUCTOR_THROWS_EXCEPTION|lib/core/core.dart|7902|5|97|Const constructors can't throw exceptions.
ERROR|COMPILE_TIME_ERROR|CONST_CONSTRUCTOR_THROWS_EXCEPTION|lib/core/core.dart|940|5|95|Const constructors can't throw exceptions.
ERROR|COMPILE_TIME_ERROR|CONST_CONSTRUCTOR_THROWS_EXCEPTION|lib/core/core.dart|973|5|94|Const constructors can't throw exceptions.
+ERROR|STATIC_WARNING|ARGUMENT_TYPE_NOT_ASSIGNABLE|lib/io/io.dart|6334|51|12|The argument type 'Object' can't be assigned to the parameter type 'String'.
ERROR|SYNTACTIC_ERROR|CONST_FACTORY|lib/core/core.dart|3714|3|5|Only redirecting factory constructors can be declared to be 'const'.
ERROR|SYNTACTIC_ERROR|CONST_FACTORY|lib/core/core.dart|7900|3|5|Only redirecting factory constructors can be declared to be 'const'.
ERROR|SYNTACTIC_ERROR|CONST_FACTORY|lib/core/core.dart|938|3|5|Only redirecting factory constructors can be declared to be 'const'.
diff --git a/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart b/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
index a852f46..7b26757 100644
--- a/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
@@ -79,7 +79,7 @@
bool get fromDill => false;
Typedef build(SourceLibraryBuilder libraryBuilder) {
- typedef..type ??= buildThisType(libraryBuilder);
+ typedef..type ??= buildThisType();
TypeBuilder type = this.type;
if (type is FunctionTypeBuilder) {
@@ -146,7 +146,7 @@
return result;
}
- DartType buildThisType(LibraryBuilder library) {
+ DartType buildThisType() {
if (thisType != null) {
if (identical(thisType, cyclicTypeAliasMarker)) {
library.addProblem(templateCyclicTypedef.withArguments(name),
@@ -181,7 +181,7 @@
/// [arguments] have already been built.
DartType buildTypesWithBuiltArguments(LibraryBuilder library,
Nullability nullability, List<DartType> arguments) {
- DartType thisType = buildThisType(library);
+ DartType thisType = buildThisType();
if (const DynamicType() == thisType) return thisType;
Nullability adjustedNullability =
isNullAlias ? Nullability.nullable : nullability;
@@ -248,26 +248,32 @@
DartType buildType(LibraryBuilder library,
NullabilityBuilder nullabilityBuilder, List<TypeBuilder> arguments,
[bool notInstanceContext]) {
- DartType thisType = buildThisType(library);
+ DartType thisType = buildThisType();
if (thisType is InvalidType) return thisType;
// TODO(dmitryas): Remove the following comment when FutureOr has its own
// encoding and isn't represented as an InterfaceType.
// The following won't work if the right-hand side of the typedef is a
// FutureOr.
- Nullability rhsNullability = thisType.nullability;
+ Nullability nullability;
+ if (isNullAlias) {
+ // Null is always nullable.
+ nullability = Nullability.nullable;
+ } else if (!parent.isNonNullableByDefault ||
+ !library.isNonNullableByDefault) {
+ // The typedef is defined or used in an opt-out library so the nullability
+ // is based on the use site alone.
+ nullability = nullabilityBuilder.build(library);
+ } else {
+ nullability = uniteNullabilities(
+ thisType.nullability, nullabilityBuilder.build(library));
+ }
if (typedef.typeParameters.isEmpty && arguments == null) {
- Nullability nullability = isNullAlias
- ? Nullability.nullable
- : nullabilityBuilder.build(library);
- return thisType
- .withNullability(uniteNullabilities(rhsNullability, nullability));
+ return thisType.withNullability(nullability);
}
// Otherwise, substitute.
return buildTypesWithBuiltArguments(
- library,
- uniteNullabilities(rhsNullability, nullabilityBuilder.build(library)),
- buildTypeArguments(library, arguments));
+ library, nullability, buildTypeArguments(library, arguments));
}
TypeDeclarationBuilder _cachedUnaliasedDeclaration;
diff --git a/pkg/front_end/lib/src/fasta/dill/dill_type_alias_builder.dart b/pkg/front_end/lib/src/fasta/dill/dill_type_alias_builder.dart
index f13acd1..6a06914 100644
--- a/pkg/front_end/lib/src/fasta/dill/dill_type_alias_builder.dart
+++ b/pkg/front_end/lib/src/fasta/dill/dill_type_alias_builder.dart
@@ -45,7 +45,7 @@
}
@override
- DartType buildThisType(LibraryBuilder library) {
+ DartType buildThisType() {
return thisType ??= typedef.type;
}
diff --git a/pkg/front_end/lib/src/fasta/incremental_compiler.dart b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
index 10b6ee9..db832ad 100644
--- a/pkg/front_end/lib/src/fasta/incremental_compiler.dart
+++ b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
@@ -11,6 +11,7 @@
BinaryBuilderWithMetadata,
CanonicalNameError,
CanonicalNameSdkError,
+ CompilationModeError,
InvalidKernelVersionError,
SubComponentView;
@@ -1010,7 +1011,8 @@
if (e is InvalidKernelVersionError ||
e is PackageChangedError ||
- e is CanonicalNameSdkError) {
+ e is CanonicalNameSdkError ||
+ e is CompilationModeError) {
// Don't report any warning.
} else {
Uri gzInitializedFrom;
diff --git a/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart b/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart
index ccd1823..62d6624 100644
--- a/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart
+++ b/pkg/front_end/test/incremental_load_from_invalid_dill_test.dart
@@ -40,7 +40,8 @@
import 'package:front_end/src/fasta/kernel/utils.dart' show serializeComponent;
-import 'package:kernel/kernel.dart' show Component, Library;
+import 'package:kernel/kernel.dart'
+ show Component, Library, NonNullableByDefaultCompiledMode;
import 'incremental_load_from_dill_suite.dart' show getOptions;
@@ -236,6 +237,38 @@
// Should be ok (for now), but we shouldn't actually initialize from dill.
fs.entityForUri(initializeFrom).writeAsBytesSync(dataLinkedToSdkWithFoo);
await compileExpectOk(false, entryPoint);
+
+ // Try to initialize from a dill which contains mixed compilation modes:
+ // Should be ok, but we shouldn't actually initialize from dill.
+ List<int> mixedPart1;
+ {
+ compiler = new IncrementalCompiler(
+ new CompilerContext(
+ new ProcessedOptions(options: options, inputs: [helper2File])),
+ null);
+ Component c = await compiler.computeDelta();
+ c.setMainMethodAndMode(
+ null, false, NonNullableByDefaultCompiledMode.Disabled);
+ mixedPart1 = serializeComponent(c);
+ }
+
+ List<int> mixedPart2;
+ {
+ compiler = new IncrementalCompiler(
+ new CompilerContext(
+ new ProcessedOptions(options: options, inputs: [helperFile])),
+ null);
+ Component c = await compiler.computeDelta();
+ c.setMainMethodAndMode(
+ null, false, NonNullableByDefaultCompiledMode.Strong);
+ mixedPart2 = serializeComponent(c);
+ }
+
+ List<int> mixed = [];
+ mixed.addAll(mixedPart1);
+ mixed.addAll(mixedPart2);
+ fs.entityForUri(initializeFrom).writeAsBytesSync(mixed);
+ await compileExpectOk(false, entryPoint);
}
}
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt
index 44f1f77..95a7bb3 100644
--- a/pkg/front_end/test/spell_checking_list_tests.txt
+++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -276,6 +276,9 @@
isolates
issue41210b
issue41436c
+issue41496b
+issue41498b
+issue41499b
iter
joo
jumped
diff --git a/pkg/front_end/test/utils/kernel_chain.dart b/pkg/front_end/test/utils/kernel_chain.dart
index 643ffcb..1f77cd2 100644
--- a/pkg/front_end/test/utils/kernel_chain.dart
+++ b/pkg/front_end/test/utils/kernel_chain.dart
@@ -318,7 +318,8 @@
return await CompilerContext.runWithOptions(options,
(compilerContext) async {
compilerContext.uriToSource.addAll(component.uriToSource);
- TextSerializationVerifier verifier = new TextSerializationVerifier();
+ TextSerializationVerifier verifier =
+ new TextSerializationVerifier(root: component.root);
for (Library library in component.libraries) {
if (library.importUri.scheme != "dart" &&
library.importUri.scheme != "package") {
@@ -329,13 +330,11 @@
LocatedMessage message;
if (failure is TextSerializationFailure) {
message = templateUnspecified
- .withArguments(
- "Failed to serialize a node: ${failure.message.isNotEmpty}")
+ .withArguments("Failed to serialize a node: ${failure.message}")
.withLocation(failure.uri, failure.offset, 1);
} else if (failure is TextDeserializationFailure) {
message = templateUnspecified
- .withArguments(
- "Failed to deserialize a node: ${failure.message.isNotEmpty}")
+ .withArguments("Failed to deserialize a node: ${failure.message}")
.withLocation(failure.uri, failure.offset, 1);
} else if (failure is TextRoundTripFailure) {
String formattedInitial =
diff --git a/pkg/front_end/testcases/nnbd/issue41496.dart b/pkg/front_end/testcases/nnbd/issue41496.dart
new file mode 100644
index 0000000..93d3769
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2020, 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 "issue41496_lib.dart";
+
+LegacyFoo f1;
+
+class C {
+ static LegacyFoo f2;
+}
+
+main() {
+ new C();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41496.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue41496.dart.outline.expect
new file mode 100644
index 0000000..de2e711
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496.dart.outline.expect
@@ -0,0 +1,32 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41496.dart:7:11: Error: Field 'f1' should be initialized because its type 'void Function()' doesn't allow null.
+// LegacyFoo f1;
+// ^^
+//
+// pkg/front_end/testcases/nnbd/issue41496.dart:10:20: Error: Field 'f2' should be initialized because its type 'void Function()' doesn't allow null.
+// static LegacyFoo f2;
+// ^^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41496_lib.dart";
+
+class C extends core::Object {
+ static field () → void f2;
+ synthetic constructor •() → self::C
+ ;
+}
+static field () → void f1;
+static method main() → dynamic
+ ;
+
+library opted_out_lib;
+import self as self2;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic
+ ;
diff --git a/pkg/front_end/testcases/nnbd/issue41496.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41496.dart.strong.expect
new file mode 100644
index 0000000..5a1bc313
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496.dart.strong.expect
@@ -0,0 +1,33 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41496.dart:7:11: Error: Field 'f1' should be initialized because its type 'void Function()' doesn't allow null.
+// LegacyFoo f1;
+// ^^
+//
+// pkg/front_end/testcases/nnbd/issue41496.dart:10:20: Error: Field 'f2' should be initialized because its type 'void Function()' doesn't allow null.
+// static LegacyFoo f2;
+// ^^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41496_lib.dart";
+
+class C extends core::Object {
+ static field () → void f2 = null;
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+}
+static field () → void f1;
+static method main() → dynamic {
+ new self::C::•();
+}
+
+library opted_out_lib;
+import self as self2;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41496.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41496.dart.strong.transformed.expect
new file mode 100644
index 0000000..5a1bc313
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496.dart.strong.transformed.expect
@@ -0,0 +1,33 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41496.dart:7:11: Error: Field 'f1' should be initialized because its type 'void Function()' doesn't allow null.
+// LegacyFoo f1;
+// ^^
+//
+// pkg/front_end/testcases/nnbd/issue41496.dart:10:20: Error: Field 'f2' should be initialized because its type 'void Function()' doesn't allow null.
+// static LegacyFoo f2;
+// ^^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41496_lib.dart";
+
+class C extends core::Object {
+ static field () → void f2 = null;
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+}
+static field () → void f1;
+static method main() → dynamic {
+ new self::C::•();
+}
+
+library opted_out_lib;
+import self as self2;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41496.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41496.dart.weak.expect
new file mode 100644
index 0000000..5a1bc313
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496.dart.weak.expect
@@ -0,0 +1,33 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41496.dart:7:11: Error: Field 'f1' should be initialized because its type 'void Function()' doesn't allow null.
+// LegacyFoo f1;
+// ^^
+//
+// pkg/front_end/testcases/nnbd/issue41496.dart:10:20: Error: Field 'f2' should be initialized because its type 'void Function()' doesn't allow null.
+// static LegacyFoo f2;
+// ^^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41496_lib.dart";
+
+class C extends core::Object {
+ static field () → void f2 = null;
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+}
+static field () → void f1;
+static method main() → dynamic {
+ new self::C::•();
+}
+
+library opted_out_lib;
+import self as self2;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41496.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41496.dart.weak.transformed.expect
new file mode 100644
index 0000000..5a1bc313
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496.dart.weak.transformed.expect
@@ -0,0 +1,33 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41496.dart:7:11: Error: Field 'f1' should be initialized because its type 'void Function()' doesn't allow null.
+// LegacyFoo f1;
+// ^^
+//
+// pkg/front_end/testcases/nnbd/issue41496.dart:10:20: Error: Field 'f2' should be initialized because its type 'void Function()' doesn't allow null.
+// static LegacyFoo f2;
+// ^^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41496_lib.dart";
+
+class C extends core::Object {
+ static field () → void f2 = null;
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+}
+static field () → void f1;
+static method main() → dynamic {
+ new self::C::•();
+}
+
+library opted_out_lib;
+import self as self2;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41496_lib.dart b/pkg/front_end/testcases/nnbd/issue41496_lib.dart
new file mode 100644
index 0000000..8950f0d
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496_lib.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2020, 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.
+
+// @dart=2.6
+
+library opted_out_lib;
+
+typedef void LegacyFoo();
+
+test(LegacyFoo f) {}
diff --git a/pkg/front_end/testcases/nnbd/issue41496b.dart b/pkg/front_end/testcases/nnbd/issue41496b.dart
new file mode 100644
index 0000000..4bafd01
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496b.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2020, 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.
+
+// @dart=2.6
+
+library opted_out_lib;
+
+import 'issue41496b_lib.dart' as opt_in;
+
+typedef void LegacyFoo();
+
+test(LegacyFoo f) {}
+
+main() {
+ opt_in.main();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41496b.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue41496b.dart.outline.expect
new file mode 100644
index 0000000..e596933
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496b.dart.outline.expect
@@ -0,0 +1,36 @@
+library opted_out_lib;
+import self as self;
+
+import "org-dartlang-testcase:///issue41496b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic
+ ;
+static method main() → dynamic
+ ;
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41496b_lib.dart:7:11: Error: Field 'f1' should be initialized because its type 'void Function()' doesn't allow null.
+// LegacyFoo f1;
+// ^^
+//
+// pkg/front_end/testcases/nnbd/issue41496b_lib.dart:10:20: Error: Field 'f2' should be initialized because its type 'void Function()' doesn't allow null.
+// static LegacyFoo f2;
+// ^^
+//
+import self as self2;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41496b.dart";
+
+class C extends core::Object {
+ static field () → void f2;
+ synthetic constructor •() → self2::C
+ ;
+}
+static field () → void f1;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/nnbd/issue41496b.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41496b.dart.strong.expect
new file mode 100644
index 0000000..b70a566
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496b.dart.strong.expect
@@ -0,0 +1,39 @@
+library opted_out_lib;
+import self as self;
+import "issue41496b_lib.dart" as iss;
+
+import "org-dartlang-testcase:///issue41496b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
+static method main() → dynamic {
+ iss::main();
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41496b_lib.dart:7:11: Error: Field 'f1' should be initialized because its type 'void Function()' doesn't allow null.
+// LegacyFoo f1;
+// ^^
+//
+// pkg/front_end/testcases/nnbd/issue41496b_lib.dart:10:20: Error: Field 'f2' should be initialized because its type 'void Function()' doesn't allow null.
+// static LegacyFoo f2;
+// ^^
+//
+import self as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41496b.dart";
+
+class C extends core::Object {
+ static field () → void f2 = null;
+ synthetic constructor •() → iss::C
+ : super core::Object::•()
+ ;
+}
+static field () → void f1;
+static method main() → dynamic {
+ new iss::C::•();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41496b.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41496b.dart.strong.transformed.expect
new file mode 100644
index 0000000..b70a566
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496b.dart.strong.transformed.expect
@@ -0,0 +1,39 @@
+library opted_out_lib;
+import self as self;
+import "issue41496b_lib.dart" as iss;
+
+import "org-dartlang-testcase:///issue41496b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
+static method main() → dynamic {
+ iss::main();
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41496b_lib.dart:7:11: Error: Field 'f1' should be initialized because its type 'void Function()' doesn't allow null.
+// LegacyFoo f1;
+// ^^
+//
+// pkg/front_end/testcases/nnbd/issue41496b_lib.dart:10:20: Error: Field 'f2' should be initialized because its type 'void Function()' doesn't allow null.
+// static LegacyFoo f2;
+// ^^
+//
+import self as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41496b.dart";
+
+class C extends core::Object {
+ static field () → void f2 = null;
+ synthetic constructor •() → iss::C
+ : super core::Object::•()
+ ;
+}
+static field () → void f1;
+static method main() → dynamic {
+ new iss::C::•();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41496b.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41496b.dart.weak.expect
new file mode 100644
index 0000000..b70a566
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496b.dart.weak.expect
@@ -0,0 +1,39 @@
+library opted_out_lib;
+import self as self;
+import "issue41496b_lib.dart" as iss;
+
+import "org-dartlang-testcase:///issue41496b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
+static method main() → dynamic {
+ iss::main();
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41496b_lib.dart:7:11: Error: Field 'f1' should be initialized because its type 'void Function()' doesn't allow null.
+// LegacyFoo f1;
+// ^^
+//
+// pkg/front_end/testcases/nnbd/issue41496b_lib.dart:10:20: Error: Field 'f2' should be initialized because its type 'void Function()' doesn't allow null.
+// static LegacyFoo f2;
+// ^^
+//
+import self as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41496b.dart";
+
+class C extends core::Object {
+ static field () → void f2 = null;
+ synthetic constructor •() → iss::C
+ : super core::Object::•()
+ ;
+}
+static field () → void f1;
+static method main() → dynamic {
+ new iss::C::•();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41496b.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41496b.dart.weak.transformed.expect
new file mode 100644
index 0000000..b70a566
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496b.dart.weak.transformed.expect
@@ -0,0 +1,39 @@
+library opted_out_lib;
+import self as self;
+import "issue41496b_lib.dart" as iss;
+
+import "org-dartlang-testcase:///issue41496b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
+static method main() → dynamic {
+ iss::main();
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41496b_lib.dart:7:11: Error: Field 'f1' should be initialized because its type 'void Function()' doesn't allow null.
+// LegacyFoo f1;
+// ^^
+//
+// pkg/front_end/testcases/nnbd/issue41496b_lib.dart:10:20: Error: Field 'f2' should be initialized because its type 'void Function()' doesn't allow null.
+// static LegacyFoo f2;
+// ^^
+//
+import self as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41496b.dart";
+
+class C extends core::Object {
+ static field () → void f2 = null;
+ synthetic constructor •() → iss::C
+ : super core::Object::•()
+ ;
+}
+static field () → void f1;
+static method main() → dynamic {
+ new iss::C::•();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41496b_lib.dart b/pkg/front_end/testcases/nnbd/issue41496b_lib.dart
new file mode 100644
index 0000000..06bf01a
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41496b_lib.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2020, 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 "issue41496b.dart";
+
+LegacyFoo f1;
+
+class C {
+ static LegacyFoo f2;
+}
+
+main() {
+ new C();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41498.dart b/pkg/front_end/testcases/nnbd/issue41498.dart
new file mode 100644
index 0000000..e6c1130
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2020, 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 "issue41498_lib.dart";
+
+class C {
+ static void test() {
+ LegacyFoo f;
+
+ f.toString(); // error
+ }
+
+ void test2() {
+ LegacyFoo f;
+
+ f.toString(); // error
+ }
+}
+
+test() {
+ LegacyFoo f;
+
+ f.toString(); // error
+
+ Function foo = () {
+ LegacyFoo f;
+
+ f.toString(); // error
+ };
+ C.test();
+ new C().test2();
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue41498.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue41498.dart.outline.expect
new file mode 100644
index 0000000..b4fdb09
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498.dart.outline.expect
@@ -0,0 +1,34 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498_lib.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self::C
+ ;
+ static method test() → void
+ ;
+ method test2() → void
+ ;
+}
+static method test() → dynamic
+ ;
+static method main() → dynamic
+ ;
+
+library opted_out_lib;
+import self as self2;
+import "dart:core" as core;
+
+typedef LegacyFoo = () →* void;
+class C extends core::Object {
+ synthetic constructor •() → self2::C*
+ ;
+ static method test() → void
+ ;
+ method test2() → void
+ ;
+}
+static method test() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/nnbd/issue41498.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41498.dart.strong.expect
new file mode 100644
index 0000000..f2f0faa
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498.dart.strong.expect
@@ -0,0 +1,86 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498_lib.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () → void f;
+ (let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+ method test2() → void {
+ () → void f;
+ (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () → void f;
+ (let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ core::Function foo = () → core::Null? {
+ () → void f;
+ (let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ };
+ self::C::test();
+ new self::C::•().{self::C::test2}();
+}
+static method main() → dynamic {}
+
+library opted_out_lib;
+import self as self2;
+import "dart:core" as core;
+
+typedef LegacyFoo = () →* void;
+class C extends core::Object {
+ synthetic constructor •() → self2::C*
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+ method test2() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () →* void f;
+ f.{core::Object::toString}();
+ core::Function* foo = () → core::Null? {
+ () →* void f;
+ f.{core::Object::toString}();
+ };
+ self2::C::test();
+ new self2::C::•().{self2::C::test2}();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41498.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41498.dart.strong.transformed.expect
new file mode 100644
index 0000000..f2f0faa
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498.dart.strong.transformed.expect
@@ -0,0 +1,86 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498_lib.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () → void f;
+ (let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+ method test2() → void {
+ () → void f;
+ (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () → void f;
+ (let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ core::Function foo = () → core::Null? {
+ () → void f;
+ (let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ };
+ self::C::test();
+ new self::C::•().{self::C::test2}();
+}
+static method main() → dynamic {}
+
+library opted_out_lib;
+import self as self2;
+import "dart:core" as core;
+
+typedef LegacyFoo = () →* void;
+class C extends core::Object {
+ synthetic constructor •() → self2::C*
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+ method test2() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () →* void f;
+ f.{core::Object::toString}();
+ core::Function* foo = () → core::Null? {
+ () →* void f;
+ f.{core::Object::toString}();
+ };
+ self2::C::test();
+ new self2::C::•().{self2::C::test2}();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41498.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41498.dart.weak.expect
new file mode 100644
index 0000000..f2f0faa
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498.dart.weak.expect
@@ -0,0 +1,86 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498_lib.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () → void f;
+ (let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+ method test2() → void {
+ () → void f;
+ (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () → void f;
+ (let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ core::Function foo = () → core::Null? {
+ () → void f;
+ (let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ };
+ self::C::test();
+ new self::C::•().{self::C::test2}();
+}
+static method main() → dynamic {}
+
+library opted_out_lib;
+import self as self2;
+import "dart:core" as core;
+
+typedef LegacyFoo = () →* void;
+class C extends core::Object {
+ synthetic constructor •() → self2::C*
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+ method test2() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () →* void f;
+ f.{core::Object::toString}();
+ core::Function* foo = () → core::Null? {
+ () →* void f;
+ f.{core::Object::toString}();
+ };
+ self2::C::test();
+ new self2::C::•().{self2::C::test2}();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41498.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41498.dart.weak.transformed.expect
new file mode 100644
index 0000000..f2f0faa
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498.dart.weak.transformed.expect
@@ -0,0 +1,86 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498_lib.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () → void f;
+ (let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+ method test2() → void {
+ () → void f;
+ (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () → void f;
+ (let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ core::Function foo = () → core::Null? {
+ () → void f;
+ (let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ };
+ self::C::test();
+ new self::C::•().{self::C::test2}();
+}
+static method main() → dynamic {}
+
+library opted_out_lib;
+import self as self2;
+import "dart:core" as core;
+
+typedef LegacyFoo = () →* void;
+class C extends core::Object {
+ synthetic constructor •() → self2::C*
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+ method test2() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () →* void f;
+ f.{core::Object::toString}();
+ core::Function* foo = () → core::Null? {
+ () →* void f;
+ f.{core::Object::toString}();
+ };
+ self2::C::test();
+ new self2::C::•().{self2::C::test2}();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41498_lib.dart b/pkg/front_end/testcases/nnbd/issue41498_lib.dart
new file mode 100644
index 0000000..9d4a423
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498_lib.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2020, 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.
+
+// @dart=2.6
+library opted_out_lib;
+
+typedef void LegacyFoo();
+
+class C {
+ static void test() {
+ LegacyFoo f;
+
+ f.toString(); // ok
+ }
+
+ void test2() {
+ LegacyFoo f;
+
+ f.toString(); // ok
+ }
+}
+
+test() {
+ LegacyFoo f;
+
+ f.toString(); // ok
+
+ Function foo = () {
+ LegacyFoo f;
+
+ f.toString(); // ok
+ };
+ C.test();
+ new C().test2();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41498b.dart b/pkg/front_end/testcases/nnbd/issue41498b.dart
new file mode 100644
index 0000000..4a6a49c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498b.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2020, 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.
+
+// @dart=2.6
+library opted_out_lib;
+
+import 'issue41498b_lib.dart' as opt_in;
+
+typedef void LegacyFoo();
+
+class C {
+ static void test() {
+ LegacyFoo f;
+
+ f.toString(); // ok
+ }
+
+ void test2() {
+ LegacyFoo f;
+
+ f.toString(); // ok
+ }
+}
+
+test() {
+ LegacyFoo f;
+
+ f.toString(); // ok
+
+ Function foo = () {
+ LegacyFoo f;
+
+ f.toString(); // ok
+ };
+ C.test();
+ new C().test2();
+}
+
+main() {
+ opt_in.main();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41498b.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue41498b.dart.outline.expect
new file mode 100644
index 0000000..86599c8
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498b.dart.outline.expect
@@ -0,0 +1,38 @@
+library opted_out_lib;
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+class C extends core::Object {
+ synthetic constructor •() → self::C*
+ ;
+ static method test() → void
+ ;
+ method test2() → void
+ ;
+}
+static method test() → dynamic
+ ;
+static method main() → dynamic
+ ;
+
+library /*isNonNullableByDefault*/;
+import self as self2;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498b.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self2::C
+ ;
+ static method test() → void
+ ;
+ method test2() → void
+ ;
+}
+static method test() → dynamic
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/nnbd/issue41498b.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41498b.dart.strong.expect
new file mode 100644
index 0000000..6d86cf5
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498b.dart.strong.expect
@@ -0,0 +1,92 @@
+library opted_out_lib;
+import self as self;
+import "dart:core" as core;
+import "issue41498b_lib.dart" as iss;
+
+import "org-dartlang-testcase:///issue41498b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+class C extends core::Object {
+ synthetic constructor •() → self::C*
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+ method test2() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () →* void f;
+ f.{core::Object::toString}();
+ core::Function* foo = () → core::Null? {
+ () →* void f;
+ f.{core::Object::toString}();
+ };
+ self::C::test();
+ new self::C::•().{self::C::test2}();
+}
+static method main() → dynamic {
+ iss::main();
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+import self as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498b.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → iss::C
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () → void f;
+ (let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+ method test2() → void {
+ () → void f;
+ (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () → void f;
+ (let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ core::Function foo = () → core::Null? {
+ () → void f;
+ (let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ };
+ iss::C::test();
+ new iss::C::•().{iss::C::test2}();
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41498b.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41498b.dart.strong.transformed.expect
new file mode 100644
index 0000000..6d86cf5
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498b.dart.strong.transformed.expect
@@ -0,0 +1,92 @@
+library opted_out_lib;
+import self as self;
+import "dart:core" as core;
+import "issue41498b_lib.dart" as iss;
+
+import "org-dartlang-testcase:///issue41498b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+class C extends core::Object {
+ synthetic constructor •() → self::C*
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+ method test2() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () →* void f;
+ f.{core::Object::toString}();
+ core::Function* foo = () → core::Null? {
+ () →* void f;
+ f.{core::Object::toString}();
+ };
+ self::C::test();
+ new self::C::•().{self::C::test2}();
+}
+static method main() → dynamic {
+ iss::main();
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+import self as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498b.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → iss::C
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () → void f;
+ (let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+ method test2() → void {
+ () → void f;
+ (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () → void f;
+ (let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ core::Function foo = () → core::Null? {
+ () → void f;
+ (let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ };
+ iss::C::test();
+ new iss::C::•().{iss::C::test2}();
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41498b.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41498b.dart.weak.expect
new file mode 100644
index 0000000..6d86cf5
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498b.dart.weak.expect
@@ -0,0 +1,92 @@
+library opted_out_lib;
+import self as self;
+import "dart:core" as core;
+import "issue41498b_lib.dart" as iss;
+
+import "org-dartlang-testcase:///issue41498b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+class C extends core::Object {
+ synthetic constructor •() → self::C*
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+ method test2() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () →* void f;
+ f.{core::Object::toString}();
+ core::Function* foo = () → core::Null? {
+ () →* void f;
+ f.{core::Object::toString}();
+ };
+ self::C::test();
+ new self::C::•().{self::C::test2}();
+}
+static method main() → dynamic {
+ iss::main();
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+import self as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498b.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → iss::C
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () → void f;
+ (let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+ method test2() → void {
+ () → void f;
+ (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () → void f;
+ (let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ core::Function foo = () → core::Null? {
+ () → void f;
+ (let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ };
+ iss::C::test();
+ new iss::C::•().{iss::C::test2}();
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41498b.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41498b.dart.weak.transformed.expect
new file mode 100644
index 0000000..6d86cf5
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498b.dart.weak.transformed.expect
@@ -0,0 +1,92 @@
+library opted_out_lib;
+import self as self;
+import "dart:core" as core;
+import "issue41498b_lib.dart" as iss;
+
+import "org-dartlang-testcase:///issue41498b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+class C extends core::Object {
+ synthetic constructor •() → self::C*
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+ method test2() → void {
+ () →* void f;
+ f.{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () →* void f;
+ f.{core::Object::toString}();
+ core::Function* foo = () → core::Null? {
+ () →* void f;
+ f.{core::Object::toString}();
+ };
+ self::C::test();
+ new self::C::•().{self::C::test2}();
+}
+static method main() → dynamic {
+ iss::main();
+}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41498b_lib.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+// f.toString(); // error
+// ^
+//
+import self as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41498b.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → iss::C
+ : super core::Object::•()
+ ;
+ static method test() → void {
+ () → void f;
+ (let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:11:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+ method test2() → void {
+ () → void f;
+ (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:17:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ }
+}
+static method test() → dynamic {
+ () → void f;
+ (let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:24:3: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ core::Function foo = () → core::Null? {
+ () → void f;
+ (let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41498b_lib.dart:29:5: Error: Non-nullable variable 'f' must be assigned before it can be used.
+ f.toString(); // error
+ ^" in f).{core::Object::toString}();
+ };
+ iss::C::test();
+ new iss::C::•().{iss::C::test2}();
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41498b_lib.dart b/pkg/front_end/testcases/nnbd/issue41498b_lib.dart
new file mode 100644
index 0000000..ba3e746
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41498b_lib.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2020, 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 "issue41498b.dart";
+
+class C {
+ static void test() {
+ LegacyFoo f;
+
+ f.toString(); // error
+ }
+
+ void test2() {
+ LegacyFoo f;
+
+ f.toString(); // error
+ }
+}
+
+test() {
+ LegacyFoo f;
+
+ f.toString(); // error
+
+ Function foo = () {
+ LegacyFoo f;
+
+ f.toString(); // error
+ };
+ C.test();
+ new C().test2();
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue41499.dart b/pkg/front_end/testcases/nnbd/issue41499.dart
new file mode 100644
index 0000000..60fac65
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2020, 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 "issue41499_lib.dart";
+
+class C {
+ static LegacyFoo sTest() {}
+
+ LegacyFoo mTest() {}
+
+ LegacyFoo get gTest {}
+}
+
+LegacyFoo test() {}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue41499.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue41499.dart.outline.expect
new file mode 100644
index 0000000..4b8ad7d
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499.dart.outline.expect
@@ -0,0 +1,27 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41499_lib.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self::C
+ ;
+ static method sTest() → () → void
+ ;
+ method mTest() → () → void
+ ;
+ get gTest() → () → void
+ ;
+}
+static method test() → () → void
+ ;
+static method main() → dynamic
+ ;
+
+library;
+import self as self2;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic
+ ;
diff --git a/pkg/front_end/testcases/nnbd/issue41499.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41499.dart.strong.expect
new file mode 100644
index 0000000..e55976c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499.dart.strong.expect
@@ -0,0 +1,57 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// static LegacyFoo sTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo mTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo get gTest {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo test() {}
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41499_lib.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+ static method sTest() → () → void {
+ return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ static LegacyFoo sTest() {}
+ ^" in null;
+ }
+ method mTest() → () → void {
+ return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo mTest() {}
+ ^" in null;
+ }
+ get gTest() → () → void {
+ return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo get gTest {}
+ ^" in null;
+ }
+}
+static method test() → () → void {
+ return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+LegacyFoo test() {}
+ ^" in null;
+}
+static method main() → dynamic {}
+
+library;
+import self as self2;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41499.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41499.dart.strong.transformed.expect
new file mode 100644
index 0000000..e55976c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499.dart.strong.transformed.expect
@@ -0,0 +1,57 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// static LegacyFoo sTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo mTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo get gTest {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo test() {}
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41499_lib.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+ static method sTest() → () → void {
+ return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ static LegacyFoo sTest() {}
+ ^" in null;
+ }
+ method mTest() → () → void {
+ return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo mTest() {}
+ ^" in null;
+ }
+ get gTest() → () → void {
+ return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo get gTest {}
+ ^" in null;
+ }
+}
+static method test() → () → void {
+ return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+LegacyFoo test() {}
+ ^" in null;
+}
+static method main() → dynamic {}
+
+library;
+import self as self2;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41499.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41499.dart.weak.expect
new file mode 100644
index 0000000..e55976c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499.dart.weak.expect
@@ -0,0 +1,57 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// static LegacyFoo sTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo mTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo get gTest {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo test() {}
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41499_lib.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+ static method sTest() → () → void {
+ return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ static LegacyFoo sTest() {}
+ ^" in null;
+ }
+ method mTest() → () → void {
+ return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo mTest() {}
+ ^" in null;
+ }
+ get gTest() → () → void {
+ return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo get gTest {}
+ ^" in null;
+ }
+}
+static method test() → () → void {
+ return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+LegacyFoo test() {}
+ ^" in null;
+}
+static method main() → dynamic {}
+
+library;
+import self as self2;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41499.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41499.dart.weak.transformed.expect
new file mode 100644
index 0000000..e55976c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499.dart.weak.transformed.expect
@@ -0,0 +1,57 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// static LegacyFoo sTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo mTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo get gTest {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo test() {}
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41499_lib.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self::C
+ : super core::Object::•()
+ ;
+ static method sTest() → () → void {
+ return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ static LegacyFoo sTest() {}
+ ^" in null;
+ }
+ method mTest() → () → void {
+ return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo mTest() {}
+ ^" in null;
+ }
+ get gTest() → () → void {
+ return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo get gTest {}
+ ^" in null;
+ }
+}
+static method test() → () → void {
+ return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+LegacyFoo test() {}
+ ^" in null;
+}
+static method main() → dynamic {}
+
+library;
+import self as self2;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41499_lib.dart b/pkg/front_end/testcases/nnbd/issue41499_lib.dart
new file mode 100644
index 0000000..ae38a19
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499_lib.dart
@@ -0,0 +1,8 @@
+// Copyright (c) 2020, 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.
+
+// @dart=2.6
+typedef void LegacyFoo();
+
+test(LegacyFoo f) {}
diff --git a/pkg/front_end/testcases/nnbd/issue41499b.dart b/pkg/front_end/testcases/nnbd/issue41499b.dart
new file mode 100644
index 0000000..e03840c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499b.dart
@@ -0,0 +1,13 @@
+// Copyright (c) 2020, 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.
+
+// @dart=2.6
+
+import 'issue41499b_lib.dart' as opt_in;
+
+typedef void LegacyFoo();
+
+test(LegacyFoo f) {}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue41499b.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue41499b.dart.outline.expect
new file mode 100644
index 0000000..dd70ad6
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499b.dart.outline.expect
@@ -0,0 +1,29 @@
+library;
+import self as self;
+
+import "org-dartlang-testcase:///issue41499b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic
+ ;
+static method main() → dynamic
+ ;
+
+library /*isNonNullableByDefault*/;
+import self as self2;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41499b.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self2::C
+ ;
+ static method sTest() → () → void
+ ;
+ method mTest() → () → void
+ ;
+ get gTest() → () → void
+ ;
+}
+static method test() → () → void
+ ;
diff --git a/pkg/front_end/testcases/nnbd/issue41499b.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41499b.dart.strong.expect
new file mode 100644
index 0000000..06d4715
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499b.dart.strong.expect
@@ -0,0 +1,59 @@
+library;
+import self as self;
+
+import "org-dartlang-testcase:///issue41499b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// static LegacyFoo sTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo mTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo get gTest {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo test() {}
+// ^
+//
+import self as self2;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41499b.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self2::C
+ : super core::Object::•()
+ ;
+ static method sTest() → () → void {
+ return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ static LegacyFoo sTest() {}
+ ^" in null;
+ }
+ method mTest() → () → void {
+ return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo mTest() {}
+ ^" in null;
+ }
+ get gTest() → () → void {
+ return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo get gTest {}
+ ^" in null;
+ }
+}
+static method test() → () → void {
+ return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+LegacyFoo test() {}
+ ^" in null;
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41499b.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41499b.dart.strong.transformed.expect
new file mode 100644
index 0000000..06d4715
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499b.dart.strong.transformed.expect
@@ -0,0 +1,59 @@
+library;
+import self as self;
+
+import "org-dartlang-testcase:///issue41499b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// static LegacyFoo sTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo mTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo get gTest {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo test() {}
+// ^
+//
+import self as self2;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41499b.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self2::C
+ : super core::Object::•()
+ ;
+ static method sTest() → () → void {
+ return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ static LegacyFoo sTest() {}
+ ^" in null;
+ }
+ method mTest() → () → void {
+ return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo mTest() {}
+ ^" in null;
+ }
+ get gTest() → () → void {
+ return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo get gTest {}
+ ^" in null;
+ }
+}
+static method test() → () → void {
+ return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+LegacyFoo test() {}
+ ^" in null;
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41499b.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41499b.dart.weak.expect
new file mode 100644
index 0000000..06d4715
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499b.dart.weak.expect
@@ -0,0 +1,59 @@
+library;
+import self as self;
+
+import "org-dartlang-testcase:///issue41499b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// static LegacyFoo sTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo mTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo get gTest {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo test() {}
+// ^
+//
+import self as self2;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41499b.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self2::C
+ : super core::Object::•()
+ ;
+ static method sTest() → () → void {
+ return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ static LegacyFoo sTest() {}
+ ^" in null;
+ }
+ method mTest() → () → void {
+ return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo mTest() {}
+ ^" in null;
+ }
+ get gTest() → () → void {
+ return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo get gTest {}
+ ^" in null;
+ }
+}
+static method test() → () → void {
+ return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+LegacyFoo test() {}
+ ^" in null;
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41499b.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41499b.dart.weak.transformed.expect
new file mode 100644
index 0000000..06d4715
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499b.dart.weak.transformed.expect
@@ -0,0 +1,59 @@
+library;
+import self as self;
+
+import "org-dartlang-testcase:///issue41499b_lib.dart" as opt_in;
+
+typedef LegacyFoo = () →* void;
+static method test(() →* void f) → dynamic {}
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// static LegacyFoo sTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo mTest() {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo get gTest {}
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue41499b_lib.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+// LegacyFoo test() {}
+// ^
+//
+import self as self2;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue41499b.dart";
+
+class C extends core::Object {
+ synthetic constructor •() → self2::C
+ : super core::Object::•()
+ ;
+ static method sTest() → () → void {
+ return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:8:20: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ static LegacyFoo sTest() {}
+ ^" in null;
+ }
+ method mTest() → () → void {
+ return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:10:13: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo mTest() {}
+ ^" in null;
+ }
+ get gTest() → () → void {
+ return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:12:17: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+ LegacyFoo get gTest {}
+ ^" in null;
+ }
+}
+static method test() → () → void {
+ return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41499b_lib.dart:15:11: Error: A non-null value must be returned since the return type 'void Function()' doesn't allow null.
+LegacyFoo test() {}
+ ^" in null;
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41499b_lib.dart b/pkg/front_end/testcases/nnbd/issue41499b_lib.dart
new file mode 100644
index 0000000..0e205c2
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41499b_lib.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2020, 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 "issue41499b.dart";
+
+class C {
+ static LegacyFoo sTest() {}
+
+ LegacyFoo mTest() {}
+
+ LegacyFoo get gTest {}
+}
+
+LegacyFoo test() {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart
new file mode 100644
index 0000000..0b00978
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2020, 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 'dart:async';
+import 'issue41501_lib.dart';
+
+typedef AAliasNonNullable = A;
+
+typedef AAliasNullable = A?;
+
+test() {
+ FutureOr<AAlias> foLegacyNonNullable = null; // error
+ FutureOr<AAlias?> foLegacyNullable = null; // ok
+ FutureOr<AAliasNonNullable> foNonNullable = null; // error
+ FutureOr<AAliasNullable> foNullable = null; // ok
+ FutureOr<AAliasNonNullable?> foNonNullableNullable = null; // ok
+ FutureOr<AAliasNullable?> foNullableNullable = null; // ok
+}
+
+main() {}
\ No newline at end of file
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.outline.expect
new file mode 100644
index 0000000..7f9a293
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.outline.expect
@@ -0,0 +1,28 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "issue41501_lib.dart" as opt;
+
+import "dart:async";
+import "org-dartlang-testcase:///issue41501_lib.dart";
+
+typedef AAliasNonNullable = opt::A;
+typedef AAliasNullable = opt::A?;
+static method test() → dynamic
+ ;
+static method main() → dynamic
+ ;
+
+library opted_out_lib;
+import self as opt;
+import "dart:core" as core;
+
+import "dart:async";
+import "org-dartlang-testcase:///issue41501.dart";
+
+typedef AAlias = opt::A*;
+class A extends core::Object {
+ synthetic constructor •() → opt::A*
+ ;
+}
+static method test() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.expect
new file mode 100644
index 0000000..6d57a3c
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.expect
@@ -0,0 +1,62 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+// - 'FutureOr' is from 'dart:async'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+// FutureOr<AAlias> foLegacyNonNullable = null; // error
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+// - 'FutureOr' is from 'dart:async'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+// FutureOr<AAliasNonNullable> foNonNullable = null; // error
+// ^
+//
+import self as self;
+import "issue41501_lib.dart" as opt;
+import "dart:async" as asy;
+
+import "dart:async";
+import "org-dartlang-testcase:///issue41501_lib.dart";
+
+typedef AAliasNonNullable = opt::A;
+typedef AAliasNullable = opt::A?;
+static method test() → dynamic {
+ asy::FutureOr<opt::A> foLegacyNonNullable = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+ - 'FutureOr' is from 'dart:async'.
+ - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+ FutureOr<AAlias> foLegacyNonNullable = null; // error
+ ^" in null as{TypeError,ForNonNullableByDefault} asy::FutureOr<opt::A>;
+ asy::FutureOr<opt::A?> foLegacyNullable = null;
+ asy::FutureOr<opt::A> foNonNullable = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+ - 'FutureOr' is from 'dart:async'.
+ - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+ FutureOr<AAliasNonNullable> foNonNullable = null; // error
+ ^" in null as{TypeError,ForNonNullableByDefault} asy::FutureOr<opt::A>;
+ asy::FutureOr<opt::A?> foNullable = null;
+ asy::FutureOr<opt::A?> foNonNullableNullable = null;
+ asy::FutureOr<opt::A?> foNullableNullable = null;
+}
+static method main() → dynamic {}
+
+library opted_out_lib;
+import self as opt;
+import "dart:core" as core;
+import "dart:async" as asy;
+
+import "dart:async";
+import "org-dartlang-testcase:///issue41501.dart";
+
+typedef AAlias = opt::A*;
+class A extends core::Object {
+ synthetic constructor •() → opt::A*
+ : super core::Object::•()
+ ;
+}
+static method test() → dynamic {
+ asy::FutureOr<opt::A*>* foLegacy = null;
+ asy::FutureOr<opt::A*>* foNonNullable = null;
+ asy::FutureOr<opt::A*>* foNullable = null;
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.transformed.expect
new file mode 100644
index 0000000..6d57a3c
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.strong.transformed.expect
@@ -0,0 +1,62 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+// - 'FutureOr' is from 'dart:async'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+// FutureOr<AAlias> foLegacyNonNullable = null; // error
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+// - 'FutureOr' is from 'dart:async'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+// FutureOr<AAliasNonNullable> foNonNullable = null; // error
+// ^
+//
+import self as self;
+import "issue41501_lib.dart" as opt;
+import "dart:async" as asy;
+
+import "dart:async";
+import "org-dartlang-testcase:///issue41501_lib.dart";
+
+typedef AAliasNonNullable = opt::A;
+typedef AAliasNullable = opt::A?;
+static method test() → dynamic {
+ asy::FutureOr<opt::A> foLegacyNonNullable = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+ - 'FutureOr' is from 'dart:async'.
+ - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+ FutureOr<AAlias> foLegacyNonNullable = null; // error
+ ^" in null as{TypeError,ForNonNullableByDefault} asy::FutureOr<opt::A>;
+ asy::FutureOr<opt::A?> foLegacyNullable = null;
+ asy::FutureOr<opt::A> foNonNullable = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+ - 'FutureOr' is from 'dart:async'.
+ - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+ FutureOr<AAliasNonNullable> foNonNullable = null; // error
+ ^" in null as{TypeError,ForNonNullableByDefault} asy::FutureOr<opt::A>;
+ asy::FutureOr<opt::A?> foNullable = null;
+ asy::FutureOr<opt::A?> foNonNullableNullable = null;
+ asy::FutureOr<opt::A?> foNullableNullable = null;
+}
+static method main() → dynamic {}
+
+library opted_out_lib;
+import self as opt;
+import "dart:core" as core;
+import "dart:async" as asy;
+
+import "dart:async";
+import "org-dartlang-testcase:///issue41501.dart";
+
+typedef AAlias = opt::A*;
+class A extends core::Object {
+ synthetic constructor •() → opt::A*
+ : super core::Object::•()
+ ;
+}
+static method test() → dynamic {
+ asy::FutureOr<opt::A*>* foLegacy = null;
+ asy::FutureOr<opt::A*>* foNonNullable = null;
+ asy::FutureOr<opt::A*>* foNullable = null;
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect
new file mode 100644
index 0000000..6d57a3c
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect
@@ -0,0 +1,62 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+// - 'FutureOr' is from 'dart:async'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+// FutureOr<AAlias> foLegacyNonNullable = null; // error
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+// - 'FutureOr' is from 'dart:async'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+// FutureOr<AAliasNonNullable> foNonNullable = null; // error
+// ^
+//
+import self as self;
+import "issue41501_lib.dart" as opt;
+import "dart:async" as asy;
+
+import "dart:async";
+import "org-dartlang-testcase:///issue41501_lib.dart";
+
+typedef AAliasNonNullable = opt::A;
+typedef AAliasNullable = opt::A?;
+static method test() → dynamic {
+ asy::FutureOr<opt::A> foLegacyNonNullable = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+ - 'FutureOr' is from 'dart:async'.
+ - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+ FutureOr<AAlias> foLegacyNonNullable = null; // error
+ ^" in null as{TypeError,ForNonNullableByDefault} asy::FutureOr<opt::A>;
+ asy::FutureOr<opt::A?> foLegacyNullable = null;
+ asy::FutureOr<opt::A> foNonNullable = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+ - 'FutureOr' is from 'dart:async'.
+ - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+ FutureOr<AAliasNonNullable> foNonNullable = null; // error
+ ^" in null as{TypeError,ForNonNullableByDefault} asy::FutureOr<opt::A>;
+ asy::FutureOr<opt::A?> foNullable = null;
+ asy::FutureOr<opt::A?> foNonNullableNullable = null;
+ asy::FutureOr<opt::A?> foNullableNullable = null;
+}
+static method main() → dynamic {}
+
+library opted_out_lib;
+import self as opt;
+import "dart:core" as core;
+import "dart:async" as asy;
+
+import "dart:async";
+import "org-dartlang-testcase:///issue41501.dart";
+
+typedef AAlias = opt::A*;
+class A extends core::Object {
+ synthetic constructor •() → opt::A*
+ : super core::Object::•()
+ ;
+}
+static method test() → dynamic {
+ asy::FutureOr<opt::A*>* foLegacy = null;
+ asy::FutureOr<opt::A*>* foNonNullable = null;
+ asy::FutureOr<opt::A*>* foNullable = null;
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect
new file mode 100644
index 0000000..6d57a3c
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect
@@ -0,0 +1,62 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+// - 'FutureOr' is from 'dart:async'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+// FutureOr<AAlias> foLegacyNonNullable = null; // error
+// ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+// - 'FutureOr' is from 'dart:async'.
+// - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+// FutureOr<AAliasNonNullable> foNonNullable = null; // error
+// ^
+//
+import self as self;
+import "issue41501_lib.dart" as opt;
+import "dart:async" as asy;
+
+import "dart:async";
+import "org-dartlang-testcase:///issue41501_lib.dart";
+
+typedef AAliasNonNullable = opt::A;
+typedef AAliasNullable = opt::A?;
+static method test() → dynamic {
+ asy::FutureOr<opt::A> foLegacyNonNullable = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+ - 'FutureOr' is from 'dart:async'.
+ - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+ FutureOr<AAlias> foLegacyNonNullable = null; // error
+ ^" in null as{TypeError,ForNonNullableByDefault} asy::FutureOr<opt::A>;
+ asy::FutureOr<opt::A?> foLegacyNullable = null;
+ asy::FutureOr<opt::A> foNonNullable = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null?' can't be assigned to a variable of type 'FutureOr<A>'.
+ - 'FutureOr' is from 'dart:async'.
+ - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
+ FutureOr<AAliasNonNullable> foNonNullable = null; // error
+ ^" in null as{TypeError,ForNonNullableByDefault} asy::FutureOr<opt::A>;
+ asy::FutureOr<opt::A?> foNullable = null;
+ asy::FutureOr<opt::A?> foNonNullableNullable = null;
+ asy::FutureOr<opt::A?> foNullableNullable = null;
+}
+static method main() → dynamic {}
+
+library opted_out_lib;
+import self as opt;
+import "dart:core" as core;
+import "dart:async" as asy;
+
+import "dart:async";
+import "org-dartlang-testcase:///issue41501.dart";
+
+typedef AAlias = opt::A*;
+class A extends core::Object {
+ synthetic constructor •() → opt::A*
+ : super core::Object::•()
+ ;
+}
+static method test() → dynamic {
+ asy::FutureOr<opt::A*>* foLegacy = null;
+ asy::FutureOr<opt::A*>* foNonNullable = null;
+ asy::FutureOr<opt::A*>* foNullable = null;
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart
new file mode 100644
index 0000000..09e20d1
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2020, 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.
+
+// @dart=2.6
+
+library opted_out_lib;
+
+import 'dart:async';
+import 'issue41501.dart';
+
+class A {}
+
+typedef AAlias = A;
+
+test() {
+ FutureOr<AAlias> foLegacy = null; // ok
+ FutureOr<AAliasNonNullable> foNonNullable = null; // ok
+ FutureOr<AAliasNullable> foNullable = null; // ok
+}
+
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/test.options b/pkg/front_end/testcases/nonfunction_type_aliases/test.options
new file mode 100644
index 0000000..e7c1048
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/test.options
@@ -0,0 +1 @@
+--enable-experiment=non-nullable,nonfunction-type-aliases
\ No newline at end of file
diff --git a/pkg/front_end/testcases/text_serialization.status b/pkg/front_end/testcases/text_serialization.status
index f800f49..64d249d 100644
--- a/pkg/front_end/testcases/text_serialization.status
+++ b/pkg/front_end/testcases/text_serialization.status
@@ -35,8 +35,8 @@
extensions/extension_constructor: TextSerializationFailure
extensions/extension_field_with_type_parameter_usage: TextSerializationFailure
extensions/extension_methods: TextSerializationFailure
-extensions/extension_setter_error: TypeCheckError
extensions/extension_setter: TextSerializationFailure
+extensions/extension_setter_error: TypeCheckError
extensions/generic_function_in_generic_extension: TextSerializationFailure
extensions/getter_setter_conflict: TextSerializationFailure
extensions/if_null: TextSerializationFailure
@@ -44,15 +44,14 @@
extensions/implicit_this: TextSerializationFailure
extensions/import_via_prefix: TextSerializationFailure
extensions/index: TextSerializationFailure
-extensions/instance_access_of_static: TextSerializationFailure
extensions/instance_access: TextSerializationFailure
+extensions/instance_access_of_static: TextSerializationFailure
extensions/instance_members: TextSerializationFailure
extensions/instance_tearoff: TextSerializationFailure
extensions/internal_resolution: TextSerializationFailure
extensions/invalid_explicit_access: TextSerializationFailure
extensions/invalid_explicit_static_access: TextSerializationFailure
extensions/issue38600: TextSerializationFailure
-extensions/issue38712: TextSerializationFailure
extensions/issue38713: TextSerializationFailure
extensions/issue38745: TextSerializationFailure
extensions/issue38750: TextSerializationFailure
@@ -73,24 +72,343 @@
extensions/operators: TextSerializationFailure
extensions/other_kinds: TextSerializationFailure
extensions/private_members: TextSerializationFailure
-extensions/static_access_of_instance: TextSerializationFailure
extensions/static_access: TextSerializationFailure
+extensions/static_access_of_instance: TextSerializationFailure
extensions/tear_offs: TextSerializationFailure
extensions/type_variables: TextSerializationFailure
extensions/unnamed_extensions: TextSerializationFailure
extensions/use_this: TextSerializationFailure
+general/DeltaBlue: TextSerializationFailure # Was: Pass
+general/abstract_members: TypeCheckError
+general/abstract_overrides_concrete_with_no_such_method: TextSerializationFailure
+general/accessors: TextSerializationFailure # Was: RuntimeError
+general/all_variances: TextSerializationFailure
+general/ambiguous_exports: TextSerializationFailure # Was: RuntimeError # Expected, this file exports two main methods.
+general/annotation_on_enum_values: TextSerializationFailure # Was: Pass
+general/annotation_top: TextSerializationFailure # Was: Pass
+general/annotation_typedef_formals: TextSerializationFailure # Was: Pass
+general/annotation_typedef_formals_resolution: TextSerializationFailure # Was: Pass
+general/annotation_variable_declaration: TextSerializationFailure # Was: Pass
+general/argument: TextSerializationFailure # Was: Pass
+general/arithmetic: TextSerializationFailure # Was: Pass
+general/arrow_function: TextSerializationFailure # Was: Pass
+general/assign_to_initializing_formal: TextSerializationFailure
+general/async_function: TextSerializationFailure # Was: Pass
+general/async_nested: TextSerializationFailure # Was: Pass
+general/await_complex: TextSerializationFailure
+general/await_in_cascade: TextSerializationFailure
+general/await_in_non_async: RuntimeError
+general/await_in_non_async: TextSerializationFailure
+general/bad_setter_abstract: TextSerializationFailure # Was: Pass
+general/bad_store: TextSerializationFailure # Was: Pass
+general/bad_type_variable_uses_in_supertypes: TextSerializationFailure
+general/bounds_check_depends_on_inference: TextSerializationFailure # Was: Pass
+general/bug21938: TypeCheckError
+general/bug30695: TypeCheckError
+general/bug31124: TextSerializationFailure # Was: RuntimeError # Test has no main method (and we shouldn't add one).
+general/bug32414a: TextSerializationFailure # Was: Pass
+general/bug32414b: TextSerializationFailure # Was: Pass
+general/bug32426: TextSerializationFailure # Was: Pass
+general/bug32629: TextSerializationFailure
+general/bug32866: TextSerializationFailure # Was: Pass
+general/bug33099: TextSerializationFailure # Was: Pass
+general/bug33196: TextSerializationFailure # Was: Pass
+general/bug33206: TextSerializationFailure # Was: Pass
+general/bug33298: TextSerializationFailure # Was: Pass
+general/bug34511: TextSerializationFailure # Was: Pass
+general/bug35470: TextSerializationFailure # Was: Pass
+general/bug37476: TextSerializationFailure
+general/call: TypeCheckError
+general/candidate_found: TypeCheckError
+general/cascade: TextSerializationFailure # Was: RuntimeError
+general/casts: TextSerializationFailure # Was: Pass
+general/check_deferred_allocation: TextSerializationFailure # Was: Pass
+general/check_deferred_as_check: TextSerializationFailure # Was: Pass
+general/check_deferred_before_args2: TextSerializationFailure # Was: Pass
+general/check_deferred_before_args: TextSerializationFailure # Was: Pass
+general/check_deferred_before_call: TextSerializationFailure # Was: Pass
+general/check_deferred_before_write: TextSerializationFailure # Was: Pass
+general/check_deferred_is_check: TextSerializationFailure # Was: Pass
+general/check_deferred_read: TextSerializationFailure # Was: Pass
+general/check_deferred_read_static_field: TextSerializationFailure # Was: Pass
+general/check_deferred_read_type: TextSerializationFailure # Was: Pass
+general/check_deferred_static_method_call: TextSerializationFailure # Was: Pass
+general/check_deferred_type_declaration: TextSerializationFailure # Was: Pass
+general/circularity-via-initializing-formal: TextSerializationFailure # Was: Pass
+general/classes: TextSerializationFailure # Was: Pass
+general/clone_function_type: TextSerializationFailure # Was: Pass
+general/closure: TextSerializationFailure # Was: Pass
+general/co19_language_metadata_syntax_t04: TextSerializationFailure # Was: Pass
+general/complex_class_hierarchy: TextSerializationFailure
+general/compound_binary_implicit_as: TextSerializationFailure
+general/const_redirect_to_nonconst: TextSerializationFailure
+general/constant_truncate: TextSerializationFailure
+general/constructor_const_inference: TextSerializationFailure # Was: Pass
+general/constructor_cycle: TextSerializationFailure # Was: Pass
+general/constructor_function_types: TextSerializationFailure # Was: Pass
+general/constructor_initializer_invalid: TextSerializationFailure # Was: RuntimeError # Fails execution after recovery
+general/continue_inference_after_error: TextSerializationFailure # Was: Pass
+general/continue_inference_after_error_lib: TextSerializationFailure # Was: Pass
+general/control_flow_collection: TextSerializationFailure
+general/control_flow_collection_inference: TextSerializationFailure
+general/covariant_equals: TextSerializationFailure
+general/covariant_generic: TextSerializationFailure # Was: RuntimeError
+general/covariant_parameter_in_superclass_of_mixin_application: TextSerializationFailure
+general/cycles: TextSerializationFailure # Was: Pass
+general/default_values: TextSerializationFailure # Was: Pass
+general/deferred_lib: TextSerializationFailure # Was: Pass
+general/deferred_type_annotation: TextSerializationFailure # Was: Pass
+general/demote_closure_types: TextSerializationFailure
+general/duplicated_bad_prefix: TextSerializationFailure # Was: Pass
+general/duplicated_bad_prefix_lib1: TextSerializationFailure # Was: Pass
+general/duplicated_bad_prefix_lib2: TextSerializationFailure # Was: Pass
+general/duplicated_declarations: TypeCheckError
+general/duplicated_declarations_lib: TextSerializationFailure # Was: Pass
+general/duplicated_declarations_part: TextSerializationFailure # Was: Pass
+general/duplicated_field_initializer: TextSerializationFailure # Was: RuntimeError
+general/duplicated_named_args_3: TextSerializationFailure # Was: Pass
+general/error_locations/error_location_01: TextSerializationFailure
+general/error_locations/error_location_02: TextSerializationFailure
+general/error_locations/error_location_03: TextSerializationFailure
+general/error_locations/error_location_04: TextSerializationFailure
+general/error_locations/error_location_05: TextSerializationFailure
+general/error_locations/error_location_06: TextSerializationFailure
+general/error_recovery/await_not_in_async: TextSerializationFailure
+general/error_recovery/constructor_recovery_bad_name_general.crash: TextSerializationFailure
+general/error_recovery/constructor_recovery_bad_name_get.crash: TextSerializationFailure
+general/error_recovery/constructor_recovery_bad_name_return_type.crash: TextSerializationFailure
+general/error_recovery/constructor_recovery_bad_name_set.crash: TextSerializationFailure
+general/error_recovery/constructor_recovery_get: TextSerializationFailure
+general/error_recovery/constructor_recovery_ok: TextSerializationFailure
+general/error_recovery/constructor_recovery_operator.crash: TextSerializationFailure
+general/error_recovery/constructor_recovery_return_type: TextSerializationFailure
+general/error_recovery/constructor_recovery_set: TextSerializationFailure
+general/error_recovery/empty_await_for: TextSerializationFailure
+general/error_recovery/empty_for: TextSerializationFailure
+general/error_recovery/issue_38415.crash: RuntimeError
+general/error_recovery/issue_38415.crash: TextSerializationFailure
+general/error_recovery/issue_39024.crash: RuntimeError
+general/error_recovery/issue_39026.crash: TextSerializationFailure
+general/error_recovery/issue_39026_prime.crash: TextSerializationFailure
+general/error_recovery/issue_39033.crash: TextSerializationFailure
+general/error_recovery/issue_39058.crash: RuntimeError
+general/error_recovery/issue_39058_prime.crash: RuntimeError
+general/error_recovery/issue_39060: TextSerializationFailure
+general/error_recovery/issue_39202.crash: RuntimeError
+general/error_recovery/issue_39202.crash: TextSerializationFailure
+general/error_recovery/issue_39230.crash: TextSerializationFailure
+general/error_recovery/issue_39958_01: RuntimeError
+general/error_recovery/issue_39958_01: TextSerializationFailure
+general/error_recovery/issue_39958_02: RuntimeError
+general/error_recovery/issue_39958_02: TextSerializationFailure
+general/error_recovery/issue_39958_03: RuntimeError
+general/error_recovery/issue_39958_03: TextSerializationFailure
+general/error_recovery/issue_39958_04: RuntimeError
+general/error_recovery/issue_39958_04: TextSerializationFailure
+general/error_recovery/yield_not_in_generator: TextSerializationFailure
+general/escape: TextSerializationFailure # Was: Pass
+general/export_test: TextSerializationFailure # Was: Pass
+general/expressions: TextSerializationFailure # Was: RuntimeError
+general/extend_with_type_variable: TextSerializationFailure
+general/external: TextSerializationFailure # Was: Pass
+general/external_import: TextSerializationFailure # Was: RuntimeError # The native extension to import doesn't exist. This is ok.
+general/fallthrough: TextSerializationFailure
+general/ffi_sample: TextSerializationFailure
+general/fibonacci: TextSerializationFailure # Was: Pass
+general/for_in_scope: TextSerializationFailure # Was: Pass
+general/for_in_without_declaration: TextSerializationFailure
+general/forwarding_stub_for_operator: TextSerializationFailure
+general/function_in_field: TextSerializationFailure # Was: Pass
+general/function_type_assignments: TextSerializationFailure # Was: Pass
+general/function_type_is_check: TextSerializationFailure # Was: Pass
+general/function_type_recovery: TextSerializationFailure # Was: Pass
+general/functions: TextSerializationFailure # Was: Pass
+general/future_or_test: TextSerializationFailure # Was: Pass
+general/generic_function_type_in_message: TextSerializationFailure
+general/getter_call: TextSerializationFailure
+general/having_part_with_part_and_annotation: TextSerializationFailure
+general/having_part_with_parts_and_annotation: TextSerializationFailure
+general/if_null_in_cascade: TextSerializationFailure
+general/if_null_in_list_literal: TextSerializationFailure
+general/if_null_in_set_literal: TextSerializationFailure
+general/ignore_function: TextSerializationFailure
+general/illegal_named_function_expression: TextSerializationFailure # Was: Pass
+general/illegal_named_function_expression_scope: TextSerializationFailure # Was: Pass
+general/implicit_const_with_static_fields: TextSerializationFailure # Was: Pass
+general/implicit_new: TextSerializationFailure # Was: Pass
+general/implicit_scope_test: TextSerializationFailure # Was: Pass
+general/implicit_this: TextSerializationFailure # Was: Pass
+general/import_conflicting_getters: TextSerializationFailure
+general/import_conflicting_setters: TextSerializationFailure
+general/import_conflicting_type_member: TextSerializationFailure
+general/import_conflicting_types: TextSerializationFailure
+general/incomplete_field_formal_parameter: TextSerializationFailure # Was: RuntimeError
+general/infer_field_from_multiple: TypeCheckError
+general/infer_field_type: TextSerializationFailure
+general/infer_fixed_generic_return_type: TextSerializationFailure
+general/infer_map_literal_with_closure: TextSerializationFailure
+general/inherit_function: TextSerializationFailure
+general/interface_conflict: TextSerializationFailure
+general/interface_contravariant_from_class: TextSerializationFailure
+general/interface_covariantImpl_from_class: TextSerializationFailure
+general/interface_covariantInterface_from_class: TextSerializationFailure
+general/invalid_assignment: TextSerializationFailure # Was: Pass
+general/invalid_cast: TextSerializationFailure # Was: Pass
+general/invalid_operator2: TextSerializationFailure
+general/invalid_operator: TypeCheckError
+general/invalid_type: TextSerializationFailure
+general/invocations: TextSerializationFailure # Was: RuntimeError
+general/issue129167943: TextSerializationFailure
+general/issue34515: TextSerializationFailure
+general/issue34899: TextSerializationFailure
+general/issue35875: TextSerializationFailure
+general/issue37027: TextSerializationFailure
+general/issue37381: TextSerializationFailure
+general/issue37776: TextSerializationFailure
+general/issue38812: TextSerializationFailure
+general/issue38938: TextSerializationFailure
+general/issue38943: TextSerializationFailure
+general/issue38944: TextSerializationFailure
+general/issue38961: TextSerializationFailure
+general/issue39344: TextSerializationFailure
+general/issue39421: TextSerializationFailure
+general/issue39817: TextSerializationFailure
+general/issue40242: TextSerializationFailure
+general/issue40428: TextSerializationFailure
+general/issue40662: TextSerializationFailure
+general/issue40744: TextSerializationFailure
+general/issue41070: TextSerializationFailure
+general/issue41210a: TypeCheckError
+general/issue41210b/issue41210: TypeCheckError
+general/literals: TextSerializationFailure # Was: Pass
+general/local_generic_function: TextSerializationFailure # Was: Pass
+general/long_chain_of_typedefs: TextSerializationFailure
+general/magic_const: TextSerializationFailure # Was: Pass
+general/many_errors: TextSerializationFailure
+general/metadata_enum: TextSerializationFailure # Was: Pass
+general/metadata_named_mixin_application: TextSerializationFailure # Was: Pass
+general/micro: TextSerializationFailure # Was: RuntimeError
+general/missing_constructor: TextSerializationFailure # Was: Pass
+general/missing_toplevel: TextSerializationFailure
+general/mixin: TextSerializationFailure # Was: Pass
+general/mixin_application_inferred_parameter_type: TextSerializationFailure
+general/mixin_application_override: ExpectationFileMismatch
+general/mixin_application_override: TypeCheckError
+general/mixin_conflicts: TextSerializationFailure
+general/mixin_constructors_with_default_values: TextSerializationFailure # Was: Pass
+general/mixin_covariant: TextSerializationFailure
+general/mixin_inherited_setter_for_mixed_in_field: TextSerializationFailure # Was: Pass
+general/mixin_interface_conflict: TextSerializationFailure
+general/mixin_super_repeated: TextSerializationFailure # Was: Pass
+general/mixin_with_static_member: TextSerializationFailure
+general/named_function_scope: TextSerializationFailure # Was: Pass
+general/named_parameters: TextSerializationFailure # Was: Pass
+general/native_as_name: TextSerializationFailure # Was: Pass
+general/nested_implicit_const_with_env_var: TextSerializationFailure # Was: Pass
+general/nested_property_set: TextSerializationFailure
+general/nested_variable_set: TextSerializationFailure
+general/nested_variance: TextSerializationFailure
+general/no_such_method_private_setter: TextSerializationFailure # Was: Pass
+general/no_such_method_private_setter_lib: TextSerializationFailure # Was: Pass
+general/non_covariant_checks: TextSerializationFailure
+general/null_aware: TextSerializationFailure # Was: Pass
+general/null_aware_for_in: TextSerializationFailure
+general/null_aware_postfix: TextSerializationFailure
+general/null_aware_spread: TextSerializationFailure
+general/operator_method_not_found: TextSerializationFailure
+general/operators: TextSerializationFailure # Was: Pass
+general/optional: TypeCheckError
+general/override: TextSerializationFailure # Was: Pass
+general/override_check_accessor_after_inference: TypeCheckError # Issue #31620
+general/override_check_accessor_basic: TypeCheckError # Issue #31620
+general/override_check_accessor_with_covariant_modifier: TypeCheckError # Issue #31620
+general/override_check_after_inference: TypeCheckError # Issue #31620
+general/override_check_basic: TypeCheckError # Issue #31620
+general/override_check_generic_method_f_bounded: TextSerializationFailure # Was: Pass
+general/override_check_two_substitutions: TextSerializationFailure # Was: Pass
+general/override_check_with_covariant_modifier: TypeCheckError # Issue #31620
+general/override_inference_for_getters_and_setters: TextSerializationFailure
+general/override_inference_for_setters: TextSerializationFailure
+general/override_inference_named_parameters_ordering: TextSerializationFailure
+general/override_setter_with_field: TypeCheckError
+general/part_as_entry_point_lib: TextSerializationFailure # Was: Pass
+general/part_not_part_of: TextSerializationFailure
+general/part_not_part_of_same_named_library: TextSerializationFailure
+general/part_part_of_different_unnamed_library: TextSerializationFailure
+general/part_part_of_differently_named_library: TextSerializationFailure
+general/prefer_baseclass: TextSerializationFailure # Was: Pass
+general/private_method_tearoff: TextSerializationFailure # Was: Pass
+general/private_method_tearoff_lib: TextSerializationFailure # Was: Pass
+general/promoted_access: TextSerializationFailure
+general/promoted_null_aware_access: TextSerializationFailure
+general/public_method_tearoff: TextSerializationFailure # Was: Pass
+general/public_method_tearoff_lib: TextSerializationFailure # Was: Pass
+general/qualified: TextSerializationFailure # Was: Pass
+general/qualified_lib: TextSerializationFailure # Was: Pass
+general/qualified_part: TextSerializationFailure # Was: Pass
+general/redirecting_constructor: TextSerializationFailure # Was: Pass
+general/redirecting_factory: TextSerializationFailure # Was: Pass
+general/redirecting_factory_chain_test: TextSerializationFailure # Was: Pass
+general/redirecting_factory_const_inference: TextSerializationFailure # Was: Pass
+general/redirecting_factory_metadata: TextSerializationFailure # Was: Pass
+general/redirecting_factory_simple_test: TextSerializationFailure # Was: Pass
+general/redirecting_factory_typeargs_test: TextSerializationFailure # Was: Pass
+general/redirecting_factory_typeparam_test: TextSerializationFailure # Was: Pass
+general/redirecting_factory_typeparambounds_test: TextSerializationFailure # Was: Pass
+general/redirecting_initializer_arguments_assignable_test: TextSerializationFailure # Was: Pass
+general/redirecting_initializer_arguments_test: TextSerializationFailure # Was: Pass
+general/redirection_chain_type_arguments: TextSerializationFailure # Was: Pass
+general/redirection_chain_type_arguments_subst: TextSerializationFailure # Was: Pass
+general/redirection_type_arguments: TextSerializationFailure # Was: Pass
+general/reject_generic_function_types_in_bounds: TextSerializationFailure # Was: RuntimeError # Expected
+general/return_with_unknown_type_in_context: TextSerializationFailure # Was: Pass
+general/sdk_diagnostic: TextSerializationFailure
+general/spread_collection: TextSerializationFailure # Should be fixed as part of implementing spread collection support
+general/spread_collection_inference: TextSerializationFailure # Should be fixed as part of implementing spread collection support
+general/statements: Crash
+general/static_setter: TextSerializationFailure # Was: Pass
+general/store_load: TextSerializationFailure # Was: Pass
+general/stringliteral: TextSerializationFailure # Was: Pass
+general/super_call: TextSerializationFailure # Was: Pass
+general/super_nsm: TextSerializationFailure # Was: Pass
+general/this_field_call: TextSerializationFailure
+general/three_typedefs_loop: TextSerializationFailure
+general/top_level_accessors: TextSerializationFailure # Was: Pass
+general/top_level_accessors_part: TextSerializationFailure # Was: Pass
+general/type_literal_as_metadata: TextSerializationFailure
+general/type_of_null: TextSerializationFailure
+general/type_parameter_type_named_int: TextSerializationFailure
+general/type_parameter_usage_in_static_method_in_class: TextSerializationFailure
+general/type_parameter_usage_in_static_method_in_extension: TextSerializationFailure
+general/type_variable_as_super: TextSerializationFailure # Was: RuntimeError
+general/type_variable_bound_access: TypeCheckError
+general/type_variable_prefix: TextSerializationFailure # Was: RuntimeError
+general/type_variable_uses: TextSerializationFailure # Was: Pass
+general/typedef: TextSerializationFailure # Was: Pass
+general/undefined: TextSerializationFailure # Was: Pass
+general/undefined_getter_in_compound_assignment: TextSerializationFailure # Was: Pass
+general/uninitialized_fields: TextSerializationFailure # Was: Pass
+general/unsound_promotion: TypeCheckError
+general/unused_methods: TextSerializationFailure # Was: Pass
+general/var_as_type_name: TextSerializationFailure # Was: Pass
+general/vm_type_ops: TextSerializationFailure
+general/void_methods: TextSerializationFailure
+general/warn_unresolved_sends: TextSerializationFailure
+general/well_boundness_checks_in_outline: TextSerializationFailure
+general/with_dependencies/abstract_members_from_dill/main: TextSerializationFailure
+general/with_dependencies/extension_from_dill/extension_from_dill: TextSerializationFailure
+general/with_dependencies/variance_from_dill/variance_from_dill: TextSerializationFailure
+general_nnbd_opt_out/DeltaBlue: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/abstract_members: TypeCheckError
general_nnbd_opt_out/abstract_overrides_concrete_with_no_such_method: TextSerializationFailure
general_nnbd_opt_out/accessors: TextSerializationFailure # Was: RuntimeError
general_nnbd_opt_out/all_variances: TextSerializationFailure
general_nnbd_opt_out/ambiguous_exports: TextSerializationFailure # Was: RuntimeError # Expected, this file exports two main methods.
-general_nnbd_opt_out/annotation_eof: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/annotation_on_enum_values: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/annotation_top: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/annotation_typedef_formals_resolution: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/annotation_typedef_formals: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/annotation_typedef_formals_resolution: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/annotation_variable_declaration: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/argument_mismatch: TextSerializationFailure
general_nnbd_opt_out/argument: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/arithmetic: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/arrow_function: TextSerializationFailure # Was: Pass
@@ -99,8 +417,8 @@
general_nnbd_opt_out/async_nested: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/await_complex: TextSerializationFailure
general_nnbd_opt_out/await_in_cascade: TextSerializationFailure
+general_nnbd_opt_out/await_in_non_async: RuntimeError
general_nnbd_opt_out/await_in_non_async: TextSerializationFailure
-general_nnbd_opt_out/await: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/bad_setter_abstract: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/bad_store: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/bad_type_variable_uses_in_supertypes: TextSerializationFailure
@@ -126,14 +444,14 @@
general_nnbd_opt_out/casts: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/check_deferred_allocation: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/check_deferred_as_check: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/check_deferred_before_args: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/check_deferred_before_args2: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/check_deferred_before_args: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/check_deferred_before_call: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/check_deferred_before_write: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/check_deferred_is_check: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/check_deferred_read: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/check_deferred_read_static_field: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/check_deferred_read_type: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/check_deferred_read: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/check_deferred_static_method_call: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/check_deferred_type_declaration: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/circularity-via-initializing-formal: TextSerializationFailure # Was: Pass
@@ -148,10 +466,10 @@
general_nnbd_opt_out/constructor_cycle: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/constructor_function_types: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/constructor_initializer_invalid: TextSerializationFailure # Was: RuntimeError # Fails execution after recovery
-general_nnbd_opt_out/continue_inference_after_error_lib: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/continue_inference_after_error: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/control_flow_collection_inference: TextSerializationFailure
+general_nnbd_opt_out/continue_inference_after_error_lib: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/control_flow_collection: TextSerializationFailure
+general_nnbd_opt_out/control_flow_collection_inference: TextSerializationFailure
general_nnbd_opt_out/covariant_equals: TextSerializationFailure
general_nnbd_opt_out/covariant_generic: TextSerializationFailure # Was: RuntimeError
general_nnbd_opt_out/covariant_parameter_in_superclass_of_mixin_application: TextSerializationFailure
@@ -159,16 +477,14 @@
general_nnbd_opt_out/default_values: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/deferred_lib: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/deferred_type_annotation: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/DeltaBlue: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/duplicated_bad_prefix: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/duplicated_bad_prefix_lib1: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/duplicated_bad_prefix_lib2: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/duplicated_bad_prefix: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/duplicated_declarations: TypeCheckError
general_nnbd_opt_out/duplicated_declarations_lib: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/duplicated_declarations_part: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/duplicated_declarations: TypeCheckError
general_nnbd_opt_out/duplicated_field_initializer: TextSerializationFailure # Was: RuntimeError
general_nnbd_opt_out/duplicated_named_args_3: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/dynamic_and_void: TextSerializationFailure
general_nnbd_opt_out/error_locations/error_location_01: TextSerializationFailure
general_nnbd_opt_out/error_locations/error_location_02: TextSerializationFailure
general_nnbd_opt_out/error_locations/error_location_03: TextSerializationFailure
@@ -176,12 +492,11 @@
general_nnbd_opt_out/error_locations/error_location_05: TextSerializationFailure
general_nnbd_opt_out/error_locations/error_location_06: TextSerializationFailure
general_nnbd_opt_out/escape: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/export_main: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/export_test: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/expressions: TextSerializationFailure # Was: RuntimeError
general_nnbd_opt_out/extend_with_type_variable: TextSerializationFailure
-general_nnbd_opt_out/external_import: TextSerializationFailure # Was: RuntimeError # The native extension to import doesn't exist. This is ok.
general_nnbd_opt_out/external: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/external_import: TextSerializationFailure # Was: RuntimeError # The native extension to import doesn't exist. This is ok.
general_nnbd_opt_out/fallthrough: TextSerializationFailure
general_nnbd_opt_out/ffi_sample: TextSerializationFailure
general_nnbd_opt_out/fibonacci: TextSerializationFailure # Was: Pass
@@ -190,7 +505,6 @@
general_nnbd_opt_out/forwarding_stub_for_operator: TextSerializationFailure
general_nnbd_opt_out/function_in_field: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/function_type_assignments: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/function_type_default_value: TextSerializationFailure
general_nnbd_opt_out/function_type_is_check: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/function_type_recovery: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/functions: TextSerializationFailure # Was: Pass
@@ -198,13 +512,12 @@
general_nnbd_opt_out/generic_function_type_in_message: TextSerializationFailure
general_nnbd_opt_out/having_part_with_part_and_annotation: TextSerializationFailure
general_nnbd_opt_out/having_part_with_parts_and_annotation: TextSerializationFailure
-general_nnbd_opt_out/hello: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/if_null_in_cascade: TextSerializationFailure
general_nnbd_opt_out/if_null_in_list_literal: TextSerializationFailure
general_nnbd_opt_out/if_null_in_set_literal: TextSerializationFailure
general_nnbd_opt_out/ignore_function: TextSerializationFailure
-general_nnbd_opt_out/illegal_named_function_expression_scope: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/illegal_named_function_expression: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/illegal_named_function_expression_scope: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/implicit_const_with_static_fields: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/implicit_new: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/implicit_scope_test: TextSerializationFailure # Was: Pass
@@ -241,13 +554,12 @@
general_nnbd_opt_out/long_chain_of_typedefs: TextSerializationFailure
general_nnbd_opt_out/magic_const: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/many_errors: TextSerializationFailure
-general_nnbd_opt_out/map: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/metadata_enum: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/metadata_named_mixin_application: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/micro: TextSerializationFailure # Was: RuntimeError
-general_nnbd_opt_out/minimum_int: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/missing_constructor: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/missing_toplevel: TextSerializationFailure
+general_nnbd_opt_out/mixin: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/mixin_application_inferred_parameter_type: TextSerializationFailure
general_nnbd_opt_out/mixin_application_override: ExpectationFileMismatch
general_nnbd_opt_out/mixin_application_override: TypeCheckError
@@ -256,7 +568,6 @@
general_nnbd_opt_out/mixin_inherited_setter_for_mixed_in_field: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/mixin_super_repeated: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/mixin_with_static_member: TextSerializationFailure
-general_nnbd_opt_out/mixin: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/named_function_scope: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/named_parameters: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/native_as_name: TextSerializationFailure # Was: Pass
@@ -264,16 +575,17 @@
general_nnbd_opt_out/nested_property_set: TextSerializationFailure
general_nnbd_opt_out/nested_variable_set: TextSerializationFailure
general_nnbd_opt_out/nested_variance: TextSerializationFailure
-general_nnbd_opt_out/no_such_method_private_setter_lib: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/no_such_method_private_setter: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/no_such_method_private_setter_lib: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/non_covariant_checks: TextSerializationFailure
+general_nnbd_opt_out/null_aware: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/null_aware_for_in: TextSerializationFailure
general_nnbd_opt_out/null_aware_postfix: TextSerializationFailure
general_nnbd_opt_out/null_aware_spread: TextSerializationFailure
-general_nnbd_opt_out/null_aware: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/operator_method_not_found: TextSerializationFailure
general_nnbd_opt_out/operators: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/optional: TypeCheckError
+general_nnbd_opt_out/override: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/override_check_accessor_after_inference: TypeCheckError # Issue #31620
general_nnbd_opt_out/override_check_accessor_basic: TypeCheckError # Issue #31620
general_nnbd_opt_out/override_check_accessor_with_covariant_modifier: TypeCheckError # Issue #31620
@@ -285,24 +597,22 @@
general_nnbd_opt_out/override_inference_for_setters: TextSerializationFailure
general_nnbd_opt_out/override_inference_named_parameters_ordering: TextSerializationFailure
general_nnbd_opt_out/override_setter_with_field: TypeCheckError
-general_nnbd_opt_out/override: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/part_as_entry_point_lib: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/part_as_entry_point: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/part_not_part_of_same_named_library: TextSerializationFailure
general_nnbd_opt_out/part_not_part_of: TextSerializationFailure
+general_nnbd_opt_out/part_not_part_of_same_named_library: TextSerializationFailure
general_nnbd_opt_out/part_part_of_different_unnamed_library: TextSerializationFailure
general_nnbd_opt_out/part_part_of_differently_named_library: TextSerializationFailure
-general_nnbd_opt_out/platform: TextSerializationFailure
general_nnbd_opt_out/prefer_baseclass: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/private_method_tearoff_lib: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/private_method_tearoff: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/private_method_tearoff_lib: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/promoted_access: TextSerializationFailure
-general_nnbd_opt_out/public_method_tearoff_lib: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/public_method_tearoff: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/public_method_tearoff_lib: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/qualified: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/qualified_lib: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/qualified_part: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/qualified: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/redirecting_constructor: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/redirecting_factory: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/redirecting_factory_chain_test: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/redirecting_factory_const_inference: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/redirecting_factory_metadata: TextSerializationFailure # Was: Pass
@@ -310,28 +620,25 @@
general_nnbd_opt_out/redirecting_factory_typeargs_test: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/redirecting_factory_typeparam_test: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/redirecting_factory_typeparambounds_test: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/redirecting_factory: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/redirecting_initializer_arguments_assignable_test: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/redirecting_initializer_arguments_test: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/redirection_chain_type_arguments_subst: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/redirection_chain_type_arguments: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/redirection_chain_type_arguments_subst: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/redirection_type_arguments: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/reject_generic_function_types_in_bounds: TextSerializationFailure # Was: RuntimeError # Expected
general_nnbd_opt_out/return_with_unknown_type_in_context: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/sdk_diagnostic: TextSerializationFailure
-general_nnbd_opt_out/spread_collection_inference: TextSerializationFailure # Should be fixed as part of implementing spread collection support
general_nnbd_opt_out/spread_collection: TextSerializationFailure # Should be fixed as part of implementing spread collection support
+general_nnbd_opt_out/spread_collection_inference: TextSerializationFailure # Should be fixed as part of implementing spread collection support
general_nnbd_opt_out/statements: Crash
general_nnbd_opt_out/static_setter: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/store_load: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/stringliteral: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/super_call: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/super_nsm: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/tabs: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/three_typedefs_loop: TextSerializationFailure
-general_nnbd_opt_out/top_level_accessors_part: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/top_level_accessors: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/top_level_library_method: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/top_level_accessors_part: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/type_literal_as_metadata: TextSerializationFailure
general_nnbd_opt_out/type_of_null: TextSerializationFailure
general_nnbd_opt_out/type_parameter_type_named_int: TextSerializationFailure
@@ -340,428 +647,36 @@
general_nnbd_opt_out/type_variable_prefix: TextSerializationFailure # Was: RuntimeError
general_nnbd_opt_out/type_variable_uses: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/typedef: TextSerializationFailure # Was: Pass
-general_nnbd_opt_out/undefined_getter_in_compound_assignment: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/undefined: TextSerializationFailure # Was: Pass
+general_nnbd_opt_out/undefined_getter_in_compound_assignment: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/uninitialized_fields: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/unsound_promotion: TypeCheckError
general_nnbd_opt_out/unused_methods: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/var_as_type_name: TextSerializationFailure # Was: Pass
general_nnbd_opt_out/void_methods: TextSerializationFailure
general_nnbd_opt_out/warn_unresolved_sends: TextSerializationFailure
-general/abstract_members: TypeCheckError
-general/abstract_overrides_concrete_with_no_such_method: TextSerializationFailure
-general/accessors: TextSerializationFailure # Was: RuntimeError
-general/all_variances: TextSerializationFailure
-general/ambiguous_exports: TextSerializationFailure # Was: RuntimeError # Expected, this file exports two main methods.
-general/annotation_eof: TextSerializationFailure # Was: Pass
-general/annotation_on_enum_values: TextSerializationFailure # Was: Pass
-general/annotation_top: TextSerializationFailure # Was: Pass
-general/annotation_typedef_formals_resolution: TextSerializationFailure # Was: Pass
-general/annotation_typedef_formals: TextSerializationFailure # Was: Pass
-general/annotation_variable_declaration: TextSerializationFailure # Was: Pass
-general/argument_mismatch: TextSerializationFailure
-general/argument: TextSerializationFailure # Was: Pass
-general/arithmetic: TextSerializationFailure # Was: Pass
-general/arrow_function: TextSerializationFailure # Was: Pass
-general/assign_to_initializing_formal: TextSerializationFailure
-general/async_function: TextSerializationFailure # Was: Pass
-general/async_nested: TextSerializationFailure # Was: Pass
-general/await_complex: TextSerializationFailure
-general/await_in_cascade: TextSerializationFailure
-general/await_in_non_async: TextSerializationFailure
-general/await: TextSerializationFailure # Was: Pass
-general/bad_setter_abstract: TextSerializationFailure # Was: Pass
-general/bad_store: TextSerializationFailure # Was: Pass
-general/bad_type_variable_uses_in_supertypes: TextSerializationFailure
-general/bounds_check_depends_on_inference: TextSerializationFailure # Was: Pass
-general/bug21938: TypeCheckError
-general/bug30695: TypeCheckError
-general/bug31124: TextSerializationFailure # Was: RuntimeError # Test has no main method (and we shouldn't add one).
-general/bug32414a: TextSerializationFailure # Was: Pass
-general/bug32414b: TextSerializationFailure # Was: Pass
-general/bug32426: TextSerializationFailure # Was: Pass
-general/bug32629: TextSerializationFailure
-general/bug32866: TextSerializationFailure # Was: Pass
-general/bug33099: TextSerializationFailure # Was: Pass
-general/bug33196: TextSerializationFailure # Was: Pass
-general/bug33206: TextSerializationFailure # Was: Pass
-general/bug33298: TextSerializationFailure # Was: Pass
-general/bug34511: TextSerializationFailure # Was: Pass
-general/bug35470: TextSerializationFailure # Was: Pass
-general/bug37476: TextSerializationFailure
-general/call: TypeCheckError
-general/candidate_found: TypeCheckError
-general/cascade: TextSerializationFailure # Was: RuntimeError
-general/casts: TextSerializationFailure # Was: Pass
-general/check_deferred_allocation: TextSerializationFailure # Was: Pass
-general/check_deferred_as_check: TextSerializationFailure # Was: Pass
-general/check_deferred_before_args: TextSerializationFailure # Was: Pass
-general/check_deferred_before_args2: TextSerializationFailure # Was: Pass
-general/check_deferred_before_call: TextSerializationFailure # Was: Pass
-general/check_deferred_before_write: TextSerializationFailure # Was: Pass
-general/check_deferred_is_check: TextSerializationFailure # Was: Pass
-general/check_deferred_read_static_field: TextSerializationFailure # Was: Pass
-general/check_deferred_read_type: TextSerializationFailure # Was: Pass
-general/check_deferred_read: TextSerializationFailure # Was: Pass
-general/check_deferred_static_method_call: TextSerializationFailure # Was: Pass
-general/check_deferred_type_declaration: TextSerializationFailure # Was: Pass
-general/circularity-via-initializing-formal: TextSerializationFailure # Was: Pass
-general/classes: TextSerializationFailure # Was: Pass
-general/clone_function_type: TextSerializationFailure # Was: Pass
-general/closure: TextSerializationFailure # Was: Pass
-general/co19_language_metadata_syntax_t04: TextSerializationFailure # Was: Pass
-general/complex_class_hierarchy: TextSerializationFailure
-general/compound_binary_implicit_as: TextSerializationFailure
-general/const_redirect_to_nonconst: TextSerializationFailure
-general/constant_truncate: TextSerializationFailure
-general/constructor_const_inference: TextSerializationFailure # Was: Pass
-general/constructor_cycle: TextSerializationFailure # Was: Pass
-general/constructor_function_types: TextSerializationFailure # Was: Pass
-general/constructor_initializer_invalid: TextSerializationFailure # Was: RuntimeError # Fails execution after recovery
-general/continue_inference_after_error_lib: TextSerializationFailure # Was: Pass
-general/continue_inference_after_error: TextSerializationFailure # Was: Pass
-general/control_flow_collection_inference: TextSerializationFailure
-general/control_flow_collection: TextSerializationFailure
-general/covariant_equals: TextSerializationFailure
-general/covariant_generic: TextSerializationFailure # Was: RuntimeError
-general/covariant_parameter_in_superclass_of_mixin_application: TextSerializationFailure
-general/cycles: TextSerializationFailure # Was: Pass
-general/default_values: TextSerializationFailure # Was: Pass
-general/deferred_lib: TextSerializationFailure # Was: Pass
-general/deferred_type_annotation: TextSerializationFailure # Was: Pass
-general/DeltaBlue: TextSerializationFailure # Was: Pass
-general/demote_closure_types: TextSerializationFailure
-general/duplicated_bad_prefix_lib1: TextSerializationFailure # Was: Pass
-general/duplicated_bad_prefix_lib2: TextSerializationFailure # Was: Pass
-general/duplicated_bad_prefix: TextSerializationFailure # Was: Pass
-general/duplicated_declarations_lib: TextSerializationFailure # Was: Pass
-general/duplicated_declarations_part: TextSerializationFailure # Was: Pass
-general/duplicated_declarations: TypeCheckError
-general/duplicated_field_initializer: TextSerializationFailure # Was: RuntimeError
-general/duplicated_named_args_3: TextSerializationFailure # Was: Pass
-general/dynamic_and_void: TextSerializationFailure
-general/error_locations/error_location_01: TextSerializationFailure
-general/error_locations/error_location_02: TextSerializationFailure
-general/error_locations/error_location_03: TextSerializationFailure
-general/error_locations/error_location_04: TextSerializationFailure
-general/error_locations/error_location_05: TextSerializationFailure
-general/error_locations/error_location_06: TextSerializationFailure
-general/error_recovery/await_not_in_async: TextSerializationFailure
-general/error_recovery/constructor_recovery_bad_name_general.crash: TextSerializationFailure
-general/error_recovery/constructor_recovery_bad_name_get.crash: TextSerializationFailure
-general/error_recovery/constructor_recovery_bad_name_return_type.crash: TextSerializationFailure
-general/error_recovery/constructor_recovery_bad_name_set.crash: TextSerializationFailure
-general/error_recovery/constructor_recovery_get: TextSerializationFailure
-general/error_recovery/constructor_recovery_ok: TextSerializationFailure
-general/error_recovery/constructor_recovery_operator.crash: TextSerializationFailure
-general/error_recovery/constructor_recovery_return_type: TextSerializationFailure
-general/error_recovery/constructor_recovery_set: TextSerializationFailure
-general/error_recovery/empty_await_for: TextSerializationFailure
-general/error_recovery/empty_for: TextSerializationFailure
-general/error_recovery/issue_38415.crash: TextSerializationFailure
-general/error_recovery/issue_39024.crash: RuntimeError
-general/error_recovery/issue_39026_prime.crash: TextSerializationFailure
-general/error_recovery/issue_39026.crash: TextSerializationFailure
-general/error_recovery/issue_39033.crash: TextSerializationFailure
-general/error_recovery/issue_39058_prime.crash: RuntimeError
-general/error_recovery/issue_39058.crash: RuntimeError
-general/error_recovery/issue_39060: TextSerializationFailure
-general/error_recovery/issue_39202.crash: TextSerializationFailure
-general/error_recovery/issue_39230.crash: TextSerializationFailure
-general/error_recovery/issue_39958_01: TextSerializationFailure
-general/error_recovery/issue_39958_02: TextSerializationFailure
-general/error_recovery/issue_39958_03: TextSerializationFailure
-general/error_recovery/issue_39958_04: TextSerializationFailure
-general/error_recovery/yield_not_in_generator: TextSerializationFailure
-general/escape: TextSerializationFailure # Was: Pass
-general/export_main: TextSerializationFailure # Was: Pass
-general/export_test: TextSerializationFailure # Was: Pass
-general/expressions: TextSerializationFailure # Was: RuntimeError
-general/extend_with_type_variable: TextSerializationFailure
-general/external_import: TextSerializationFailure # Was: RuntimeError # The native extension to import doesn't exist. This is ok.
-general/external: TextSerializationFailure # Was: Pass
-general/fallthrough: TextSerializationFailure
-general/ffi_sample: TextSerializationFailure
-general/fibonacci: TextSerializationFailure # Was: Pass
-general/for_in_scope: TextSerializationFailure # Was: Pass
-general/for_in_without_declaration: TextSerializationFailure
-general/forwarding_stub_for_operator: TextSerializationFailure
-general/function_in_field: TextSerializationFailure # Was: Pass
-general/function_type_assignments: TextSerializationFailure # Was: Pass
-general/function_type_default_value: TextSerializationFailure
-general/function_type_is_check: TextSerializationFailure # Was: Pass
-general/function_type_recovery: TextSerializationFailure # Was: Pass
-general/functions: TextSerializationFailure # Was: Pass
-general/future_or_test: TextSerializationFailure # Was: Pass
-general/generic_function_type_in_message: TextSerializationFailure
-general/getter_call: TextSerializationFailure
-general/having_part_with_part_and_annotation: TextSerializationFailure
-general/having_part_with_parts_and_annotation: TextSerializationFailure
-general/hello: TextSerializationFailure # Was: Pass
-general/if_null_in_cascade: TextSerializationFailure
-general/if_null_in_list_literal: TextSerializationFailure
-general/if_null_in_set_literal: TextSerializationFailure
-general/ignore_function: TextSerializationFailure
-general/illegal_named_function_expression_scope: TextSerializationFailure # Was: Pass
-general/illegal_named_function_expression: TextSerializationFailure # Was: Pass
-general/implicit_const_with_static_fields: TextSerializationFailure # Was: Pass
-general/implicit_new: TextSerializationFailure # Was: Pass
-general/implicit_scope_test: TextSerializationFailure # Was: Pass
-general/implicit_this: TextSerializationFailure # Was: Pass
-general/import_conflicting_getters: TextSerializationFailure
-general/import_conflicting_setters: TextSerializationFailure
-general/import_conflicting_type_member: TextSerializationFailure
-general/import_conflicting_types: TextSerializationFailure
-general/incomplete_field_formal_parameter: TextSerializationFailure # Was: RuntimeError
-general/infer_field_from_multiple: TypeCheckError
-general/infer_field_type: TextSerializationFailure
-general/infer_fixed_generic_return_type: TextSerializationFailure
-general/infer_map_literal_with_closure: TextSerializationFailure
-general/inherit_function: TextSerializationFailure
-general/interface_conflict: TextSerializationFailure
-general/interface_contravariant_from_class: TextSerializationFailure
-general/interface_covariantImpl_from_class: TextSerializationFailure
-general/interface_covariantInterface_from_class: TextSerializationFailure
-general/invalid_assignment: TextSerializationFailure # Was: Pass
-general/invalid_cast: TextSerializationFailure # Was: Pass
-general/invalid_operator: TypeCheckError
-general/invalid_operator2: TextSerializationFailure
-general/invalid_type: TextSerializationFailure
-general/invocations: TextSerializationFailure # Was: RuntimeError
-general/issue129167943: TextSerializationFailure
-general/issue34515: TextSerializationFailure
-general/issue34899: TextSerializationFailure
-general/issue35875: TextSerializationFailure
-general/issue37027: TextSerializationFailure
-general/issue37381: TextSerializationFailure
-general/issue37776: TextSerializationFailure
-general/issue38812: TextSerializationFailure
-general/issue38938: TextSerializationFailure
-general/issue38943: TextSerializationFailure
-general/issue38944: TextSerializationFailure
-general/issue38961: TextSerializationFailure
-general/issue39344: TextSerializationFailure
-general/issue39421: TextSerializationFailure
-general/issue39817: TextSerializationFailure
-general/issue40242: TextSerializationFailure
-general/issue40428: TextSerializationFailure
-general/issue40662: TextSerializationFailure
-general/issue40744: TextSerializationFailure
-general/issue41070: TextSerializationFailure
-general/issue41210a: TypeCheckError
-general/issue41210b/issue41210: TypeCheckError
-general/literals: TextSerializationFailure # Was: Pass
-general/local_generic_function: TextSerializationFailure # Was: Pass
-general/long_chain_of_typedefs: TextSerializationFailure
-general/magic_const: TextSerializationFailure # Was: Pass
-general/many_errors: TextSerializationFailure
-general/map: TextSerializationFailure # Was: Pass
-general/metadata_enum: TextSerializationFailure # Was: Pass
-general/metadata_named_mixin_application: TextSerializationFailure # Was: Pass
-general/micro: TextSerializationFailure # Was: RuntimeError
-general/minimum_int: TextSerializationFailure # Was: Pass
-general/missing_constructor: TextSerializationFailure # Was: Pass
-general/missing_toplevel: TextSerializationFailure
-general/mixin_application_inferred_parameter_type: TextSerializationFailure
-general/mixin_application_override: ExpectationFileMismatch
-general/mixin_application_override: TypeCheckError
-general/mixin_conflicts: TextSerializationFailure
-general/mixin_constructors_with_default_values: TextSerializationFailure # Was: Pass
-general/mixin_covariant: TextSerializationFailure
-general/mixin_inherited_setter_for_mixed_in_field: TextSerializationFailure # Was: Pass
-general/mixin_interface_conflict: TextSerializationFailure
-general/mixin_super_repeated: TextSerializationFailure # Was: Pass
-general/mixin_with_static_member: TextSerializationFailure
-general/mixin: TextSerializationFailure # Was: Pass
-general/named_function_scope: TextSerializationFailure # Was: Pass
-general/named_parameters: TextSerializationFailure # Was: Pass
-general/native_as_name: TextSerializationFailure # Was: Pass
-general/nested_implicit_const_with_env_var: TextSerializationFailure # Was: Pass
-general/nested_property_set: TextSerializationFailure
-general/nested_variable_set: TextSerializationFailure
-general/nested_variance: TextSerializationFailure
-general/no_such_method_private_setter_lib: TextSerializationFailure # Was: Pass
-general/no_such_method_private_setter: TextSerializationFailure # Was: Pass
-general/non_covariant_checks: TextSerializationFailure
-general/null_aware_for_in: TextSerializationFailure
-general/null_aware_postfix: TextSerializationFailure
-general/null_aware_spread: TextSerializationFailure
-general/null_aware: TextSerializationFailure # Was: Pass
-general/operator_method_not_found: TextSerializationFailure
-general/operators: TextSerializationFailure # Was: Pass
-general/optional: TypeCheckError
-general/override_check_accessor_after_inference: TypeCheckError # Issue #31620
-general/override_check_accessor_basic: TypeCheckError # Issue #31620
-general/override_check_accessor_with_covariant_modifier: TypeCheckError # Issue #31620
-general/override_check_after_inference: TypeCheckError # Issue #31620
-general/override_check_basic: TypeCheckError # Issue #31620
-general/override_check_generic_method_f_bounded: TextSerializationFailure # Was: Pass
-general/override_check_two_substitutions: TextSerializationFailure # Was: Pass
-general/override_check_with_covariant_modifier: TypeCheckError # Issue #31620
-general/override_inference_for_getters_and_setters: TextSerializationFailure
-general/override_inference_for_setters: TextSerializationFailure
-general/override_inference_named_parameters_ordering: TextSerializationFailure
-general/override_setter_with_field: TypeCheckError
-general/override: TextSerializationFailure # Was: Pass
-general/part_as_entry_point_lib: TextSerializationFailure # Was: Pass
-general/part_as_entry_point: TextSerializationFailure # Was: Pass
-general/part_not_part_of_same_named_library: TextSerializationFailure
-general/part_not_part_of: TextSerializationFailure
-general/part_part_of_different_unnamed_library: TextSerializationFailure
-general/part_part_of_differently_named_library: TextSerializationFailure
-general/platform_invalid_uris/main: TextSerializationFailure
-general/platform: TextSerializationFailure
-general/prefer_baseclass: TextSerializationFailure # Was: Pass
-general/private_method_tearoff_lib: TextSerializationFailure # Was: Pass
-general/private_method_tearoff: TextSerializationFailure # Was: Pass
-general/promoted_access: TextSerializationFailure
-general/promoted_null_aware_access: TextSerializationFailure
-general/public_method_tearoff_lib: TextSerializationFailure # Was: Pass
-general/public_method_tearoff: TextSerializationFailure # Was: Pass
-general/qualified_lib: TextSerializationFailure # Was: Pass
-general/qualified_part: TextSerializationFailure # Was: Pass
-general/qualified: TextSerializationFailure # Was: Pass
-general/redirecting_constructor: TextSerializationFailure # Was: Pass
-general/redirecting_factory_chain_test: TextSerializationFailure # Was: Pass
-general/redirecting_factory_const_inference: TextSerializationFailure # Was: Pass
-general/redirecting_factory_metadata: TextSerializationFailure # Was: Pass
-general/redirecting_factory_simple_test: TextSerializationFailure # Was: Pass
-general/redirecting_factory_typeargs_test: TextSerializationFailure # Was: Pass
-general/redirecting_factory_typeparam_test: TextSerializationFailure # Was: Pass
-general/redirecting_factory_typeparambounds_test: TextSerializationFailure # Was: Pass
-general/redirecting_factory: TextSerializationFailure # Was: Pass
-general/redirecting_initializer_arguments_assignable_test: TextSerializationFailure # Was: Pass
-general/redirecting_initializer_arguments_test: TextSerializationFailure # Was: Pass
-general/redirection_chain_type_arguments_subst: TextSerializationFailure # Was: Pass
-general/redirection_chain_type_arguments: TextSerializationFailure # Was: Pass
-general/redirection_type_arguments: TextSerializationFailure # Was: Pass
-general/reject_generic_function_types_in_bounds: TextSerializationFailure # Was: RuntimeError # Expected
-general/return_with_unknown_type_in_context: TextSerializationFailure # Was: Pass
-general/sdk_diagnostic: TextSerializationFailure
-general/spread_collection_inference: TextSerializationFailure # Should be fixed as part of implementing spread collection support
-general/spread_collection: TextSerializationFailure # Should be fixed as part of implementing spread collection support
-general/statements: Crash
-general/static_setter: TextSerializationFailure # Was: Pass
-general/store_load: TextSerializationFailure # Was: Pass
-general/stringliteral: TextSerializationFailure # Was: Pass
-general/super_call: TextSerializationFailure # Was: Pass
-general/super_nsm: TextSerializationFailure # Was: Pass
-general/tabs: TextSerializationFailure # Was: Pass
-general/this_field_call: TextSerializationFailure
-general/three_typedefs_loop: TextSerializationFailure
-general/top_level_accessors_part: TextSerializationFailure # Was: Pass
-general/top_level_accessors: TextSerializationFailure # Was: Pass
-general/top_level_library_method: TextSerializationFailure # Was: Pass
-general/type_literal_as_metadata: TextSerializationFailure
-general/type_of_null: TextSerializationFailure
-general/type_parameter_type_named_int: TextSerializationFailure
-general/type_parameter_usage_in_static_method_in_class: TextSerializationFailure
-general/type_parameter_usage_in_static_method_in_extension: TextSerializationFailure
-general/type_parameters_on_dynamic: TextSerializationFailure
-general/type_parameters_on_void: TextSerializationFailure
-general/type_variable_as_super: TextSerializationFailure # Was: RuntimeError
-general/type_variable_bound_access: TypeCheckError
-general/type_variable_prefix: TextSerializationFailure # Was: RuntimeError
-general/type_variable_uses: TextSerializationFailure # Was: Pass
-general/typedef: TextSerializationFailure # Was: Pass
-general/undefined_getter_in_compound_assignment: TextSerializationFailure # Was: Pass
-general/undefined: TextSerializationFailure # Was: Pass
-general/uninitialized_fields: TextSerializationFailure # Was: Pass
-general/unsound_promotion: TypeCheckError
-general/unused_methods: TextSerializationFailure # Was: Pass
-general/var_as_type_name: TextSerializationFailure # Was: Pass
-general/vm_type_ops: TextSerializationFailure
-general/void_methods: TextSerializationFailure
-general/warn_unresolved_sends: TextSerializationFailure
-general/well_boundness_checks_in_outline: TextSerializationFailure
-general/with_dependencies/abstract_members_from_dill/main: TextSerializationFailure
-general/with_dependencies/extension_from_dill/extension_from_dill: TextSerializationFailure
-general/with_dependencies/variance_from_dill/variance_from_dill: TextSerializationFailure
implicit_getter_calls/getter_call: TextSerializationFailure
implicit_getter_calls/this_field_call: TextSerializationFailure
-inference_new/const_invocation: TextSerializationFailure # Was: Pass
-inference_new/dependency_only_if_generic_method: TextSerializationFailure # Was: Pass
-inference_new/dependency_only_if_overloaded: TextSerializationFailure # Was: Pass
-inference_new/dependency_only_if_overloaded: TypeCheckError
-inference_new/do_loop: TextSerializationFailure # Was: Pass
-inference_new/downwards_inference_inside_top_level_2: TextSerializationFailure # Was: Pass
-inference_new/downwards_inference_inside_top_level: TextSerializationFailure # Was: Pass
-inference_new/field_inference_circularity: TextSerializationFailure # Was: Pass
-inference_new/for_each_identifier_downwards: TextSerializationFailure # Was: Pass
-inference_new/for_each_invalid_iterable: TextSerializationFailure # Was: Pass
-inference_new/for_each_outer_var_type: TextSerializationFailure # Was: Pass
-inference_new/indexed_assign_combiner: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_implicit_this_upwards: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_implicit_this: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_index_full: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_index_set_vs_get: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_index_super_upwards: TypeCheckError
-inference_new/infer_assign_to_index_super: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_index_this_upwards: TypeCheckError
-inference_new/infer_assign_to_index_this: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_index_upwards: TypeCheckError
-inference_new/infer_assign_to_index: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_local_upwards: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_local: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_property_custom: TypeCheckError
-inference_new/infer_assign_to_property_full: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_property_null_aware_upwards: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_property_null_aware: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_property_super_upwards: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_property_super: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_property_upwards: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_property: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_ref: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_static_upwards: TextSerializationFailure # Was: Pass
-inference_new/infer_assign_to_static: TextSerializationFailure # Was: Pass
-inference_new/infer_field_getter_setter_mismatch: TextSerializationFailure
-inference_new/infer_field_override_accessors: TextSerializationFailure
-inference_new/infer_field_override_getter_overrides_setter: TextSerializationFailure
-inference_new/infer_field_override_setter_overrides_getter: TextSerializationFailure # Was: Pass
-inference_new/infer_instance_accessor_ref: TextSerializationFailure # Was: Pass
-inference_new/infer_instance_field_ref_circular: TextSerializationFailure # Was: Pass
-inference_new/infer_instance_field_ref: TextSerializationFailure # Was: Pass
-inference_new/infer_logical: TextSerializationFailure # Was: Pass
-inference_new/infer_use_of_void: TextSerializationFailure # Was: Pass
-inference_new/invalid_assignment_during_toplevel_inference: TypeCheckError
-inference_new/list_literals_can_infer_null_top_level: TextSerializationFailure # Was: Pass
-inference_new/map_literals_can_infer_null_top_level: TextSerializationFailure # Was: Pass
-inference_new/multiple_interface_inheritance: TextSerializationFailure # Was: Pass
-inference_new/null_aware_property_get: TextSerializationFailure
-inference_new/property_assign_combiner: TextSerializationFailure # Was: Pass
-inference_new/property_get_toplevel: TextSerializationFailure # Was: Pass
-inference_new/static_assign_combiner: TextSerializationFailure # Was: Pass
-inference_new/strongly_connected_component: TextSerializationFailure # Was: Pass
-inference_new/strongly_connected_component: TypeCheckError
-inference_new/super_index_get_substitution: TextSerializationFailure # Was: Pass
-inference_new/super_index_get: TextSerializationFailure # Was: Pass
-inference_new/switch: TextSerializationFailure # Was: Pass
-inference_new/top_level_field_depends_on_multiple_inheritance: ExpectationFileMismatch
-inference_new/top_level_field_depends_on_multiple_inheritance: TextSerializationFailure # Was: Pass
-inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2: TextSerializationFailure # Was: Pass
-inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2: TextSerializationFailure # Was: Pass
-inference_new/void_return_type_subtypes_dynamic: TextSerializationFailure # Was: Pass
-inference_new/while_loop: TextSerializationFailure # Was: Pass
inference/abstract_class_instantiation: TextSerializationFailure
-inference/assert_initializer: TextSerializationFailure # Was: Pass
inference/assert: TextSerializationFailure # Was: Pass
+inference/assert_initializer: TextSerializationFailure # Was: Pass
inference/assign_local: TextSerializationFailure # Was: Pass
inference/async_await: TextSerializationFailure # Was: Pass
inference/async_closure_return_type_flatten: TextSerializationFailure # Was: Pass
-inference/async_closure_return_type_future_or: TextSerializationFailure # Was: Pass
inference/async_closure_return_type_future: TextSerializationFailure # Was: Pass
+inference/async_closure_return_type_future_or: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_async_all_returns_are_futures: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_async_all_returns_are_values: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_async_mix_of_values_and_futures: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_async_star: TextSerializationFailure # Was: Pass
-inference/block_bodied_lambdas_basic_void: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_basic: TextSerializationFailure # Was: Pass
-inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference_top_level: TextSerializationFailure # Was: Pass
+inference/block_bodied_lambdas_basic_void: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference: TextSerializationFailure # Was: Pass
-inference/block_bodied_lambdas_infer_bottom_async_star: TextSerializationFailure # Was: Pass
+inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference_top_level: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_infer_bottom_async: TextSerializationFailure # Was: Pass
-inference/block_bodied_lambdas_infer_bottom_sync_star: TextSerializationFailure # Was: Pass
+inference/block_bodied_lambdas_infer_bottom_async_star: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_infer_bottom_sync: TextSerializationFailure # Was: Pass
+inference/block_bodied_lambdas_infer_bottom_sync_star: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_lub: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_nested_lambdas: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_no_return: TextSerializationFailure # Was: Pass
@@ -769,12 +684,11 @@
inference/block_bodied_lambdas_sync_star: TextSerializationFailure # Was: Pass
inference/block_bodied_lambdas_void_context: TextSerializationFailure # Was: Pass
inference/bottom_in_closure: TextSerializationFailure # Was: Pass
-inference/bottom: TextSerializationFailure # Was: Pass
inference/bug30251: TextSerializationFailure # Was: Pass
+inference/bug30620: TextSerializationFailure # Was: Pass
inference/bug30620_b: TextSerializationFailure # Was: Pass
inference/bug30620_c: TextSerializationFailure # Was: Pass
inference/bug30620_d: TextSerializationFailure # Was: Pass
-inference/bug30620: TextSerializationFailure # Was: Pass
inference/bug30624: TextSerializationFailure # Was: Pass
inference/bug31132: TextSerializationFailure # Was: Pass
inference/bug31133: TextSerializationFailure # Was: Pass
@@ -784,29 +698,27 @@
inference/call_corner_cases: TextSerializationFailure # Was: Pass
inference/callable_generic_class: TextSerializationFailure # Was: Pass
inference/circular_method_inference: TextSerializationFailure # Was: Pass
-inference/circular_reference_via_closures_initializer_types: TextSerializationFailure # Was: Pass
-inference/circular_reference_via_closures: TextSerializationFailure # Was: Pass
inference/closure_param_null_to_object: TextSerializationFailure # Was: Pass
inference/coerce_bottom_and_null_types: TextSerializationFailure # Was: Pass
inference/complex_predecrement: TextSerializationFailure # Was: Pass
inference/conditional_lub: TextSerializationFailure # Was: Pass
inference/conditional_upwards_inference: TextSerializationFailure # Was: Pass
inference/conflicting_fields: TextSerializationFailure
-inference/conflicts_can_happen: TextSerializationFailure
inference/conflicts_can_happen2: TextSerializationFailure
+inference/conflicts_can_happen: TextSerializationFailure
inference/constructors_downwards_with_constraint: TextSerializationFailure # Was: Pass
-inference/constructors_infer_from_arguments_argument_not_assignable: TypeCheckError
-inference/constructors_infer_from_arguments_const_with_upper_bound: TextSerializationFailure # Was: Pass
-inference/constructors_infer_from_arguments_const: TextSerializationFailure # Was: Pass
-inference/constructors_infer_from_arguments_downwards_from_constructor: TextSerializationFailure
-inference/constructors_infer_from_arguments_factory_calls_constructor: TextSerializationFailure # Was: Pass
-inference/constructors_infer_from_arguments_factory: TextSerializationFailure # Was: Pass
-inference/constructors_infer_from_arguments_named_factory: TextSerializationFailure # Was: Pass
-inference/constructors_infer_from_arguments_named: TextSerializationFailure # Was: Pass
-inference/constructors_infer_from_arguments_redirecting_factory_to_factory: TextSerializationFailure # Was: Pass
-inference/constructors_infer_from_arguments_redirecting_factory: TextSerializationFailure # Was: Pass
-inference/constructors_infer_from_arguments_redirecting: TextSerializationFailure # Was: Pass
inference/constructors_infer_from_arguments: TextSerializationFailure # Was: Pass
+inference/constructors_infer_from_arguments_argument_not_assignable: TypeCheckError
+inference/constructors_infer_from_arguments_const: TextSerializationFailure # Was: Pass
+inference/constructors_infer_from_arguments_const_with_upper_bound: TextSerializationFailure # Was: Pass
+inference/constructors_infer_from_arguments_downwards_from_constructor: TextSerializationFailure
+inference/constructors_infer_from_arguments_factory: TextSerializationFailure # Was: Pass
+inference/constructors_infer_from_arguments_factory_calls_constructor: TextSerializationFailure # Was: Pass
+inference/constructors_infer_from_arguments_named: TextSerializationFailure # Was: Pass
+inference/constructors_infer_from_arguments_named_factory: TextSerializationFailure # Was: Pass
+inference/constructors_infer_from_arguments_redirecting: TextSerializationFailure # Was: Pass
+inference/constructors_infer_from_arguments_redirecting_factory: TextSerializationFailure # Was: Pass
+inference/constructors_infer_from_arguments_redirecting_factory_to_factory: TextSerializationFailure # Was: Pass
inference/constructors_inference_f_bounded: TextSerializationFailure # Was: Pass
inference/constructors_reverse_type_parameters: TextSerializationFailure # Was: Pass
inference/constructors_too_many_positional_arguments: TextSerializationFailure
@@ -817,22 +729,22 @@
inference/downward_inference_fixes_no_upwards_errors: TextSerializationFailure # Was: Pass
inference/downward_inference_miscellaneous: TextSerializationFailure # Was: Pass
inference/downwards_context_from_inferred_field_type: TextSerializationFailure # Was: Pass
+inference/downwards_inference_annotations: TextSerializationFailure # Was: Pass
inference/downwards_inference_annotations_class_members: TextSerializationFailure # Was: Pass
inference/downwards_inference_annotations_for_loop_variable: TextSerializationFailure # Was: Pass
-inference/downwards_inference_annotations_locals_referring_to_locals: TextSerializationFailure # Was: Pass
inference/downwards_inference_annotations_locals: TextSerializationFailure # Was: Pass
-inference/downwards_inference_annotations_parameter_local: TextSerializationFailure # Was: Pass
+inference/downwards_inference_annotations_locals_referring_to_locals: TextSerializationFailure # Was: Pass
inference/downwards_inference_annotations_parameter: TextSerializationFailure # Was: Pass
-inference/downwards_inference_annotations_type_variable_local: TextSerializationFailure # Was: Pass
+inference/downwards_inference_annotations_parameter_local: TextSerializationFailure # Was: Pass
inference/downwards_inference_annotations_type_variable: TextSerializationFailure
+inference/downwards_inference_annotations_type_variable_local: TextSerializationFailure # Was: Pass
inference/downwards_inference_annotations_typedef: TextSerializationFailure # Was: Pass
-inference/downwards_inference_annotations: TextSerializationFailure # Was: Pass
inference/downwards_inference_assignment_statements: TextSerializationFailure # Was: Pass
inference/downwards_inference_async_await: TextSerializationFailure # Was: Pass
inference/downwards_inference_for_each: TextSerializationFailure # Was: Pass
inference/downwards_inference_initializing_formal_default_formal: TextSerializationFailure # Was: Pass
-inference/downwards_inference_inside_top_level_2: TextSerializationFailure # Was: Pass
inference/downwards_inference_inside_top_level: TextSerializationFailure # Was: Pass
+inference/downwards_inference_inside_top_level_2: TextSerializationFailure # Was: Pass
inference/downwards_inference_on_constructor_arguments_infer_downwards: TextSerializationFailure # Was: Pass
inference/downwards_inference_on_function_arguments_infer_downwards: TextSerializationFailure # Was: Pass
inference/downwards_inference_on_function_expressions: TextSerializationFailure # Was: Pass
@@ -858,33 +770,33 @@
inference/for_loop_initializer_expression: TextSerializationFailure # Was: Pass
inference/for_loop_promotion: TextSerializationFailure # Was: Pass
inference/future_or_subtyping: TextSerializationFailure # Was: Pass
+inference/future_then: TextSerializationFailure # Was: Pass
inference/future_then_2: TextSerializationFailure # Was: Pass
inference/future_then_3: TextSerializationFailure # Was: Pass
inference/future_then_4: TextSerializationFailure # Was: Pass
inference/future_then_5: TextSerializationFailure # Was: Pass
inference/future_then_6: TextSerializationFailure # Was: Pass
+inference/future_then_conditional: TextSerializationFailure # Was: Pass
inference/future_then_conditional_2: TextSerializationFailure # Was: Pass
inference/future_then_conditional_3: TextSerializationFailure # Was: Pass
inference/future_then_conditional_4: TextSerializationFailure # Was: Pass
inference/future_then_conditional_5: TextSerializationFailure # Was: Pass
inference/future_then_conditional_6: TextSerializationFailure # Was: Pass
-inference/future_then_conditional: TextSerializationFailure # Was: Pass
inference/future_then_downwards_method_target: TextSerializationFailure # Was: Pass
inference/future_then_explicit_future: TextSerializationFailure
inference/future_then_ifNull: TextSerializationFailure # Was: Pass
+inference/future_then_upwards: TextSerializationFailure # Was: RuntimeError
inference/future_then_upwards_2: TextSerializationFailure # Was: RuntimeError
inference/future_then_upwards_3: TextSerializationFailure # Was: Pass
inference/future_then_upwards_from_block: TextSerializationFailure # Was: Pass
-inference/future_then_upwards: TextSerializationFailure # Was: RuntimeError
-inference/future_then: TextSerializationFailure # Was: Pass
-inference/future_union_async_conditional_2: TextSerializationFailure # Was: Pass
inference/future_union_async_conditional: TextSerializationFailure # Was: Pass
+inference/future_union_async_conditional_2: TextSerializationFailure # Was: Pass
+inference/future_union_downwards: TextSerializationFailure # Was: Pass
inference/future_union_downwards_2: TextSerializationFailure # Was: Pass
inference/future_union_downwards_3: TextSerializationFailure # Was: Pass
inference/future_union_downwards_4: TextSerializationFailure # Was: Pass
inference/future_union_downwards_generic_method_with_future_return: TextSerializationFailure # Was: Pass
inference/future_union_downwards_generic_method_with_generic_return: TextSerializationFailure # Was: Pass
-inference/future_union_downwards: TextSerializationFailure # Was: Pass
inference/future_union_upwards_generic_methods: TextSerializationFailure # Was: Pass
inference/generator_closure: TextSerializationFailure # Was: Pass
inference/generic_functions_return_typedef: TextSerializationFailure
@@ -895,8 +807,8 @@
inference/generic_methods_downwards_inference_affects_arguments: TextSerializationFailure # Was: Pass
inference/generic_methods_downwards_inference_fold: TextSerializationFailure # Was: Pass
inference/generic_methods_handle_override_of_non_generic_with_generic: TypeCheckError
-inference/generic_methods_infer_generic_function_parameter_type: TextSerializationFailure # Was: Pass
inference/generic_methods_infer_generic_function_parameter_type2: TextSerializationFailure # Was: Pass
+inference/generic_methods_infer_generic_function_parameter_type: TextSerializationFailure # Was: Pass
inference/generic_methods_infer_generic_function_return_type: TextSerializationFailure # Was: Pass
inference/generic_methods_infer_generic_instantiation: TextSerializationFailure # Was: Pass
inference/generic_methods_infer_generic_method_type: TextSerializationFailure # Was: Pass
@@ -907,34 +819,34 @@
inference/generic_methods_uses_greatest_lower_bound: TextSerializationFailure # Was: Pass
inference/greatest_closure_multiple_params: TextSerializationFailure # Was: Pass
inference/inconsistent_overrides: TextSerializationFailure
-inference/index_assign_operator_return_type_2: TextSerializationFailure # Was: Pass
inference/index_assign_operator_return_type: TextSerializationFailure # Was: Pass
+inference/index_assign_operator_return_type_2: TextSerializationFailure # Was: Pass
inference/infer_accessor_from_later_inferred_field: TextSerializationFailure # Was: Pass
-inference/infer_assign_to_implicit_this_upwards: TextSerializationFailure # Was: Pass
inference/infer_assign_to_implicit_this: TextSerializationFailure # Was: Pass
+inference/infer_assign_to_implicit_this_upwards: TextSerializationFailure # Was: Pass
inference/infer_assign_to_index_full: TextSerializationFailure # Was: Pass
inference/infer_assign_to_index_super: TextSerializationFailure # Was: Pass
inference/infer_assign_to_index_this: TextSerializationFailure # Was: Pass
-inference/infer_assign_to_local_upwards: TextSerializationFailure # Was: Pass
inference/infer_assign_to_local: TextSerializationFailure # Was: Pass
+inference/infer_assign_to_local_upwards: TextSerializationFailure # Was: Pass
inference/infer_assign_to_property_full: TextSerializationFailure # Was: Pass
-inference/infer_assign_to_property_null_aware_upwards: TextSerializationFailure # Was: Pass
inference/infer_assign_to_property_null_aware: TextSerializationFailure # Was: Pass
-inference/infer_assign_to_property_super_upwards: TextSerializationFailure # Was: Pass
+inference/infer_assign_to_property_null_aware_upwards: TextSerializationFailure # Was: Pass
inference/infer_assign_to_property_super: TextSerializationFailure # Was: Pass
+inference/infer_assign_to_property_super_upwards: TextSerializationFailure # Was: Pass
inference/infer_assign_to_property_upwards: TextSerializationFailure # Was: Pass
inference/infer_assign_to_ref: TextSerializationFailure # Was: Pass
-inference/infer_assign_to_static_upwards: TextSerializationFailure # Was: Pass
inference/infer_assign_to_static: TextSerializationFailure # Was: Pass
+inference/infer_assign_to_static_upwards: TextSerializationFailure # Was: Pass
inference/infer_binary_custom: TextSerializationFailure # Was: Pass
inference/infer_binary_double_double: TextSerializationFailure # Was: Pass
inference/infer_binary_double_int: TextSerializationFailure # Was: Pass
inference/infer_binary_int_double: TextSerializationFailure # Was: Pass
inference/infer_binary_int_int: TextSerializationFailure # Was: Pass
inference/infer_conditional: TextSerializationFailure # Was: Pass
+inference/infer_consts_transitively_2: TextSerializationFailure # Was: Pass
inference/infer_consts_transitively_2_a: TextSerializationFailure # Was: Pass
inference/infer_consts_transitively_2_b: TextSerializationFailure # Was: Pass
-inference/infer_consts_transitively_2: TextSerializationFailure # Was: Pass
inference/infer_consts_transitively_b: TextSerializationFailure # Was: Pass
inference/infer_correctly_on_multiple_variables_declared_together: TextSerializationFailure # Was: Pass
inference/infer_field_from_later_inferred_field: TextSerializationFailure # Was: Pass
@@ -950,20 +862,20 @@
inference/infer_final_field_getter_only: TextSerializationFailure # Was: Pass
inference/infer_final_field_setter_only: TextSerializationFailure # Was: Pass
inference/infer_from_complex_expressions_if_outer_most_value_is_precise: TextSerializationFailure
-inference/infer_from_rhs_only_if_it_wont_conflict_with_overridden_fields: TextSerializationFailure # Was: Pass
inference/infer_from_rhs_only_if_it_wont_conflict_with_overridden_fields2: TextSerializationFailure # Was: Pass
-inference/infer_from_variables_in_cycle_libs_when_flag_is_on_a: TextSerializationFailure # Was: Pass
-inference/infer_from_variables_in_cycle_libs_when_flag_is_on: TextSerializationFailure # Was: Pass
-inference/infer_from_variables_in_cycle_libs_when_flag_is_on2_a: TextSerializationFailure # Was: Pass
+inference/infer_from_rhs_only_if_it_wont_conflict_with_overridden_fields: TextSerializationFailure # Was: Pass
inference/infer_from_variables_in_cycle_libs_when_flag_is_on2: TextSerializationFailure # Was: Pass
-inference/infer_from_variables_in_non_cycle_imports_with_flag_a: TextSerializationFailure # Was: Pass
-inference/infer_from_variables_in_non_cycle_imports_with_flag: TextSerializationFailure # Was: Pass
-inference/infer_from_variables_in_non_cycle_imports_with_flag2_a: TextSerializationFailure # Was: Pass
+inference/infer_from_variables_in_cycle_libs_when_flag_is_on2_a: TextSerializationFailure # Was: Pass
+inference/infer_from_variables_in_cycle_libs_when_flag_is_on: TextSerializationFailure # Was: Pass
+inference/infer_from_variables_in_cycle_libs_when_flag_is_on_a: TextSerializationFailure # Was: Pass
inference/infer_from_variables_in_non_cycle_imports_with_flag2: TextSerializationFailure # Was: Pass
+inference/infer_from_variables_in_non_cycle_imports_with_flag2_a: TextSerializationFailure # Was: Pass
+inference/infer_from_variables_in_non_cycle_imports_with_flag: TextSerializationFailure # Was: Pass
+inference/infer_from_variables_in_non_cycle_imports_with_flag_a: TextSerializationFailure # Was: Pass
inference/infer_generic_field_types: TextSerializationFailure
inference/infer_generic_method_type_named: TextSerializationFailure # Was: Pass
-inference/infer_generic_method_type_positional: TextSerializationFailure # Was: Pass
inference/infer_generic_method_type_positional2: TextSerializationFailure # Was: Pass
+inference/infer_generic_method_type_positional: TextSerializationFailure # Was: Pass
inference/infer_generic_method_type_required: TextSerializationFailure # Was: Pass
inference/infer_getter_cross_to_setter: TextSerializationFailure # Was: Pass
inference/infer_getter_from_later_inferred_getter: TextSerializationFailure # Was: Pass
@@ -975,8 +887,8 @@
inference/infer_method_missing_params: TypeCheckError
inference/infer_parameter_type_setter_from_field: TextSerializationFailure # Was: Pass
inference/infer_parameter_type_setter_from_setter: TextSerializationFailure # Was: Pass
-inference/infer_prefix_expression_custom: TextSerializationFailure # Was: Pass
inference/infer_prefix_expression: TextSerializationFailure # Was: Pass
+inference/infer_prefix_expression_custom: TextSerializationFailure # Was: Pass
inference/infer_rethrow: TextSerializationFailure # Was: Pass
inference/infer_return_of_statement_lambda: TextSerializationFailure # Was: Pass
inference/infer_return_type_for_static_setter: TextSerializationFailure # Was: Pass
@@ -984,78 +896,77 @@
inference/infer_setter_from_later_inferred_setter: TextSerializationFailure # Was: Pass
inference/infer_setter_function_typed: TextSerializationFailure # Was: Pass
inference/infer_setter_return_type_only: TextSerializationFailure # Was: Pass
+inference/infer_statics_transitively2: TextSerializationFailure # Was: Pass
+inference/infer_statics_transitively3: TextSerializationFailure # Was: Pass
+inference/infer_statics_transitively3_a: TextSerializationFailure # Was: Pass
+inference/infer_statics_transitively: TextSerializationFailure # Was: Pass
inference/infer_statics_transitively_2_a: TextSerializationFailure # Was: Pass
inference/infer_statics_transitively_a: TextSerializationFailure # Was: Pass
inference/infer_statics_transitively_b: TextSerializationFailure # Was: Pass
-inference/infer_statics_transitively: TextSerializationFailure # Was: Pass
-inference/infer_statics_transitively2: TextSerializationFailure # Was: Pass
-inference/infer_statics_transitively3_a: TextSerializationFailure # Was: Pass
-inference/infer_statics_transitively3: TextSerializationFailure # Was: Pass
-inference/infer_statics_with_method_invocations_a: TextSerializationFailure # Was: Pass
inference/infer_statics_with_method_invocations: TextSerializationFailure # Was: Pass
-inference/infer_throw_downwards: TextSerializationFailure # Was: Pass
+inference/infer_statics_with_method_invocations_a: TextSerializationFailure # Was: Pass
inference/infer_throw: TextSerializationFailure # Was: Pass
+inference/infer_throw_downwards: TextSerializationFailure # Was: Pass
inference/infer_type_on_overridden_fields2: TextSerializationFailure # Was: Pass
inference/infer_type_on_overridden_fields4: TextSerializationFailure # Was: Pass
+inference/infer_type_on_var2: TextSerializationFailure # Was: Pass
+inference/infer_type_on_var: TextSerializationFailure # Was: Pass
inference/infer_type_on_var_from_field: TextSerializationFailure # Was: Pass
inference/infer_type_on_var_from_top_level: TextSerializationFailure # Was: Pass
-inference/infer_type_on_var: TextSerializationFailure # Was: Pass
-inference/infer_type_on_var2: TextSerializationFailure # Was: Pass
-inference/infer_type_regardless_of_declaration_order_or_cycles_b: TextSerializationFailure # Was: Pass
inference/infer_type_regardless_of_declaration_order_or_cycles: TextSerializationFailure # Was: RuntimeError
+inference/infer_type_regardless_of_declaration_order_or_cycles_b: TextSerializationFailure # Was: Pass
inference/infer_typed_map_literal: TextSerializationFailure # Was: Pass
inference/infer_types_on_generic_instantiations_3: TextSerializationFailure # Was: Pass
inference/infer_types_on_generic_instantiations_4: TextSerializationFailure # Was: RuntimeError
inference/infer_types_on_generic_instantiations_5: TextSerializationFailure # Was: Pass
-inference/infer_types_on_generic_instantiations_in_library_cycle_a: TextSerializationFailure # Was: Pass
inference/infer_types_on_generic_instantiations_in_library_cycle: TextSerializationFailure # Was: Pass
+inference/infer_types_on_generic_instantiations_in_library_cycle_a: TextSerializationFailure # Was: Pass
inference/infer_types_on_generic_instantiations_infer: TypeCheckError
-inference/infer_types_on_loop_indices_for_each_loop_async: TextSerializationFailure # Was: Pass
inference/infer_types_on_loop_indices_for_each_loop: TextSerializationFailure # Was: Pass
+inference/infer_types_on_loop_indices_for_each_loop_async: TextSerializationFailure # Was: Pass
inference/infer_types_on_loop_indices_for_loop_with_inference: TextSerializationFailure # Was: Pass
inference/infer_use_of_void_local: TextSerializationFailure # Was: Pass
-inference/infer_variable_void: TextSerializationFailure # Was: Pass
inference/inferred_initializing_formal_checks_default_value: TextSerializationFailure # Was: Pass
inference/inferred_nonstatic_field_depends_on_static_field_complex: TextSerializationFailure # Was: Pass
inference/inferred_nonstatic_field_depends_on_top_level_var_simple: TextSerializationFailure # Was: Pass
-inference/inferred_type_block_closure_no_args_no_return_void_context: TextSerializationFailure # Was: Pass
inference/inferred_type_block_closure_no_args_no_return: TextSerializationFailure # Was: Pass
+inference/inferred_type_block_closure_no_args_no_return_void_context: TextSerializationFailure # Was: Pass
inference/inferred_type_cascade: TextSerializationFailure # Was: Pass
-inference/inferred_type_custom_binary_op_via_interface: TextSerializationFailure # Was: Pass
inference/inferred_type_custom_binary_op: TextSerializationFailure # Was: Pass
-inference/inferred_type_custom_index_op_via_interface: TextSerializationFailure # Was: Pass
+inference/inferred_type_custom_binary_op_via_interface: TextSerializationFailure # Was: Pass
inference/inferred_type_custom_index_op: TextSerializationFailure # Was: Pass
-inference/inferred_type_custom_unary_op_via_interface: TextSerializationFailure # Was: Pass
+inference/inferred_type_custom_index_op_via_interface: TextSerializationFailure # Was: Pass
inference/inferred_type_custom_unary_op: TextSerializationFailure # Was: Pass
-inference/inferred_type_extract_method_tear_off_via_interface: TextSerializationFailure # Was: Pass
+inference/inferred_type_custom_unary_op_via_interface: TextSerializationFailure # Was: Pass
inference/inferred_type_extract_method_tear_off: TextSerializationFailure # Was: Pass
+inference/inferred_type_extract_method_tear_off_via_interface: TextSerializationFailure # Was: Pass
inference/inferred_type_from_top_level_executable_tear_off: TextSerializationFailure # Was: Pass
-inference/inferred_type_invoke_method_via_interface: TextSerializationFailure # Was: Pass
inference/inferred_type_invoke_method: TextSerializationFailure # Was: Pass
-inference/inferred_type_is_enum_values: TextSerializationFailure # Was: Pass
+inference/inferred_type_invoke_method_via_interface: TextSerializationFailure # Was: Pass
inference/inferred_type_is_enum: TextSerializationFailure # Was: Pass
-inference/inferred_type_is_typedef_parameterized: TextSerializationFailure # Was: Pass
+inference/inferred_type_is_enum_values: TextSerializationFailure # Was: Pass
inference/inferred_type_is_typedef: TextSerializationFailure # Was: Pass
+inference/inferred_type_is_typedef_parameterized: TextSerializationFailure # Was: Pass
+inference/inferred_type_uses_synthetic_function_type: TextSerializationFailure # Was: Pass
inference/inferred_type_uses_synthetic_function_type_function_typed_param: TextSerializationFailure # Was: Pass
inference/inferred_type_uses_synthetic_function_type_named_param: TextSerializationFailure # Was: Pass
inference/inferred_type_uses_synthetic_function_type_positional_param: TextSerializationFailure # Was: Pass
inference/inferred_type_uses_synthetic_function_type_required_param: TextSerializationFailure # Was: Pass
-inference/inferred_type_uses_synthetic_function_type: TextSerializationFailure # Was: Pass
inference/inferred_type_via_closure_multiple_levels_of_nesting: TextSerializationFailure # Was: Pass
inference/inferred_type_via_closure_type_depends_on_args: TextSerializationFailure # Was: Pass
inference/inferred_type_via_closure_type_independent_of_args_field: TextSerializationFailure # Was: Pass
inference/inferred_type_via_closure_type_independent_of_args_top_level: TextSerializationFailure # Was: Pass
inference/inheritance_does_not_imply_circularity: TextSerializationFailure # Was: Pass
inference/instance_creation_downwards: TextSerializationFailure # Was: Pass
+inference/instantiate_tearoff: TextSerializationFailure # Was: Pass
inference/instantiate_tearoff_after_contravariance_check: TextSerializationFailure # Was: Pass
inference/instantiate_tearoff_of_call: TypeCheckError # Issue #31746
-inference/instantiate_tearoff: TextSerializationFailure # Was: Pass
-inference/instantiate_to_bounds_generic_has_bound_defined_after transform: RuntimeError
-inference/instantiate_to_bounds_generic_has_bound_defined_after: TextSerializationFailure # Was: Pass
-inference/instantiate_to_bounds_generic_has_bound_defined_before: TextSerializationFailure # Was: Pass
inference/instantiate_to_bounds_generic2_has_bound_defined_after: TextSerializationFailure # Was: Pass
inference/instantiate_to_bounds_generic2_has_bound_defined_before: TextSerializationFailure # Was: Pass
inference/instantiate_to_bounds_generic2_no_bound: TextSerializationFailure # Was: Pass
+inference/instantiate_to_bounds_generic_has_bound_defined_after transform: RuntimeError
+inference/instantiate_to_bounds_generic_has_bound_defined_after: TextSerializationFailure # Was: Pass
+inference/instantiate_to_bounds_generic_has_bound_defined_before: TextSerializationFailure # Was: Pass
inference/instantiate_to_bounds_invoke_constructor_no_bound: TextSerializationFailure # Was: Pass
inference/instantiate_to_bounds_invoke_constructor_type_args_exact: TextSerializationFailure # Was: Pass
inference/instantiate_to_bounds_not_generic: TextSerializationFailure # Was: Pass
@@ -1064,18 +975,18 @@
inference/lambda_return_type: TextSerializationFailure # Was: Pass
inference/lambda_void_context: TextSerializationFailure # Was: Pass
inference/list_literal_typed: TextSerializationFailure # Was: Pass
+inference/list_literals: TextSerializationFailure # Was: Pass
inference/list_literals_can_infer_null_bottom: TextSerializationFailure # Was: Pass
inference/list_literals_top_level: TextSerializationFailure # Was: Pass
-inference/list_literals: TextSerializationFailure # Was: Pass
inference/local_constructor_from_arguments: TextSerializationFailure # Was: Pass
inference/local_reference_upwards_local: TextSerializationFailure # Was: Pass
inference/local_return_and_yield: TextSerializationFailure # Was: Pass
inference/logical_or_promotion: TextSerializationFailure # Was: Pass
+inference/map_literals: TextSerializationFailure # Was: Pass
inference/map_literals_can_infer_null: TextSerializationFailure # Was: Pass
inference/map_literals_top_level: TextSerializationFailure # Was: Pass
-inference/map_literals: TextSerializationFailure # Was: Pass
-inference/method_call_with_type_arguments_instance_method_identifier_sequence: TextSerializationFailure # Was: Pass
inference/method_call_with_type_arguments_instance_method: TextSerializationFailure # Was: Pass
+inference/method_call_with_type_arguments_instance_method_identifier_sequence: TextSerializationFailure # Was: Pass
inference/method_call_with_type_arguments_static_method: TextSerializationFailure # Was: Pass
inference/method_call_with_type_arguments_top_level_function: TextSerializationFailure # Was: Pass
inference/mixin_inference_instantiate_to_bounds_1: TextSerializationFailure # Was: Pass
@@ -1094,8 +1005,8 @@
inference/non_inferrable_getter_setter: TextSerializationFailure # Was: Pass
inference/null_aware_method_invocation: TextSerializationFailure # Was: Pass
inference/null_aware_property_get: TextSerializationFailure # Was: Pass
-inference/null_coalescing_operator_2: TextSerializationFailure # Was: Pass
inference/null_coalescing_operator: TextSerializationFailure # Was: Pass
+inference/null_coalescing_operator_2: TextSerializationFailure # Was: Pass
inference/null_literal_should_not_infer_as_bottom: TextSerializationFailure # Was: Pass
inference/overloaded_int_operators: TextSerializationFailure # Was: Pass
inference/override_equals: TextSerializationFailure # Was: RuntimeError
@@ -1106,14 +1017,14 @@
inference/promote_bounds: TextSerializationFailure # Was: Pass
inference/promote_from_logical_rhs: TextSerializationFailure # Was: Pass
inference/promotion_subtype_check: TextSerializationFailure # Was: Pass
-inference/propagate_inference_to_field_in_class_dynamic_warnings: TextSerializationFailure # Was: Pass
inference/propagate_inference_to_field_in_class: TextSerializationFailure # Was: Pass
-inference/propagate_inference_transitively: TextSerializationFailure # Was: Pass
+inference/propagate_inference_to_field_in_class_dynamic_warnings: TextSerializationFailure # Was: Pass
inference/propagate_inference_transitively2: TextSerializationFailure # Was: Pass
+inference/propagate_inference_transitively: TextSerializationFailure # Was: Pass
inference/propagate_variable_get: TextSerializationFailure # Was: Pass
inference/property_get_toplevel: TextSerializationFailure # Was: Pass
-inference/property_set_bad_setter: TextSerializationFailure # Was: Pass
inference/property_set: TextSerializationFailure # Was: Pass
+inference/property_set_bad_setter: TextSerializationFailure # Was: Pass
inference/recursive_generic_function: TextSerializationFailure # Was: Pass
inference/reference_to_typedef: TextSerializationFailure # Was: Pass
inference/refine_binary_expression_type_type_parameter_t_double: TextSerializationFailure # Was: Pass
@@ -1127,26 +1038,26 @@
inference/static_method_tear_off: TextSerializationFailure # Was: Pass
inference/string_literal: TextSerializationFailure # Was: Pass
inference/subexpressions_of_explicitly_typed_fields: TextSerializationFailure # Was: Pass
-inference/super_index_set_substitution: TextSerializationFailure # Was: Pass
inference/super_index_set: TextSerializationFailure # Was: Pass
-inference/super_initializer_substitution: TextSerializationFailure # Was: Pass
+inference/super_index_set_substitution: TextSerializationFailure # Was: Pass
inference/super_initializer: TextSerializationFailure # Was: Pass
-inference/super_method_invocation_substitution: TextSerializationFailure # Was: Pass
+inference/super_initializer_substitution: TextSerializationFailure # Was: Pass
inference/super_method_invocation: TextSerializationFailure # Was: Pass
+inference/super_method_invocation_substitution: TextSerializationFailure # Was: Pass
+inference/super_property_get: TextSerializationFailure # Was: Pass
inference/super_property_get_invoke_function_typed: TextSerializationFailure # Was: Pass
inference/super_property_get_invoke_implicit_call: TextSerializationFailure # Was: Pass
inference/super_property_get_substitution: TextSerializationFailure # Was: Pass
inference/super_property_get_tearoff: TextSerializationFailure # Was: Pass
-inference/super_property_get: TextSerializationFailure # Was: Pass
inference/super_property_set_substitution: TextSerializationFailure # Was: Pass
inference/switch_continue: TextSerializationFailure # Was: Pass
inference/symbol_literal: TextSerializationFailure # Was: Pass
inference/this_reference: TextSerializationFailure # Was: Pass
inference/top_level_return_and_yield: TextSerializationFailure # Was: Pass
inference/toplevel_inference_toplevel_var: TextSerializationFailure # Was: Pass
+inference/try_catch: TextSerializationFailure # Was: Pass
inference/try_catch_finally: TextSerializationFailure # Was: Pass
inference/try_catch_promotion: TextSerializationFailure # Was: Pass
-inference/try_catch: TextSerializationFailure # Was: Pass
inference/try_finally: TextSerializationFailure # Was: Pass
inference/type_cast: TextSerializationFailure # Was: Pass
inference/type_promotion_ignores_local_functions: TextSerializationFailure # Was: Pass
@@ -1161,16 +1072,16 @@
inference/unsafe_block_closure_inference_constructor_call_explicit_type_param: TextSerializationFailure # Was: Pass
inference/unsafe_block_closure_inference_constructor_call_implicit_type_param: TextSerializationFailure # Was: Pass
inference/unsafe_block_closure_inference_constructor_call_no_type_param: TextSerializationFailure # Was: Pass
+inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param: TextSerializationFailure # Was: Pass
inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1: TextSerializationFailure
inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2: TextSerializationFailure
-inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param: TextSerializationFailure # Was: Pass
+inference/unsafe_block_closure_inference_function_call_explicit_type_param: TextSerializationFailure # Was: Pass
inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1: TextSerializationFailure
inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2: TextSerializationFailure
-inference/unsafe_block_closure_inference_function_call_explicit_type_param: TextSerializationFailure # Was: Pass
-inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr: TextSerializationFailure # Was: Pass
inference/unsafe_block_closure_inference_function_call_implicit_type_param: TextSerializationFailure # Was: Pass
-inference/unsafe_block_closure_inference_function_call_no_type_param_via_expr: TextSerializationFailure # Was: Pass
+inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr: TextSerializationFailure # Was: Pass
inference/unsafe_block_closure_inference_function_call_no_type_param: TextSerializationFailure # Was: Pass
+inference/unsafe_block_closure_inference_function_call_no_type_param_via_expr: TextSerializationFailure # Was: Pass
inference/unsafe_block_closure_inference_in_list_dynamic: TextSerializationFailure # Was: Pass
inference/unsafe_block_closure_inference_in_list_typed: TextSerializationFailure # Was: Pass
inference/unsafe_block_closure_inference_in_list_untyped: TextSerializationFailure # Was: Pass
@@ -1182,54 +1093,117 @@
inference/unsafe_block_closure_inference_method_call_implicit_type_param: TextSerializationFailure # Was: Pass
inference/unsafe_block_closure_inference_method_call_no_type_param: TextSerializationFailure # Was: Pass
inference/void_return_type_subtypes_dynamic: TextSerializationFailure # Was: Pass
+inference_new/const_invocation: TextSerializationFailure # Was: Pass
+inference_new/dependency_only_if_generic_method: TextSerializationFailure # Was: Pass
+inference_new/dependency_only_if_overloaded: TextSerializationFailure # Was: Pass
+inference_new/dependency_only_if_overloaded: TypeCheckError
+inference_new/do_loop: TextSerializationFailure # Was: Pass
+inference_new/downwards_inference_inside_top_level: TextSerializationFailure # Was: Pass
+inference_new/downwards_inference_inside_top_level_2: TextSerializationFailure # Was: Pass
+inference_new/field_inference_circularity: TextSerializationFailure # Was: Pass
+inference_new/for_each_identifier_downwards: TextSerializationFailure # Was: Pass
+inference_new/for_each_invalid_iterable: TextSerializationFailure # Was: Pass
+inference_new/for_each_outer_var_type: TextSerializationFailure # Was: Pass
+inference_new/indexed_assign_combiner: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_implicit_this: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_implicit_this_upwards: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_index: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_index_full: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_index_set_vs_get: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_index_super: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_index_super_upwards: TypeCheckError
+inference_new/infer_assign_to_index_this: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_index_this_upwards: TypeCheckError
+inference_new/infer_assign_to_index_upwards: TypeCheckError
+inference_new/infer_assign_to_local: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_local_upwards: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_property: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_property_custom: TypeCheckError
+inference_new/infer_assign_to_property_full: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_property_null_aware: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_property_null_aware_upwards: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_property_super: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_property_super_upwards: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_property_upwards: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_ref: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_static: TextSerializationFailure # Was: Pass
+inference_new/infer_assign_to_static_upwards: TextSerializationFailure # Was: Pass
+inference_new/infer_field_getter_setter_mismatch: TextSerializationFailure
+inference_new/infer_field_override_accessors: TextSerializationFailure
+inference_new/infer_field_override_getter_overrides_setter: TextSerializationFailure
+inference_new/infer_field_override_setter_overrides_getter: TextSerializationFailure # Was: Pass
+inference_new/infer_instance_accessor_ref: TextSerializationFailure # Was: Pass
+inference_new/infer_instance_field_ref: TextSerializationFailure # Was: Pass
+inference_new/infer_instance_field_ref_circular: TextSerializationFailure # Was: Pass
+inference_new/infer_logical: TextSerializationFailure # Was: Pass
+inference_new/infer_use_of_void: TextSerializationFailure # Was: Pass
+inference_new/invalid_assignment_during_toplevel_inference: TypeCheckError
+inference_new/list_literals_can_infer_null_top_level: TextSerializationFailure # Was: Pass
+inference_new/map_literals_can_infer_null_top_level: TextSerializationFailure # Was: Pass
+inference_new/multiple_interface_inheritance: TextSerializationFailure # Was: Pass
+inference_new/null_aware_property_get: TextSerializationFailure
+inference_new/property_assign_combiner: TextSerializationFailure # Was: Pass
+inference_new/property_get_toplevel: TextSerializationFailure # Was: Pass
+inference_new/static_assign_combiner: TextSerializationFailure # Was: Pass
+inference_new/strongly_connected_component: TextSerializationFailure # Was: Pass
+inference_new/strongly_connected_component: TypeCheckError
+inference_new/super_index_get: TextSerializationFailure # Was: Pass
+inference_new/super_index_get_substitution: TextSerializationFailure # Was: Pass
+inference_new/switch: TextSerializationFailure # Was: Pass
+inference_new/top_level_field_depends_on_multiple_inheritance: ExpectationFileMismatch
+inference_new/top_level_field_depends_on_multiple_inheritance: TextSerializationFailure # Was: Pass
+inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2: TextSerializationFailure # Was: Pass
+inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2: TextSerializationFailure # Was: Pass
+inference_new/void_return_type_subtypes_dynamic: TextSerializationFailure # Was: Pass
+inference_new/while_loop: TextSerializationFailure # Was: Pass
instantiate_to_bound/all_steps: TextSerializationFailure # Was: Pass
instantiate_to_bound/body_generic_classes_from_dill: TextSerializationFailure # Was: Pass
-instantiate_to_bound/body_literal_list_with_generic_argument: TextSerializationFailure # Was: Pass
instantiate_to_bound/body_literal_list: TextSerializationFailure # Was: Pass
+instantiate_to_bound/body_literal_list_with_generic_argument: TextSerializationFailure # Was: Pass
instantiate_to_bound/body_literal_map: TextSerializationFailure # Was: Pass
instantiate_to_bound/body_omitted_bound: TextSerializationFailure # Was: Pass
instantiate_to_bound/body_super_bounded_type: TextSerializationFailure # Was: Pass
-instantiate_to_bound/body_typedef_literal_list_with_generic_argument: TextSerializationFailure # Was: Pass
instantiate_to_bound/body_typedef_literal_list: TextSerializationFailure # Was: Pass
+instantiate_to_bound/body_typedef_literal_list_with_generic_argument: TextSerializationFailure # Was: Pass
instantiate_to_bound/body_typedef_literal_map: TextSerializationFailure # Was: Pass
instantiate_to_bound/body_typedef_omitted_bound: TextSerializationFailure # Was: Pass
instantiate_to_bound/body_typedef_super_bounded_type: TextSerializationFailure # Was: Pass
-instantiate_to_bound/contravariant_dependence_in_literals: TextSerializationFailure # Was: Pass
instantiate_to_bound/contravariant_dependence: TextSerializationFailure # Was: Pass
-instantiate_to_bound/contravariant_mutual_dependence_in_literals: TextSerializationFailure # Was: Pass
+instantiate_to_bound/contravariant_dependence_in_literals: TextSerializationFailure # Was: Pass
instantiate_to_bound/contravariant_mutual_dependence: TextSerializationFailure # Was: Pass
-instantiate_to_bound/covariant_dependence_in_literals: TextSerializationFailure # Was: Pass
+instantiate_to_bound/contravariant_mutual_dependence_in_literals: TextSerializationFailure # Was: Pass
instantiate_to_bound/covariant_dependence: TextSerializationFailure # Was: Pass
-instantiate_to_bound/covariant_mutual_dependence_in_literals: TextSerializationFailure # Was: Pass
+instantiate_to_bound/covariant_dependence_in_literals: TextSerializationFailure # Was: Pass
instantiate_to_bound/covariant_mutual_dependence: TextSerializationFailure # Was: Pass
-instantiate_to_bound/dependence_in_literals: TextSerializationFailure # Was: Pass
+instantiate_to_bound/covariant_mutual_dependence_in_literals: TextSerializationFailure # Was: Pass
instantiate_to_bound/dependence: TextSerializationFailure # Was: Pass
+instantiate_to_bound/dependence_in_literals: TextSerializationFailure # Was: Pass
instantiate_to_bound/generic_classes_from_dill: TextSerializationFailure # Was: Pass
instantiate_to_bound/inference_constrained_by_bound: TextSerializationFailure # Was: Pass
instantiate_to_bound/inference_defaults_to_bound: TextSerializationFailure # Was: Pass
instantiate_to_bound/inference_gives_input: TextSerializationFailure # Was: Pass
instantiate_to_bound/inference_super_bounded_rejected: TextSerializationFailure # Was: Pass
instantiate_to_bound/instantiated_in_outline: TextSerializationFailure # Was: Pass
-instantiate_to_bound/literal_list_with_generic_argument: TextSerializationFailure # Was: Pass
instantiate_to_bound/literal_list: TextSerializationFailure # Was: Pass
+instantiate_to_bound/literal_list_with_generic_argument: TextSerializationFailure # Was: Pass
instantiate_to_bound/literal_map: TextSerializationFailure # Was: Pass
instantiate_to_bound/multiple_strongly_connected: TextSerializationFailure # Was: Pass
-instantiate_to_bound/mutual_dependence_in_literals: TextSerializationFailure # Was: Pass
instantiate_to_bound/mutual_dependence: TextSerializationFailure # Was: Pass
+instantiate_to_bound/mutual_dependence_in_literals: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_bound_due_to_non_simple: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_bound_due_to_variables: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_class_parametrized_typedef_cycle: TextSerializationFailure # Was: RuntimeError # Expected
instantiate_to_bound/non_simple_class_typedef_cycle: TextSerializationFailure # Was: Pass
+instantiate_to_bound/non_simple_co_inductive: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_co_inductive_for_each: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_co_inductive_no_dup: TextSerializationFailure # Was: Pass
-instantiate_to_bound/non_simple_co_inductive: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_folded_regress: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_for_each: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_from_compiled: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_generic_function_in_bound_regress: TextSerializationFailure # Was: RuntimeError # Expected
-instantiate_to_bound/non_simple_many_libs_same_name_cycle_lib: TextSerializationFailure # Was: Pass
-instantiate_to_bound/non_simple_many_libs_same_name_cycle: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_many: TextSerializationFailure # Was: Pass
+instantiate_to_bound/non_simple_many_libs_same_name_cycle: TextSerializationFailure # Was: Pass
+instantiate_to_bound/non_simple_many_libs_same_name_cycle_lib: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_no_dup: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_suppress_consequence: TextSerializationFailure # Was: Pass
instantiate_to_bound/non_simple_variables_from_same: TextSerializationFailure # Was: Pass
@@ -1239,8 +1213,8 @@
instantiate_to_bound/super_bounded_type: TextSerializationFailure # Was: Pass
instantiate_to_bound/supertypes: TextSerializationFailure # Was: Pass
instantiate_to_bound/typedef_instantiated_in_outline: TextSerializationFailure # Was: Pass
-instantiate_to_bound/typedef_literal_list_with_generic_argument: TextSerializationFailure # Was: Pass
instantiate_to_bound/typedef_literal_list: TextSerializationFailure # Was: Pass
+instantiate_to_bound/typedef_literal_list_with_generic_argument: TextSerializationFailure # Was: Pass
instantiate_to_bound/typedef_literal_map: TextSerializationFailure # Was: Pass
instantiate_to_bound/typedef_omitted_bound: TextSerializationFailure # Was: Pass
instantiate_to_bound/typedef_raw_in_bound: TextSerializationFailure # Was: Pass
@@ -1251,7 +1225,6 @@
late_lowering/infer_from_late_variable: TextSerializationFailure
late_lowering/infer_late_field_type: TextSerializationFailure
late_lowering/initializer_rewrite: TextSerializationFailure
-late_lowering/injected_late_field_checks/main: TextSerializationFailure
late_lowering/instance_field_with_initializer: TextSerializationFailure
late_lowering/instance_field_without_initializer: TextSerializationFailure
late_lowering/instance_final_field_without_initializer: TextSerializationFailure
@@ -1285,8 +1258,8 @@
late_lowering/late_nullable_local_with_initializer: TextSerializationFailure
late_lowering/late_nullable_local_without_initializer: TextSerializationFailure
late_lowering/later: TextSerializationFailure
-late_lowering/override_getter_setter: TextSerializationFailure
late_lowering/override: TextSerializationFailure
+late_lowering/override_getter_setter: TextSerializationFailure
late_lowering/return_late: TextSerializationFailure
late_lowering/uninitialized_non_nullable_late_fields: TextSerializationFailure
new_const_insertion/simple: TextSerializationFailure # Was: Pass
@@ -1301,8 +1274,8 @@
nnbd/covariant_nnbd_top_merge: TextSerializationFailure
nnbd/definite_assignment_and_completion: TextSerializationFailure
nnbd/definitely_assigned: TextSerializationFailure
-nnbd/definitely_unassigned_late_local_variables: TextSerializationFailure
nnbd/definitely_unassigned: TextSerializationFailure
+nnbd/definitely_unassigned_late_local_variables: TextSerializationFailure
nnbd/demote_closure_types: TextSerializationFailure
nnbd/export_from_opt_out: TextSerializationFailure
nnbd/forbidden_supers: TextSerializationFailure
@@ -1320,10 +1293,7 @@
nnbd/infer_method_types: TextSerializationFailure
nnbd/inheritance_from_opt_in: TypeCheckError
nnbd/inheritance_from_opt_out: TextSerializationFailure
-nnbd/injected_late_field_checks/main: TextSerializationFailure
nnbd/intersection_types: TextSerializationFailure
-nnbd/issue_39286_2: TextSerializationFailure
-nnbd/issue_39286: TextSerializationFailure
nnbd/issue39659: TextSerializationFailure
nnbd/issue39822: TextSerializationFailure
nnbd/issue40093: TextSerializationFailure
@@ -1340,6 +1310,14 @@
nnbd/issue41210a/issue41210: TextSerializationFailure
nnbd/issue41210b: TextSerializationFailure
nnbd/issue41273: TextSerializationFailure
+nnbd/issue41496: TextSerializationFailure
+nnbd/issue41496b: TextSerializationFailure
+nnbd/issue41498: TextSerializationFailure
+nnbd/issue41498b: TextSerializationFailure
+nnbd/issue41499: TextSerializationFailure
+nnbd/issue41499b: TextSerializationFailure
+nnbd/issue_39286: TextSerializationFailure
+nnbd/issue_39286_2: TextSerializationFailure
nnbd/late: TextSerializationFailure
nnbd/later: TextSerializationFailure
nnbd/lhs_of_if_null: TextSerializationFailure
@@ -1358,24 +1336,24 @@
nnbd/never_bound: TextSerializationFailure
nnbd/never_opt_out: TypeCheckError
nnbd/never_receiver: TextSerializationFailure
-nnbd/nnbd_opt_out_language_version_try_to_trick: TextSerializationFailure
nnbd/nnbd_opt_out_language_version: TextSerializationFailure
+nnbd/nnbd_opt_out_language_version_try_to_trick: TextSerializationFailure
+nnbd/no_null_shorting: TextSerializationFailure
nnbd/no_null_shorting_explicit_extension: TextSerializationFailure
nnbd/no_null_shorting_extension: TextSerializationFailure
-nnbd/no_null_shorting: TextSerializationFailure
nnbd/non_nullable_field_initialization: TextSerializationFailure
nnbd/non_nullable_optional: TextSerializationFailure
nnbd/not_definitely_unassigned_late_local_variables: TextSerializationFailure
nnbd/nsm_from_opt_in: TextSerializationFailure
nnbd/null_access: TextSerializationFailure
nnbd/null_aware_chain: TextSerializationFailure
-nnbd/null_check_context: TextSerializationFailure
nnbd/null_check: TextSerializationFailure
+nnbd/null_check_context: TextSerializationFailure
+nnbd/null_shorting: TextSerializationFailure
nnbd/null_shorting_cascade: TextSerializationFailure
nnbd/null_shorting_explicit_extension: TextSerializationFailure
nnbd/null_shorting_extension: TextSerializationFailure
nnbd/null_shorting_index: TextSerializationFailure
-nnbd/null_shorting: TextSerializationFailure
nnbd/nullable_access: TextSerializationFailure
nnbd/nullable_null: TextSerializationFailure
nnbd/nullable_object_access: TextSerializationFailure
@@ -1391,9 +1369,9 @@
nnbd/potentially_constant_type_is: TextSerializationFailure
nnbd/potentially_non_nullable_field: TextSerializationFailure
nnbd/regress_null_aware: TextSerializationFailure
+nnbd/required: TextSerializationFailure
nnbd/required_name_override: TextSerializationFailure
nnbd/required_named_parameter: TextSerializationFailure
-nnbd/required: TextSerializationFailure
nnbd/return_late: TextSerializationFailure
nnbd/return_null: TextSerializationFailure
nnbd/shorting_stop: TextSerializationFailure
@@ -1406,10 +1384,10 @@
nnbd/tearoff_from_nullable_receiver: TextSerializationFailure
nnbd/type_parameter_types: TextSerializationFailure
nnbd/uninitialized_non_nullable_late_fields: TextSerializationFailure
+no_such_method_forwarders/abstract_accessors_from_field: TextSerializationFailure # Was: Pass
no_such_method_forwarders/abstract_accessors_from_field_arent_mixed_in: TextSerializationFailure # Was: Pass
no_such_method_forwarders/abstract_accessors_from_field_one_defined: TextSerializationFailure # Was: Pass
no_such_method_forwarders/abstract_accessors_from_field_with_substitution: TextSerializationFailure # Was: Pass
-no_such_method_forwarders/abstract_accessors_from_field: TextSerializationFailure # Was: Pass
no_such_method_forwarders/abstract_interface_nsm_inherited: TextSerializationFailure # Was: Pass
no_such_method_forwarders/abstract_override_abstract_different_type: TextSerializationFailure
no_such_method_forwarders/abstract_override_with_different_signature: TextSerializationFailure
@@ -1421,26 +1399,27 @@
no_such_method_forwarders/interface_with_concrete: TextSerializationFailure # Was: Pass
no_such_method_forwarders/interface_with_nsm: TextSerializationFailure # Was: Pass
no_such_method_forwarders/multiple_abstract_setters: TextSerializationFailure
-no_such_method_forwarders/no_forwarders_for_abstract_classes_chain: TextSerializationFailure # Was: Pass
no_such_method_forwarders/no_forwarders_for_abstract_classes: TextSerializationFailure # Was: Pass
+no_such_method_forwarders/no_forwarders_for_abstract_classes_chain: TextSerializationFailure # Was: Pass
no_such_method_forwarders/nsm_inherited: TextSerializationFailure # Was: Pass
no_such_method_forwarders/nsm_mixed_in: TextSerializationFailure # Was: Pass
+no_such_method_forwarders/private: TextSerializationFailure # Was: Pass
no_such_method_forwarders/private_module: TextSerializationFailure # Was: Pass
no_such_method_forwarders/private_same: TextSerializationFailure # Was: Pass
-no_such_method_forwarders/private: TextSerializationFailure # Was: Pass
no_such_method_forwarders/same: TextSerializationFailure # Was: Pass
no_such_method_forwarders/setter_not_shadowed_by_method: TextSerializationFailure # Was: Pass
no_such_method_forwarders/subst_on_forwarder: TextSerializationFailure # Was: Pass
+nonfunction_type_aliases/issue41501: TextSerializationFailure
rasta/abstract_constructor: TextSerializationFailure # Was: RuntimeError
rasta/bad_constructor_redirection: TextSerializationFailure # Was: RuntimeError
rasta/bad_continue: TextSerializationFailure # Was: RuntimeError
rasta/bad_default_constructor: TextSerializationFailure
rasta/bad_explicit_super_constructor: TextSerializationFailure # Was: RuntimeError
rasta/bad_implicit_super_constructor: TextSerializationFailure # Was: RuntimeError
+rasta/bad_interpolation: RuntimeError
rasta/bad_interpolation: TextSerializationFailure # Was: RuntimeError
rasta/bad_redirection: TextSerializationFailure # Was: RuntimeError
rasta/bad_setter_initializer: TextSerializationFailure # Was: RuntimeError
-rasta/bad_unicode: TextSerializationFailure # Was: Pass
rasta/breaking_bad: TextSerializationFailure # Was: RuntimeError
rasta/cascades: TextSerializationFailure # Was: Pass
rasta/class_hierarchy: TextSerializationFailure # Was: RuntimeError
@@ -1450,13 +1429,13 @@
rasta/deferred_load: TextSerializationFailure # Was: Pass
rasta/duplicated_mixin: TextSerializationFailure # Was: RuntimeError # Expected, this file has no main method.
rasta/enum: TextSerializationFailure # Was: Pass
+rasta/export: RuntimeError
rasta/export: TextSerializationFailure # Was: RuntimeError # Expected, this file has no main method.
rasta/external_factory_redirection: TextSerializationFailure # Was: Pass
+rasta/foo: RuntimeError
rasta/foo: TextSerializationFailure # Was: RuntimeError # Expected, this file has no main method.
rasta/for_loop: TextSerializationFailure # Was: Pass
rasta/generic_factory: TextSerializationFailure # Was: RuntimeError
-rasta/hello: TextSerializationFailure # Was: Pass
-rasta/import_export: TextSerializationFailure # Was: Pass
rasta/issue_000001: TextSerializationFailure # Was: RuntimeError
rasta/issue_000002: TextSerializationFailure # Was: Pass
rasta/issue_000004: TextSerializationFailure # Was: Pass
@@ -1469,19 +1448,17 @@
rasta/issue_000026: TextSerializationFailure # Was: Pass
rasta/issue_000031: TextSerializationFailure # Was: RuntimeError
rasta/issue_000032: TextSerializationFailure # Was: RuntimeError
-rasta/issue_000033: TextSerializationFailure
rasta/issue_000034: TextSerializationFailure # Was: RuntimeError
rasta/issue_000035: TextSerializationFailure # Was: Pass
rasta/issue_000035a: TextSerializationFailure # Was: Pass
+rasta/issue_000036: RuntimeError
rasta/issue_000036: TextSerializationFailure # Was: RuntimeError
rasta/issue_000039: TextSerializationFailure
rasta/issue_000041: TextSerializationFailure # Was: RuntimeError
rasta/issue_000042: TextSerializationFailure # Was: RuntimeError
rasta/issue_000043: TextSerializationFailure # Was: RuntimeError
rasta/issue_000044: TextSerializationFailure # Was: RuntimeError
-rasta/issue_000045: TextSerializationFailure
rasta/issue_000046: TextSerializationFailure # Was: RuntimeError
-rasta/issue_000047: TextSerializationFailure
rasta/issue_000048: TextSerializationFailure # Was: Pass
rasta/issue_000052: TextSerializationFailure # Was: Pass
rasta/issue_000053: TextSerializationFailure # Was: Pass
@@ -1492,18 +1469,19 @@
rasta/issue_000080: TextSerializationFailure # Was: Pass
rasta/issue_000081: TextSerializationFailure # Was: RuntimeError
rasta/malformed_const_constructor: TextSerializationFailure # Was: RuntimeError
-rasta/malformed_function_type: TextSerializationFailure # Was: Pass
+rasta/malformed_function: RuntimeError
rasta/malformed_function: TextSerializationFailure # Was: RuntimeError
+rasta/malformed_function_type: TextSerializationFailure # Was: Pass
rasta/mandatory_parameter_initializer: TextSerializationFailure
rasta/mixin_library: TypeCheckError
rasta/native_is_illegal: TextSerializationFailure # Was: RuntimeError
rasta/parser_error: TextSerializationFailure # Was: RuntimeError
rasta/previsit_deferred: TextSerializationFailure # Was: Pass
rasta/static: TextSerializationFailure # Was: RuntimeError
+rasta/super: TypeCheckError
rasta/super_initializer: TextSerializationFailure # Was: RuntimeError
rasta/super_mixin: TypeCheckError
rasta/super_operator: TypeCheckError
-rasta/super: TypeCheckError
rasta/supports_reflection: TextSerializationFailure # Was: Pass
rasta/switch_execution_case_t02: TextSerializationFailure # Was: Pass
rasta/switch_fall_through: TextSerializationFailure # Was: Pass
@@ -1511,22 +1489,21 @@
rasta/try_label: TextSerializationFailure
rasta/type_literals: TextSerializationFailure
rasta/type_with_parse_error: TextSerializationFailure # Was: Pass
+rasta/typedef: RuntimeError
rasta/typedef: TextSerializationFailure
+rasta/unresolved: RuntimeError
+rasta/unresolved: TextSerializationFailure # Was: RuntimeError
rasta/unresolved_constructor: TextSerializationFailure # Was: RuntimeError
rasta/unresolved_for_in: TextSerializationFailure # Was: RuntimeError
rasta/unresolved_recovery: TypeCheckError
-rasta/unresolved: TextSerializationFailure # Was: RuntimeError
-rasta/unsupported_platform_library: TextSerializationFailure
regress/issue_29937: TextSerializationFailure # Was: Pass
regress/issue_29940: TextSerializationFailure # Was: Pass
regress/issue_29941: TextSerializationFailure # Was: Pass
regress/issue_29942: TextSerializationFailure # Was: Pass
-regress/issue_29943: TextSerializationFailure
regress/issue_29944: TextSerializationFailure # Was: Pass
regress/issue_29945: TextSerializationFailure
-regress/issue_29975: TextSerializationFailure
+regress/issue_29976: RuntimeError
regress/issue_29976: TextSerializationFailure # Was: RuntimeError # Tests runtime behavior of error recovery.
-regress/issue_29977: TextSerializationFailure
regress/issue_29978: TextSerializationFailure # Was: Pass
regress/issue_29979: TextSerializationFailure # Was: Pass
regress/issue_29980: TextSerializationFailure
@@ -1534,25 +1511,17 @@
regress/issue_29982: TextSerializationFailure # Was: RuntimeError # Tests runtime behavior of error recovery.
regress/issue_29983: TextSerializationFailure # Was: Pass
regress/issue_29984: TextSerializationFailure # Was: Pass
-regress/issue_29985: TextSerializationFailure
regress/issue_29986: TextSerializationFailure
-regress/issue_29987: TextSerializationFailure
regress/issue_30834: TextSerializationFailure # Was: Pass
regress/issue_30836: TextSerializationFailure # Was: RuntimeError # Issue 30836.
regress/issue_30838: TextSerializationFailure # Was: Pass
regress/issue_30981: TextSerializationFailure # Was: Pass
-regress/issue_30994: TextSerializationFailure
regress/issue_31155: TextSerializationFailure # Was: Pass
-regress/issue_31157: TextSerializationFailure
regress/issue_31171: TextSerializationFailure # Was: Pass
-regress/issue_31180: TextSerializationFailure
regress/issue_31181: TextSerializationFailure # Was: Pass
regress/issue_31183: TextSerializationFailure # Was: Pass
regress/issue_31184: TextSerializationFailure # Was: Pass
regress/issue_31185: TextSerializationFailure # Was: Pass
-regress/issue_31186: TextSerializationFailure
-regress/issue_31187: TextSerializationFailure
-regress/issue_31188: TextSerializationFailure
regress/issue_31190: TextSerializationFailure # Was: Pass
regress/issue_31192: TextSerializationFailure # Was: Pass
regress/issue_31198: TextSerializationFailure # Was: Pass
@@ -1569,12 +1538,12 @@
regress/issue_33452: TextSerializationFailure # Was: RuntimeError # Test has an intentional error
regress/issue_33672: TextSerializationFailure # Was: Pass
regress/issue_34225: TextSerializationFailure # Was: RuntimeError
-regress/issue_34291_lib: TextSerializationFailure # Was: Pass
regress/issue_34291: TextSerializationFailure # Was: Pass
-regress/issue_34403_lib: TextSerializationFailure # Was: Pass
+regress/issue_34291_lib: TextSerializationFailure # Was: Pass
regress/issue_34403: TextSerializationFailure # Was: Pass
-regress/issue_34498_lib: TextSerializationFailure # Was: Pass
+regress/issue_34403_lib: TextSerializationFailure # Was: Pass
regress/issue_34498: TextSerializationFailure # Was: Pass
+regress/issue_34498_lib: TextSerializationFailure # Was: Pass
regress/issue_34563: TextSerializationFailure # Was: RuntimeError # Test execution after recovery
regress/issue_34610: TextSerializationFailure # Was: Pass
regress/issue_34614: TextSerializationFailure # Was: Pass
@@ -1589,18 +1558,64 @@
regress/issue_35266: TextSerializationFailure # Was: RuntimeError # Expected
regress/issue_35900: TextSerializationFailure
regress/issue_36400: TextSerializationFailure
-regress/issue_36647_2: TextSerializationFailure
regress/issue_36647: TextSerializationFailure
+regress/issue_36647_2: TextSerializationFailure
regress/issue_36669: TextSerializationFailure
regress/issue_36793: TextSerializationFailure
regress/issue_37285: TextSerializationFailure
regress/issue_37681: TextSerializationFailure
+regress/issue_39035.crash: RuntimeError
regress/issue_39035.crash: TextSerializationFailure
regress/issue_39040: TextSerializationFailure
regress/issue_39091_1: RuntimeError
+regress/issue_39091_2: RuntimeError
regress/issue_39091_2: TextSerializationFailure
regress/issue_39682: TextSerializationFailure
regress/issue_41265.crash: TextSerializationFailure
+runtime_checks/call_kinds: TextSerializationFailure # Was: Pass
+runtime_checks/call_kinds_get: TextSerializationFailure # Was: Pass
+runtime_checks/call_kinds_set: TextSerializationFailure # Was: Pass
+runtime_checks/call_method_implicit_tear_off: TextSerializationFailure # Was: Pass
+runtime_checks/call_method_implicit_tear_off_future_or: TextSerializationFailure # Was: Pass
+runtime_checks/contravariant_field: TextSerializationFailure # Was: Pass
+runtime_checks/contravariant_generic_method_type_parameter: TextSerializationFailure # Was: Pass
+runtime_checks/contravariant_generic_return: TextSerializationFailure # Was: Pass
+runtime_checks/contravariant_generic_return_null_aware: TextSerializationFailure # Was: Pass
+runtime_checks/contravariant_generic_return_tear_off: TextSerializationFailure # Was: Pass
+runtime_checks/contravariant_getter: TextSerializationFailure # Was: Pass
+runtime_checks/contravariant_getter_return: TextSerializationFailure # Was: Pass
+runtime_checks/contravariant_getter_return_null_aware: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_generic_method_type_parameter: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_generic_parameter: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_generic_parameter_complex: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_generic_parameter_in_interface: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_generic_parameter_in_interface_mixin: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_generic_parameter_in_interface_super: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_generic_parameter_in_interface_super_mixin: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_generic_parameter_tear_off: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_keyword: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_keyword_field: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_keyword_field_inherited_by_setter: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_keyword_setter: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_keyword_setter_inherited_by_field: TextSerializationFailure # Was: Pass
+runtime_checks/covariant_setter: TextSerializationFailure # Was: Pass
+runtime_checks/dynamic_invocation: TextSerializationFailure # Was: Pass
+runtime_checks/dynamic_invocation_generic: TextSerializationFailure # Was: Pass
+runtime_checks/dynamic_invocation_of_getter: TextSerializationFailure # Was: Pass
+runtime_checks/field_forwarding_stub_generic_covariant: ExpectationFileMismatch
+runtime_checks/field_forwarding_stub_generic_covariant: TextSerializationFailure # Was: Pass
+runtime_checks/forwarding_stub_with_default_values: TextSerializationFailure # Was: Pass
+runtime_checks/forwarding_stub_with_non_covariant_param: TextSerializationFailure # Was: Pass
+runtime_checks/generic_covariance_inheritance_setter_field: TextSerializationFailure # Was: Pass
+runtime_checks/generic_vs_explicit_covariance: TextSerializationFailure # Was: Pass
+runtime_checks/implicit_downcast_assert_initializer: TextSerializationFailure # Was: Pass
+runtime_checks/implicit_downcast_assert_statement: TextSerializationFailure # Was: Pass
+runtime_checks/implicit_downcast_constructor_initializer: TextSerializationFailure # Was: Pass
+runtime_checks/implicit_downcast_do: TextSerializationFailure # Was: Pass
+runtime_checks/implicit_downcast_for_condition: TextSerializationFailure # Was: Pass
+runtime_checks/implicit_downcast_if: TextSerializationFailure # Was: Pass
+runtime_checks/implicit_downcast_not: TextSerializationFailure # Was: Pass
+runtime_checks/implicit_downcast_while: TextSerializationFailure # Was: Pass
runtime_checks_new/abstract_override_becomes_forwarding_stub: ExpectationFileMismatch
runtime_checks_new/abstract_override_becomes_forwarding_stub: TextSerializationFailure # Was: Pass
runtime_checks_new/call_through_this: TextSerializationFailure # Was: Pass
@@ -1623,56 +1638,12 @@
runtime_checks_new/mixin_forwarding_stub_setter: TypeCheckError
runtime_checks_new/stub_checked_via_target: TextSerializationFailure # Was: Pass
runtime_checks_new/stub_from_interface_contravariant_from_class: TextSerializationFailure # Was: Pass
-runtime_checks_new/stub_from_interface_covariant_from_interface: TextSerializationFailure # Was: Pass
-runtime_checks_new/stub_from_interface_covariant_from_super: TextSerializationFailure # Was: Pass
runtime_checks_new/stub_from_interface_covariantImpl_from_class: TextSerializationFailure # Was: Pass
runtime_checks_new/stub_from_interface_covariantImpl_from_interface: TextSerializationFailure # Was: Pass
runtime_checks_new/stub_from_interface_covariantImpl_from_super: TextSerializationFailure # Was: Pass
runtime_checks_new/stub_from_interface_covariantInterface_from_class: TextSerializationFailure # Was: Pass
-runtime_checks/call_kinds_get: TextSerializationFailure # Was: Pass
-runtime_checks/call_kinds_set: TextSerializationFailure # Was: Pass
-runtime_checks/call_kinds: TextSerializationFailure # Was: Pass
-runtime_checks/call_method_implicit_tear_off_future_or: TextSerializationFailure # Was: Pass
-runtime_checks/call_method_implicit_tear_off: TextSerializationFailure # Was: Pass
-runtime_checks/contravariant_field: TextSerializationFailure # Was: Pass
-runtime_checks/contravariant_generic_method_type_parameter: TextSerializationFailure # Was: Pass
-runtime_checks/contravariant_generic_return_null_aware: TextSerializationFailure # Was: Pass
-runtime_checks/contravariant_generic_return_tear_off: TextSerializationFailure # Was: Pass
-runtime_checks/contravariant_generic_return: TextSerializationFailure # Was: Pass
-runtime_checks/contravariant_getter_return_null_aware: TextSerializationFailure # Was: Pass
-runtime_checks/contravariant_getter_return: TextSerializationFailure # Was: Pass
-runtime_checks/contravariant_getter: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_generic_method_type_parameter: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_generic_parameter_complex: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_generic_parameter_in_interface_mixin: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_generic_parameter_in_interface_super_mixin: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_generic_parameter_in_interface_super: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_generic_parameter_in_interface: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_generic_parameter_tear_off: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_generic_parameter: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_keyword_field_inherited_by_setter: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_keyword_field: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_keyword_setter_inherited_by_field: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_keyword_setter: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_keyword: TextSerializationFailure # Was: Pass
-runtime_checks/covariant_setter: TextSerializationFailure # Was: Pass
-runtime_checks/dynamic_invocation_generic: TextSerializationFailure # Was: Pass
-runtime_checks/dynamic_invocation_of_getter: TextSerializationFailure # Was: Pass
-runtime_checks/dynamic_invocation: TextSerializationFailure # Was: Pass
-runtime_checks/field_forwarding_stub_generic_covariant: ExpectationFileMismatch
-runtime_checks/field_forwarding_stub_generic_covariant: TextSerializationFailure # Was: Pass
-runtime_checks/forwarding_stub_with_default_values: TextSerializationFailure # Was: Pass
-runtime_checks/forwarding_stub_with_non_covariant_param: TextSerializationFailure # Was: Pass
-runtime_checks/generic_covariance_inheritance_setter_field: TextSerializationFailure # Was: Pass
-runtime_checks/generic_vs_explicit_covariance: TextSerializationFailure # Was: Pass
-runtime_checks/implicit_downcast_assert_initializer: TextSerializationFailure # Was: Pass
-runtime_checks/implicit_downcast_assert_statement: TextSerializationFailure # Was: Pass
-runtime_checks/implicit_downcast_constructor_initializer: TextSerializationFailure # Was: Pass
-runtime_checks/implicit_downcast_do: TextSerializationFailure # Was: Pass
-runtime_checks/implicit_downcast_for_condition: TextSerializationFailure # Was: Pass
-runtime_checks/implicit_downcast_if: TextSerializationFailure # Was: Pass
-runtime_checks/implicit_downcast_not: TextSerializationFailure # Was: Pass
-runtime_checks/implicit_downcast_while: TextSerializationFailure # Was: Pass
+runtime_checks_new/stub_from_interface_covariant_from_interface: TextSerializationFailure # Was: Pass
+runtime_checks_new/stub_from_interface_covariant_from_super: TextSerializationFailure # Was: Pass
set_literals/disambiguation_rule: TextSerializationFailure # Was: RuntimeError
top_level_variance_test: TextSerializationFailure
triple_shift/invalid_operator: TextSerializationFailure
diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart
index e51b0a8..8ee02d2 100644
--- a/pkg/kernel/lib/ast.dart
+++ b/pkg/kernel/lib/ast.dart
@@ -8454,6 +8454,8 @@
return _mode ?? NonNullableByDefaultCompiledMode.Disabled;
}
+ NonNullableByDefaultCompiledMode get modeRaw => _mode;
+
Component(
{CanonicalName nameRoot,
List<Library> libraries,
diff --git a/pkg/kernel/lib/binary/ast_from_binary.dart b/pkg/kernel/lib/binary/ast_from_binary.dart
index 12a494a..941c5d5 100644
--- a/pkg/kernel/lib/binary/ast_from_binary.dart
+++ b/pkg/kernel/lib/binary/ast_from_binary.dart
@@ -34,6 +34,12 @@
}
}
+class CompilationModeError {
+ final String message;
+
+ CompilationModeError(this.message);
+}
+
class CanonicalNameError {
final String message;
@@ -679,10 +685,22 @@
// Read component index from the end of this ComponentFiles serialized data.
_ComponentIndex index = _readComponentIndex(componentFileSize);
if (compilationMode == null) {
+ compilationMode = component.modeRaw;
+ }
+ if (compilationMode == null) {
compilationMode = index.compiledMode;
} else if (compilationMode != index.compiledMode) {
- throw fail("Mixed compilation mode found: $compilationMode "
- "and ${index.compiledMode}.");
+ if (compilationMode == NonNullableByDefaultCompiledMode.Agnostic) {
+ compilationMode = index.compiledMode;
+ } else if (index.compiledMode ==
+ NonNullableByDefaultCompiledMode.Agnostic) {
+ // Keep as-is.
+ } else {
+ // Mixed mode where agnostic isn't involved.
+ throw new CompilationModeError(
+ "Mixed compilation mode found: $compilationMode "
+ "and ${index.compiledMode}.");
+ }
}
_byteOffset = index.binaryOffsetForStringTable;
@@ -722,7 +740,7 @@
Reference mainMethod =
getMemberReferenceFromInt(index.mainMethodReference, allowNull: true);
- component.setMainMethodAndMode(mainMethod, false, index.compiledMode);
+ component.setMainMethodAndMode(mainMethod, false, compilationMode);
_byteOffset = _componentStartOffset + componentFileSize;
diff --git a/pkg/kernel/lib/text/serializer_combinators.dart b/pkg/kernel/lib/text/serializer_combinators.dart
index 45de839..9a2dda6 100644
--- a/pkg/kernel/lib/text/serializer_combinators.dart
+++ b/pkg/kernel/lib/text/serializer_combinators.dart
@@ -205,14 +205,21 @@
// A tagged union of serializer/deserializers.
class Case<T extends Node> extends TextSerializer<T> {
final Tagger<T> tagger;
- final List<String> tags;
- final List<TextSerializer<T>> serializers;
+ final List<String> _tags;
+ final List<TextSerializer<T>> _serializers;
- const Case(this.tagger, this.tags, this.serializers);
+ Case(this.tagger, Map<String, TextSerializer<T>> tagsAndSerializers)
+ : _tags = tagsAndSerializers.keys.toList(),
+ _serializers = tagsAndSerializers.values.toList();
Case.uninitialized(this.tagger)
- : tags = [],
- serializers = [];
+ : _tags = [],
+ _serializers = [];
+
+ void registerTags(Map<String, TextSerializer<T>> tagsAndSerializers) {
+ _tags.addAll(tagsAndSerializers.keys);
+ _serializers.addAll(tagsAndSerializers.values);
+ }
T readFrom(Iterator<Object> stream, DeserializationState state) {
if (stream.current is! Iterator) {
@@ -224,10 +231,10 @@
throw StateError("expected atom, found list");
}
String tag = nested.current;
- for (int i = 0; i < tags.length; ++i) {
- if (tags[i] == tag) {
+ for (int i = 0; i < _tags.length; ++i) {
+ if (_tags[i] == tag) {
nested.moveNext();
- T result = serializers[i].readFrom(nested, state);
+ T result = _serializers[i].readFrom(nested, state);
if (nested.moveNext()) {
throw StateError("extra cruft in tagged '${tag}'");
}
@@ -240,18 +247,18 @@
void writeTo(StringBuffer buffer, T object, SerializationState state) {
String tag = tagger.tag(object);
- for (int i = 0; i < tags.length; ++i) {
- if (tags[i] == tag) {
+ for (int i = 0; i < _tags.length; ++i) {
+ if (_tags[i] == tag) {
buffer.write("(${tag}");
- if (!serializers[i].isEmpty) {
+ if (!_serializers[i].isEmpty) {
buffer.write(" ");
}
- serializers[i].writeTo(buffer, object, state);
+ _serializers[i].writeTo(buffer, object, state);
buffer.write(")");
return;
}
}
- throw StateError("unrecognized tag '${tag}");
+ throw StateError("unrecognized tag '${tag}'");
}
}
diff --git a/pkg/kernel/lib/text/text_serialization_verifier.dart b/pkg/kernel/lib/text/text_serialization_verifier.dart
index 4b7eff8..ead78e9 100644
--- a/pkg/kernel/lib/text/text_serialization_verifier.dart
+++ b/pkg/kernel/lib/text/text_serialization_verifier.dart
@@ -61,11 +61,18 @@
final List<TextSerializationVerificationFailure> failures =
<TextSerializationVerificationFailure>[];
+ final CanonicalName root;
+
Uri lastSeenUri = noUri;
int lastSeenOffset = noOffset;
- TextSerializationVerifier() {
+ static const bool showStackTrace = bool.fromEnvironment(
+ "text_serialization.showStackTrace",
+ defaultValue: false);
+
+ TextSerializationVerifier({CanonicalName root})
+ : root = root ?? new CanonicalName.root() {
initializeSerializers();
}
@@ -85,16 +92,23 @@
stream.moveNext();
T result;
try {
- result = serializer.readFrom(
- stream, new DeserializationState(null, new CanonicalName.root()));
- } catch (exception) {
- failures.add(
- new TextDeserializationFailure(exception.toString(), uri, offset));
+ result =
+ serializer.readFrom(stream, new DeserializationState(null, root));
+ } catch (exception, stackTrace) {
+ String message =
+ showStackTrace ? "${exception}\n${stackTrace}" : "${exception}";
+ failures.add(new TextDeserializationFailure(message, uri, offset));
}
if (stream.moveNext()) {
failures.add(new TextDeserializationFailure(
"unexpected trailing text", uri, offset));
}
+ if (result == null) {
+ failures.add(new TextDeserializationFailure(
+ "Deserialization of the following returned null: '${input}'",
+ uri,
+ offset));
+ }
return result;
}
@@ -103,9 +117,10 @@
StringBuffer buffer = new StringBuffer();
try {
serializer.writeTo(buffer, node, new SerializationState(null));
- } catch (exception) {
- failures
- .add(new TextSerializationFailure(exception.toString(), uri, offset));
+ } catch (exception, stackTrace) {
+ String message =
+ showStackTrace ? "${exception}\n${stackTrace}" : "${exception}";
+ failures.add(new TextSerializationFailure(message, uri, offset));
}
return buffer.toString();
}
@@ -124,6 +139,9 @@
// Do the round trip.
Expression deserialized =
readNode(initial, expressionSerializer, uri, offset);
+ // The error is reported elsewhere for the case of null.
+ if (deserialized == null) return;
+
String serialized =
writeNode(deserialized, expressionSerializer, uri, offset);
@@ -140,6 +158,9 @@
// Do the round trip.
DartType deserialized = readNode(initial, dartTypeSerializer, uri, offset);
+ // The error is reported elsewhere for the case of null.
+ if (deserialized == null) return;
+
String serialized =
writeNode(deserialized, dartTypeSerializer, uri, offset);
@@ -162,8 +183,11 @@
// Do the round trip.
Statement deserialized =
readNode(initial, statementSerializer, uri, offset);
+ // The error is reported elsewhere for the case of null.
+ if (deserialized == null) return;
+
String serialized =
- writeNode(deserialized, expressionSerializer, uri, offset);
+ writeNode(deserialized, statementSerializer, uri, offset);
if (initial != serialized) {
failures.add(new TextRoundTripFailure(initial, serialized, uri, offset));
@@ -758,7 +782,7 @@
@override
void visitBlock(Block node) {
storeLastSeenUriAndOffset(node);
- makeStatementRoundTrip(node);
+ node.visitChildren(this);
}
@override
diff --git a/pkg/kernel/lib/text/text_serializer.dart b/pkg/kernel/lib/text/text_serializer.dart
index 633e8c6..02dd86e 100644
--- a/pkg/kernel/lib/text/text_serializer.dart
+++ b/pkg/kernel/lib/text/text_serializer.dart
@@ -40,13 +40,8 @@
throw UnimplementedError('deserialization of private names');
}
-const TextSerializer<Name> nameSerializer = const Case(const NameTagger(), [
- "public",
- "private",
-], [
- publicName,
- privateName
-]);
+TextSerializer<Name> nameSerializer = new Case(
+ const NameTagger(), {"public": publicName, "private": privateName});
class ExpressionTagger extends ExpressionVisitor<String>
implements Tagger<Expression> {
@@ -440,8 +435,8 @@
return new PropertySet(tuple.first, tuple.second, tuple.third);
}
-const TextSerializer<SuperPropertyGet> superPropertyGetSerializer =
- const Wrapped(unwrapSuperPropertyGet, wrapSuperPropertyGet, nameSerializer);
+TextSerializer<SuperPropertyGet> superPropertyGetSerializer =
+ new Wrapped(unwrapSuperPropertyGet, wrapSuperPropertyGet, nameSerializer);
Name unwrapSuperPropertyGet(SuperPropertyGet expression) {
return expression.name;
@@ -822,15 +817,11 @@
}
TextSerializer<VariableDeclaration> variableDeclarationSerializer =
- new Case(const VariableDeclarationTagger(), [
- "var",
- "final",
- "const",
-], [
- varDeclarationSerializer,
- finalDeclarationSerializer,
- constDeclarationSerializer,
-]);
+ new Case(const VariableDeclarationTagger(), {
+ "var": varDeclarationSerializer,
+ "final": finalDeclarationSerializer,
+ "const": constDeclarationSerializer,
+});
const TextSerializer<TypeParameter> typeParameterSerializer =
const Wrapped(unwrapTypeParameter, wrapTypeParameter, const DartString());
@@ -1285,141 +1276,74 @@
Case<Library> librarySerializer = new Case.uninitialized(const LibraryTagger());
void initializeSerializers() {
- expressionSerializer.tags.addAll([
- "string",
- "int",
- "double",
- "bool",
- "null",
- "invalid",
- "not",
- "&&",
- "||",
- "concat",
- "symbol",
- "this",
- "rethrow",
- "throw",
- "await",
- "cond",
- "is",
- "as",
- "type",
- "list",
- "const-list",
- "set",
- "const-set",
- "map",
- "const-map",
- "let",
- "get-prop",
- "set-prop",
- "get-super",
- "set-super",
- "invoke-method",
- "invoke-super",
- "get-var",
- "set-var",
- "get-static",
- "set-static",
- "get-direct-prop",
- "set-direct-prop",
- "invoke-static",
- "invoke-const-static",
- "invoke-direct-method",
- "invoke-constructor",
- "invoke-const-constructor",
- "fun",
- ]);
- expressionSerializer.serializers.addAll([
- stringLiteralSerializer,
- intLiteralSerializer,
- doubleLiteralSerializer,
- boolLiteralSerializer,
- nullLiteralSerializer,
- invalidExpressionSerializer,
- notSerializer,
- logicalAndSerializer,
- logicalOrSerializer,
- stringConcatenationSerializer,
- symbolLiteralSerializer,
- thisExpressionSerializer,
- rethrowSerializer,
- throwSerializer,
- awaitExpressionSerializer,
- conditionalExpressionSerializer,
- isExpressionSerializer,
- asExpressionSerializer,
- typeLiteralSerializer,
- listLiteralSerializer,
- constListLiteralSerializer,
- setLiteralSerializer,
- constSetLiteralSerializer,
- mapLiteralSerializer,
- constMapLiteralSerializer,
- letSerializer,
- propertyGetSerializer,
- propertySetSerializer,
- superPropertyGetSerializer,
- superPropertySetSerializer,
- methodInvocationSerializer,
- superMethodInvocationSerializer,
- variableGetSerializer,
- variableSetSerializer,
- staticGetSerializer,
- staticSetSerializer,
- directPropertyGetSerializer,
- directPropertySetSerializer,
- staticInvocationSerializer,
- constStaticInvocationSerializer,
- directMethodInvocationSerializer,
- constructorInvocationSerializer,
- constConstructorInvocationSerializer,
- functionExpressionSerializer,
- ]);
- dartTypeSerializer.tags.addAll([
- "invalid",
- "dynamic",
- "void",
- "bottom",
- "->",
- "par",
- ]);
- dartTypeSerializer.serializers.addAll([
- invalidTypeSerializer,
- dynamicTypeSerializer,
- voidTypeSerializer,
- bottomTypeSerializer,
- functionTypeSerializer,
- typeParameterTypeSerializer,
- ]);
- statementSerializer.tags.addAll([
- "expr",
- "ret",
- ]);
- statementSerializer.serializers.addAll([
- expressionStatementSerializer,
- returnStatementSerializer,
- ]);
- functionNodeSerializer.tags.addAll([
- "sync",
- "async",
- "sync-star",
- "async-star",
- "sync-yielding",
- ]);
- functionNodeSerializer.serializers.addAll([
- syncFunctionNodeSerializer,
- asyncFunctionNodeSerializer,
- syncStarFunctionNodeSerializer,
- asyncStarFunctionNodeSerializer,
- syncYieldingStarFunctionNodeSerializer,
- ]);
- procedureSerializer.tags.addAll(["static-method"]);
- procedureSerializer.serializers.addAll([staticMethodSerializer]);
- librarySerializer.tags.addAll(["legacy", "null-safe"]);
- librarySerializer.serializers.addAll([
- libraryContentsSerializer,
- libraryContentsSerializer,
- ]);
+ expressionSerializer.registerTags({
+ "string": stringLiteralSerializer,
+ "int": intLiteralSerializer,
+ "double": doubleLiteralSerializer,
+ "bool": boolLiteralSerializer,
+ "null": nullLiteralSerializer,
+ "invalid": invalidExpressionSerializer,
+ "not": notSerializer,
+ "&&": logicalAndSerializer,
+ "||": logicalOrSerializer,
+ "concat": stringConcatenationSerializer,
+ "symbol": symbolLiteralSerializer,
+ "this": thisExpressionSerializer,
+ "rethrow": rethrowSerializer,
+ "throw": throwSerializer,
+ "await": awaitExpressionSerializer,
+ "cond": conditionalExpressionSerializer,
+ "is": isExpressionSerializer,
+ "as": asExpressionSerializer,
+ "type": typeLiteralSerializer,
+ "list": listLiteralSerializer,
+ "const-list": constListLiteralSerializer,
+ "set": setLiteralSerializer,
+ "const-set": constSetLiteralSerializer,
+ "map": mapLiteralSerializer,
+ "const-map": constMapLiteralSerializer,
+ "let": letSerializer,
+ "get-prop": propertyGetSerializer,
+ "set-prop": propertySetSerializer,
+ "get-super": superPropertyGetSerializer,
+ "set-super": superPropertySetSerializer,
+ "invoke-method": methodInvocationSerializer,
+ "invoke-super": superMethodInvocationSerializer,
+ "get-var": variableGetSerializer,
+ "set-var": variableSetSerializer,
+ "get-static": staticGetSerializer,
+ "set-static": staticSetSerializer,
+ "get-direct-prop": directPropertyGetSerializer,
+ "set-direct-prop": directPropertySetSerializer,
+ "invoke-static": staticInvocationSerializer,
+ "invoke-const-static": constStaticInvocationSerializer,
+ "invoke-direct-method": directMethodInvocationSerializer,
+ "invoke-constructor": constructorInvocationSerializer,
+ "invoke-const-constructor": constConstructorInvocationSerializer,
+ "fun": functionExpressionSerializer,
+ });
+ dartTypeSerializer.registerTags({
+ "invalid": invalidTypeSerializer,
+ "dynamic": dynamicTypeSerializer,
+ "void": voidTypeSerializer,
+ "bottom": bottomTypeSerializer,
+ "->": functionTypeSerializer,
+ "par": typeParameterTypeSerializer,
+ });
+ statementSerializer.registerTags({
+ "expr": expressionStatementSerializer,
+ "ret": returnStatementSerializer,
+ });
+ functionNodeSerializer.registerTags({
+ "sync": syncFunctionNodeSerializer,
+ "async": asyncFunctionNodeSerializer,
+ "sync-star": syncStarFunctionNodeSerializer,
+ "async-star": asyncStarFunctionNodeSerializer,
+ "sync-yielding": syncYieldingStarFunctionNodeSerializer,
+ });
+ procedureSerializer.registerTags({"static-method": staticMethodSerializer});
+ librarySerializer.registerTags({
+ "legacy": libraryContentsSerializer,
+ "null-safe": libraryContentsSerializer,
+ });
}
diff --git a/pkg/kernel/test/binary/component_mode_test.dart b/pkg/kernel/test/binary/component_mode_test.dart
new file mode 100644
index 0000000..d30c99d
--- /dev/null
+++ b/pkg/kernel/test/binary/component_mode_test.dart
@@ -0,0 +1,149 @@
+// Copyright (c) 2020, 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 'package:kernel/binary/ast_from_binary.dart';
+
+import 'utils.dart';
+
+main() {
+ setCompileMode(Component c, NonNullableByDefaultCompiledMode mode) {
+ c.setMainMethodAndMode(null, true, mode);
+ }
+
+ verifyMode(Component c, NonNullableByDefaultCompiledMode mode) {
+ if (c.mode != mode) {
+ throw "Serialized and re-read component had change in mode: "
+ "Expected $mode got ${c.mode}.";
+ }
+ }
+
+ const List<NonNullableByDefaultCompiledMode> modes = const [
+ NonNullableByDefaultCompiledMode.Disabled,
+ NonNullableByDefaultCompiledMode.Weak,
+ NonNullableByDefaultCompiledMode.Strong,
+ NonNullableByDefaultCompiledMode.Agnostic,
+ ];
+
+ int combination = 0;
+ for (NonNullableByDefaultCompiledMode c1Mode in modes) {
+ for (NonNullableByDefaultCompiledMode c2Mode in modes) {
+ combination++;
+ print("Checking combination #$combination ("
+ "c1Mode: $c1Mode; "
+ "c2Mode: $c2Mode; "
+ ")");
+
+ // Try individually.
+ List<int> c1Serialized;
+ {
+ Library lib1 = new Library(Uri.parse("foo://bar.dart"));
+ Component c1 = new Component(libraries: [lib1]);
+ setCompileMode(c1, c1Mode);
+ c1Serialized = serializeComponent(c1);
+ Component c1RoundTrip = loadComponentFromBytes(c1Serialized);
+ verifyMode(c1RoundTrip, c1Mode);
+ }
+
+ List<int> c2Serialized;
+ {
+ Library lib2 = new Library(Uri.parse("foo://baz.dart"));
+ Component c2 = new Component(libraries: [lib2]);
+ setCompileMode(c2, c2Mode);
+ c2Serialized = serializeComponent(c2);
+ Component c2RoundTrip = loadComponentFromBytes(c2Serialized);
+ verifyMode(c2RoundTrip, c2Mode);
+ }
+
+ // Try with combined binary.
+ try {
+ List<int> combined = [];
+ combined.addAll(c1Serialized);
+ combined.addAll(c2Serialized);
+ Component combinedRoundTrip = loadComponentFromBytes(combined);
+ verifyMode(combinedRoundTrip, verifyOK(c1Mode, c2Mode));
+ print(" -> OK with $c1Mode and $c2Mode");
+ } on CompilationModeError catch (e) {
+ print(" -> Got $e with $c1Mode and $c2Mode");
+ verifyError(c1Mode, c2Mode);
+ }
+ // Try other order.
+ try {
+ List<int> combined = [];
+ combined.addAll(c2Serialized);
+ combined.addAll(c1Serialized);
+ Component combinedRoundTrip = loadComponentFromBytes(combined);
+ verifyMode(combinedRoundTrip, verifyOK(c1Mode, c2Mode));
+ print(" -> OK with $c1Mode and $c2Mode");
+ } on CompilationModeError catch (e) {
+ print(" -> Got $e with $c1Mode and $c2Mode");
+ verifyError(c1Mode, c2Mode);
+ }
+
+ // Try with individual binary, but loaded into same component.
+ try {
+ Component combinedRoundTrip = loadComponentFromBytes(c1Serialized);
+ combinedRoundTrip =
+ loadComponentFromBytes(c2Serialized, combinedRoundTrip);
+ verifyMode(combinedRoundTrip, verifyOK(c1Mode, c2Mode));
+ print(" -> OK with $c1Mode and $c2Mode");
+ } on CompilationModeError catch (e) {
+ print(" -> Got $e with $c1Mode and $c2Mode");
+ verifyError(c1Mode, c2Mode);
+ }
+ // Try other order.
+ try {
+ Component combinedRoundTrip = loadComponentFromBytes(c2Serialized);
+ combinedRoundTrip =
+ loadComponentFromBytes(c1Serialized, combinedRoundTrip);
+ verifyMode(combinedRoundTrip, verifyOK(c1Mode, c2Mode));
+ print(" -> OK with $c1Mode and $c2Mode");
+ } on CompilationModeError catch (e) {
+ print(" -> Got $e with $c1Mode and $c2Mode");
+ verifyError(c1Mode, c2Mode);
+ }
+
+ // Try with individual binary, but loaded into same component where
+ // component initially does not have a mode.
+ try {
+ Component combinedRoundTrip = new Component();
+ combinedRoundTrip =
+ loadComponentFromBytes(c1Serialized, combinedRoundTrip);
+ combinedRoundTrip =
+ loadComponentFromBytes(c2Serialized, combinedRoundTrip);
+ verifyMode(combinedRoundTrip, verifyOK(c1Mode, c2Mode));
+ print(" -> OK with $c1Mode and $c2Mode");
+ } on CompilationModeError catch (e) {
+ print(" -> Got $e with $c1Mode and $c2Mode");
+ verifyError(c1Mode, c2Mode);
+ }
+ }
+ }
+
+ print("Done: Everything looks good.");
+}
+
+bool isOK(NonNullableByDefaultCompiledMode c1Mode,
+ NonNullableByDefaultCompiledMode c2Mode) {
+ if (c1Mode == c2Mode) return true;
+ if (c1Mode == NonNullableByDefaultCompiledMode.Agnostic) return true;
+ if (c2Mode == NonNullableByDefaultCompiledMode.Agnostic) return true;
+ return false;
+}
+
+NonNullableByDefaultCompiledMode verifyOK(
+ NonNullableByDefaultCompiledMode c1Mode,
+ NonNullableByDefaultCompiledMode c2Mode) {
+ if (isOK(c1Mode, c2Mode)) {
+ if (c1Mode == NonNullableByDefaultCompiledMode.Agnostic) return c2Mode;
+ return c1Mode;
+ }
+ throw "Not OK combination: $c1Mode and $c2Mode";
+}
+
+void verifyError(NonNullableByDefaultCompiledMode c1Mode,
+ NonNullableByDefaultCompiledMode c2Mode) {
+ if (isOK(c1Mode, c2Mode)) {
+ throw "Unexpected error for $c1Mode and $c2Mode";
+ }
+}
diff --git a/pkg/kernel/test/binary/utils.dart b/pkg/kernel/test/binary/utils.dart
index 28bf4be..801f322 100644
--- a/pkg/kernel/test/binary/utils.dart
+++ b/pkg/kernel/test/binary/utils.dart
@@ -14,12 +14,16 @@
List<Library> serializationRoundTrip(List<Library> libraries) {
Component c = new Component(libraries: libraries);
+ List<int> bytes = serializeComponent(c);
+ Component c2 = loadComponentFromBytes(bytes);
+ return c2.libraries;
+}
+
+List<int> serializeComponent(Component c) {
ByteSink byteSink = new ByteSink();
BinaryPrinter printer = new BinaryPrinter(byteSink);
printer.writeComponentFile(c);
- List<int> bytes = byteSink.builder.takeBytes();
- Component c2 = loadComponentFromBytes(bytes);
- return c2.libraries;
+ return byteSink.builder.takeBytes();
}
/// A [Sink] that directly writes data into a byte builder.
diff --git a/pkg/nnbd_migration/lib/instrumentation.dart b/pkg/nnbd_migration/lib/instrumentation.dart
index 8689967..2ead984 100644
--- a/pkg/nnbd_migration/lib/instrumentation.dart
+++ b/pkg/nnbd_migration/lib/instrumentation.dart
@@ -17,22 +17,25 @@
final int column;
+ final int offset;
+
/// Name of the enclosing function, or `null` if not known.
String function;
- CodeReference(this.path, this.line, this.column, this.function);
+ CodeReference(this.path, this.offset, this.line, this.column, this.function);
/// Creates a [CodeReference] pointing to the given [node].
factory CodeReference.fromAstNode(AstNode node) {
var compilationUnit = node.thisOrAncestorOfType<CompilationUnit>();
var source = compilationUnit.declaredElement.source;
var location = compilationUnit.lineInfo.getLocation(node.offset);
- return CodeReference(source.fullName, location.lineNumber,
+ return CodeReference(source.fullName, node.offset, location.lineNumber,
location.columnNumber, _computeEnclosingName(node));
}
CodeReference.fromJson(dynamic json)
: path = json['path'] as String,
+ offset = json['offset'] as int,
line = json['line'] as int,
column = json['col'] as int,
function = json['function'] as String;
@@ -50,6 +53,7 @@
Map<String, Object> toJson() {
return {
'path': path,
+ 'offset': offset,
'line': line,
'col': column,
if (function != null) 'function': function
diff --git a/pkg/nnbd_migration/lib/nnbd_migration.dart b/pkg/nnbd_migration/lib/nnbd_migration.dart
index c1c0d0f..711a751 100644
--- a/pkg/nnbd_migration/lib/nnbd_migration.dart
+++ b/pkg/nnbd_migration/lib/nnbd_migration.dart
@@ -17,21 +17,36 @@
/// Description of fixes that might be performed by nullability migration.
class NullabilityFixDescription {
- /// An if-test or conditional expression needs to have its condition and
- /// "then" branch discarded.
- static const discardThen = const NullabilityFixDescription._(
- appliedMessage:
- 'Discarded a condition which is always false, and the "then" branch '
- 'that follows',
- kind: NullabilityFixKind.removeDeadCode,
- );
-
/// A variable declaration needs to be marked as "late" due to the presence of
/// a `/*late*/` hint.
static const addLateDueToHint = const NullabilityFixDescription._(
appliedMessage: 'Added a late keyword, due to a hint',
kind: NullabilityFixKind.addLateDueToHint);
+ /// An expression's value needs to be null-checked.
+ static const checkExpression = const NullabilityFixDescription._(
+ appliedMessage: 'Added a non-null assertion to nullable expression',
+ kind: NullabilityFixKind.checkExpression,
+ );
+
+ /// An expression's value will be null-checked due to a hint.
+ static const checkExpressionDueToHint = const NullabilityFixDescription._(
+ appliedMessage: 'Accepted a null check hint',
+ kind: NullabilityFixKind.checkExpressionDueToHint,
+ );
+
+ /// Informative message: a condition of an if-test or conditional expression
+ /// will always evaluate to `false` in strong checking mode.
+ static const conditionFalseInStrongMode = const NullabilityFixDescription._(
+ appliedMessage: 'Condition will always be false in strong checking mode',
+ kind: NullabilityFixKind.conditionFalseInStrongMode);
+
+ /// Informative message: a condition of an if-test or conditional expression
+ /// will always evaluate to `true` in strong checking mode.
+ static const conditionTrueInStrongMode = const NullabilityFixDescription._(
+ appliedMessage: 'Condition will always be true in strong checking mode',
+ kind: NullabilityFixKind.conditionTrueInStrongMode);
+
/// An if-test or conditional expression needs to have its condition
/// discarded.
static const discardCondition = const NullabilityFixDescription._(
@@ -46,6 +61,15 @@
kind: NullabilityFixKind.removeDeadCode,
);
+ /// An if-test or conditional expression needs to have its condition and
+ /// "then" branch discarded.
+ static const discardThen = const NullabilityFixDescription._(
+ appliedMessage:
+ 'Discarded a condition which is always false, and the "then" branch '
+ 'that follows',
+ kind: NullabilityFixKind.removeDeadCode,
+ );
+
/// An if-test needs to be discarded completely.
static const discardIf = const NullabilityFixDescription._(
appliedMessage: 'Discarded an if-test with no effect',
@@ -57,23 +81,19 @@
kind: NullabilityFixKind.downcastExpression,
);
+ /// Informative message: a null-aware access won't be necessary in strong
+ /// checking mode.
+ static const nullAwarenessUnnecessaryInStrongMode =
+ const NullabilityFixDescription._(
+ appliedMessage:
+ 'Null-aware access will be unnecessary in strong checking mode',
+ kind: NullabilityFixKind.nullAwarenessUnnecessaryInStrongMode);
+
static const otherCastExpression = const NullabilityFixDescription._(
appliedMessage: 'Added a cast to an expression (non-downcast)',
kind: NullabilityFixKind.otherCastExpression,
);
- /// An expression's value needs to be null-checked.
- static const checkExpression = const NullabilityFixDescription._(
- appliedMessage: 'Added a non-null assertion to nullable expression',
- kind: NullabilityFixKind.checkExpression,
- );
-
- /// An expression's value will be null-checked due to a hint.
- static const checkExpressionDueToHint = const NullabilityFixDescription._(
- appliedMessage: 'Accepted a null check hint',
- kind: NullabilityFixKind.checkExpressionDueToHint,
- );
-
/// An unnecessary downcast has been discarded.
static const removeLanguageVersionComment = const NullabilityFixDescription._(
appliedMessage: 'Removed language version comment so that NNBD features '
@@ -182,12 +202,15 @@
enum NullabilityFixKind {
addLateDueToHint,
addRequired,
+ addType,
checkExpression,
checkExpressionDueToHint,
+ conditionFalseInStrongMode,
+ conditionTrueInStrongMode,
downcastExpression,
- addType,
makeTypeNullable,
makeTypeNullableDueToHint,
+ nullAwarenessUnnecessaryInStrongMode,
otherCastExpression,
removeAs,
removeDeadCode,
@@ -211,12 +234,17 @@
/// complete. TODO(paulberry): remove this mode once the migration algorithm
/// is fully implemented.
///
- /// Optional parameter [removeViaComments] indicates whether dead code should
- /// be removed in its entirety (the default) or removed by commenting it out.
+ /// Optional parameter [removeViaComments] indicates whether code that the
+ /// migration tool wishes to remove should instead be commenting it out.
+ ///
+ /// Optional parameter [warnOnWeakCode] indicates whether weak-only code
+ /// should be warned about or removed (in the way specified by
+ /// [removeViaComments]).
factory NullabilityMigration(NullabilityMigrationListener listener,
{bool permissive,
NullabilityMigrationInstrumentation instrumentation,
- bool removeViaComments}) = NullabilityMigrationImpl;
+ bool removeViaComments,
+ bool warnOnWeakCode}) = NullabilityMigrationImpl;
/// Check if this migration is being run permissively.
bool get isPermissive;
diff --git a/pkg/nnbd_migration/lib/src/edge_builder.dart b/pkg/nnbd_migration/lib/src/edge_builder.dart
index 8b82454..f2e5b91 100644
--- a/pkg/nnbd_migration/lib/src/edge_builder.dart
+++ b/pkg/nnbd_migration/lib/src/edge_builder.dart
@@ -571,7 +571,8 @@
DecoratedType thenType;
DecoratedType elseType;
- // TODO(paulberry): guard anything inside the true and false branches
+ // TODO(paulberry): guard anything inside the true and false branches.
+ // See https://github.com/dart-lang/sdk/issues/41551.
// Post-dominators diverge as we branch in the conditional.
// Note: we don't have to create a scope for each branch because they can't
diff --git a/pkg/nnbd_migration/lib/src/edit_plan.dart b/pkg/nnbd_migration/lib/src/edit_plan.dart
index 25ccfef..8389313 100644
--- a/pkg/nnbd_migration/lib/src/edit_plan.dart
+++ b/pkg/nnbd_migration/lib/src/edit_plan.dart
@@ -80,10 +80,10 @@
///
/// Optional argument [info] contains information about why the change was
/// made.
- const AtomicEdit.delete(this.length, {this.info})
+ const AtomicEdit.delete(this.length, {this.info, this.isInformative = false})
: assert(length > 0),
- replacement = '',
- isInformative = false;
+ assert(isInformative is bool),
+ replacement = '';
/// Initialize an edit to insert the [replacement] characters.
///
@@ -92,6 +92,7 @@
const AtomicEdit.insert(this.replacement,
{this.info, this.isInformative: false})
: assert(replacement.length > 0),
+ assert(isInformative is bool),
length = 0;
/// Initialize an edit to replace [length] characters with the [replacement]
@@ -259,6 +260,28 @@
}
/// Creates a new edit plan that consists of executing [innerPlan], and then
+ /// appending the given [comment]].
+ ///
+ /// Optional argument [info] contains information about why the change was
+ /// made.
+ ///
+ /// Optional argument [isInformative] indicates whether the comment is simply
+ /// informative, or should actually be applied to the final output (the
+ /// default).
+ NodeProducingEditPlan addCommentPostfix(
+ NodeProducingEditPlan innerPlan, String comment,
+ {AtomicEditInfo info, bool isInformative = false}) {
+ var end = innerPlan.end;
+ return surround(innerPlan, suffix: [
+ AtomicEdit.insert(' '),
+ AtomicEdit.insert(comment, info: info, isInformative: isInformative),
+ if (!_isJustBefore(end, const [')', ']', '}', ';']) &&
+ !_isJustBeforeWhitespace(end))
+ AtomicEdit.insert(' ')
+ ]);
+ }
+
+ /// Creates a new edit plan that consists of executing [innerPlan], and then
/// appending the given postfix [operator]. This could be used, for example,
/// to add a null check.
///
@@ -504,7 +527,15 @@
///
/// The created edit plan should be inserted into the list of inner plans for
/// a pass-through plan targeted at the source node. See [passThrough].
- EditPlan removeNullAwareness(Expression sourceNode, {AtomicEditInfo info}) {
+ ///
+ /// Optional argument [info] contains information about why the change was
+ /// made.
+ ///
+ /// Optional argument [isInformative] indicates whether the comment is simply
+ /// informative, or should actually be applied to the final output (the
+ /// default).
+ EditPlan removeNullAwareness(Expression sourceNode,
+ {AtomicEditInfo info, bool isInformative = false}) {
Token operator;
if (sourceNode is MethodInvocation) {
operator = sourceNode.operator;
@@ -517,7 +548,9 @@
}
assert(operator.type == TokenType.QUESTION_PERIOD);
return _TokenChangePlan(sourceNode, {
- operator.offset: [AtomicEdit.delete(1, info: info)]
+ operator.offset: [
+ AtomicEdit.delete(1, info: info, isInformative: isInformative)
+ ]
});
}
@@ -710,16 +743,21 @@
return lineInfo.lineStarts[lineNumber];
}
- /// Determines whether the given source [offset] comes just after an opener
- /// ('(', '[', or '{').
- bool _isJustAfterOpener(int offset) =>
- offset > 0 && const ['(', '[', '{'].contains(sourceText[offset - 1]);
+ /// Determines whether the given source [offset] comes just after one of the
+ /// characters in [characters].
+ bool _isJustAfter(int offset, List<String> characters) =>
+ offset > 0 && characters.contains(sourceText[offset - 1]);
- /// Determines whether the given source [end] comes just before a closer
- /// (')', ']', or '}').
- bool _isJustBeforeCloser(int end) =>
- end < sourceText.length &&
- const [')', ']', '}'].contains(sourceText[end]);
+ /// Determines whether the given source [end] comes just before one of the
+ /// characters in [characters].
+ bool _isJustBefore(int end, List<String> characters) =>
+ end < sourceText.length && characters.contains(sourceText[end]);
+
+ /// Determines whether the given source [end] comes just before whitespace.
+ /// For the purpose of this check, the end of the file is considered
+ /// whitespace.
+ bool _isJustBeforeWhitespace(int end) =>
+ end >= sourceText.length || _isWhitespaceRange(end, end + 1);
/// Determines if the characters between [offset] and [end] in the source text
/// are all whitespace characters.
@@ -1351,10 +1389,12 @@
// that we're left with just `()`, `{}`, or `[]`.
var candidateFirstRemovalOffset =
planner._backAcrossWhitespace(firstRemovalOffset, node.offset);
- if (planner._isJustAfterOpener(candidateFirstRemovalOffset)) {
+ if (planner
+ ._isJustAfter(candidateFirstRemovalOffset, const ['(', '[', '{'])) {
var candidateLastRemovalEnd =
planner._forwardAcrossWhitespace(lastRemovalEnd, node.end);
- if (planner._isJustBeforeCloser(candidateLastRemovalEnd)) {
+ if (planner
+ ._isJustBefore(candidateLastRemovalEnd, const [')', ']', '}'])) {
firstRemovalOffset = candidateFirstRemovalOffset;
lastRemovalEnd = candidateLastRemovalEnd;
}
diff --git a/pkg/nnbd_migration/lib/src/fix_aggregator.dart b/pkg/nnbd_migration/lib/src/fix_aggregator.dart
index da7b040..0873973 100644
--- a/pkg/nnbd_migration/lib/src/fix_aggregator.dart
+++ b/pkg/nnbd_migration/lib/src/fix_aggregator.dart
@@ -33,7 +33,9 @@
/// refers to it.
final Map<LibraryElement, String> _importPrefixes = {};
- FixAggregator._(this.planner, this._changes,
+ final bool _warnOnWeakCode;
+
+ FixAggregator._(this.planner, this._changes, this._warnOnWeakCode,
CompilationUnitElement compilationUnitElement) {
for (var importElement in compilationUnitElement.library.imports) {
// TODO(paulberry): the `??=` should ensure that if there are two imports,
@@ -175,10 +177,11 @@
/// Runs the [FixAggregator] on a [unit] and returns the resulting edits.
static Map<int, List<AtomicEdit>> run(
CompilationUnit unit, String sourceText, Map<AstNode, NodeChange> changes,
- {bool removeViaComments: false}) {
+ {bool removeViaComments = true, bool warnOnWeakCode = false}) {
var planner = EditPlanner(unit.lineInfo, sourceText,
removeViaComments: removeViaComments);
- var aggregator = FixAggregator._(planner, changes, unit.declaredElement);
+ var aggregator =
+ FixAggregator._(planner, changes, warnOnWeakCode, unit.declaredElement);
unit.accept(aggregator);
if (aggregator._plans.isEmpty) return {};
EditPlan plan;
@@ -313,9 +316,27 @@
/// If dead code removal is warranted for [node], returns an [EditPlan] that
/// removes the dead code (and performs appropriate updates within any
/// descendant AST nodes that remain). Otherwise returns `null`.
- EditPlan _applyConditional(
- N node, FixAggregator aggregator, AstNode thenNode, AstNode elseNode) {
+ EditPlan _applyConditional(N node, FixAggregator aggregator,
+ AstNode conditionNode, AstNode thenNode, AstNode elseNode) {
if (conditionValue == null) return null;
+ if (aggregator._warnOnWeakCode) {
+ List<EditPlan> innerPlans = [];
+ var conditionPlan = aggregator.innerPlanForNode(conditionNode);
+ var info = AtomicEditInfo(
+ conditionValue
+ ? NullabilityFixDescription.conditionTrueInStrongMode
+ : NullabilityFixDescription.conditionFalseInStrongMode,
+ {FixReasonTarget.root: conditionReason});
+ var commentedConditionPlan = aggregator.planner.addCommentPostfix(
+ conditionPlan, '/* == $conditionValue */',
+ info: info, isInformative: true);
+ innerPlans.add(commentedConditionPlan);
+ innerPlans.addAll(aggregator.innerPlansForNode(thenNode));
+ if (elseNode != null) {
+ innerPlans.addAll(aggregator.innerPlansForNode(elseNode));
+ }
+ return aggregator.planner.passThrough(node, innerPlans: innerPlans);
+ }
AstNode nodeToKeep;
NullabilityFixDescription descriptionBefore, descriptionAfter;
if (conditionValue) {
@@ -385,8 +406,8 @@
with NodeChangeForConditional {
@override
EditPlan _apply(ConditionalExpression node, FixAggregator aggregator) {
- return _applyConditional(
- node, aggregator, node.thenExpression, node.elseExpression) ??
+ return _applyConditional(node, aggregator, node.condition,
+ node.thenExpression, node.elseExpression) ??
super._apply(node, aggregator);
}
}
@@ -497,8 +518,8 @@
@override
EditPlan _apply(IfElement node, FixAggregator aggregator) {
- return _applyConditional(
- node, aggregator, node.thenElement, node.elseElement) ??
+ return _applyConditional(node, aggregator, node.condition, node.thenElement,
+ node.elseElement) ??
aggregator.innerPlanForNode(node);
}
}
@@ -511,8 +532,8 @@
@override
EditPlan _apply(IfStatement node, FixAggregator aggregator) {
- return _applyConditional(
- node, aggregator, node.thenStatement, node.elseStatement) ??
+ return _applyConditional(node, aggregator, node.condition,
+ node.thenStatement, node.elseStatement) ??
aggregator.innerPlanForNode(node);
}
}
@@ -555,9 +576,12 @@
/// Otherwise returns `null`.
EditPlan _applyNullAware(N node, FixAggregator aggregator) {
if (!removeNullAwareness) return null;
+ var description = aggregator._warnOnWeakCode
+ ? NullabilityFixDescription.nullAwarenessUnnecessaryInStrongMode
+ : NullabilityFixDescription.removeNullAwareness;
return aggregator.planner.removeNullAwareness(node,
- info: AtomicEditInfo(
- NullabilityFixDescription.removeNullAwareness, const {}));
+ info: AtomicEditInfo(description, const {}),
+ isInformative: aggregator._warnOnWeakCode);
}
}
diff --git a/pkg/nnbd_migration/lib/src/nullability_migration_impl.dart b/pkg/nnbd_migration/lib/src/nullability_migration_impl.dart
index 38e69fe..ae087d2 100644
--- a/pkg/nnbd_migration/lib/src/nullability_migration_impl.dart
+++ b/pkg/nnbd_migration/lib/src/nullability_migration_impl.dart
@@ -47,6 +47,8 @@
/// code that is removed.
final bool removeViaComments;
+ final bool warnOnWeakCode;
+
final _decoratedTypeParameterBounds = DecoratedTypeParameterBounds();
/// If not `null`, the object that will be used to write out post-mortem
@@ -61,17 +63,22 @@
/// complete. TODO(paulberry): remove this mode once the migration algorithm
/// is fully implemented.
///
- /// Optional parameter [removeViaComments] indicates whether dead code should
- /// be removed in its entirety (the default) or removed by commenting it out.
+ /// Optional parameter [removeViaComments] indicates whether code that the
+ /// migration tool wishes to remove should instead be commenting it out.
+ ///
+ /// Optional parameter [warnOnWeakCode] indicates whether weak-only code
+ /// should be warned about or removed (in the way specified by
+ /// [removeViaComments]).
NullabilityMigrationImpl(NullabilityMigrationListener listener,
{bool permissive: false,
NullabilityMigrationInstrumentation instrumentation,
- bool removeViaComments = true})
+ bool removeViaComments = true,
+ bool warnOnWeakCode = true})
: this._(listener, NullabilityGraph(instrumentation: instrumentation),
- permissive, instrumentation, removeViaComments);
+ permissive, instrumentation, removeViaComments, warnOnWeakCode);
NullabilityMigrationImpl._(this.listener, this._graph, this._permissive,
- this._instrumentation, this.removeViaComments) {
+ this._instrumentation, this.removeViaComments, this.warnOnWeakCode) {
_instrumentation?.immutableNodes(_graph.never, _graph.always);
_postmortemFileWriter?.graph = _graph;
}
@@ -106,7 +113,7 @@
DecoratedTypeParameterBounds.current = null;
}
var changes = FixAggregator.run(unit, result.content, fixBuilder.changes,
- removeViaComments: removeViaComments);
+ removeViaComments: removeViaComments, warnOnWeakCode: warnOnWeakCode);
_instrumentation?.changes(source, changes);
final lineInfo = LineInfo.fromContent(source.contents.data);
var offsets = changes.keys.toList();
diff --git a/pkg/nnbd_migration/test/api_test.dart b/pkg/nnbd_migration/test/api_test.dart
index e4d7a54..92b2de1 100644
--- a/pkg/nnbd_migration/test/api_test.dart
+++ b/pkg/nnbd_migration/test/api_test.dart
@@ -50,7 +50,9 @@
}
var listener = new TestMigrationListener();
var migration = NullabilityMigration(listener,
- permissive: _usePermissiveMode, removeViaComments: removeViaComments);
+ permissive: _usePermissiveMode,
+ removeViaComments: removeViaComments,
+ warnOnWeakCode: false);
for (var path in input.keys) {
if (!(await session.getFile(path)).isPart) {
for (var unit in (await session.getResolvedLibrary(path)).units) {
@@ -528,6 +530,28 @@
await _checkSingleFileChanges(content, expected);
}
+ @FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/41551')
+ Future<void> test_conditional_expression_guard_subexpression() async {
+ var content = '''
+void f(String s, int x) {
+ s == null ? (x = null) : (x = s.length);
+}
+''';
+ var expected = '''
+void f(String s, int x) {
+ s == null ? (x = null!) : (x = s.length);
+}
+''';
+ await _checkSingleFileChanges(content, expected);
+ }
+
+ @FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/41551')
+ Future<void> test_conditional_expression_guard_value() async {
+ var content = 'int f(String s) => s == null ? null : s.length;';
+ var expected = 'int f(String s) => s == null ? null! : s.length;';
+ await _checkSingleFileChanges(content, expected);
+ }
+
Future<void>
test_conditional_non_null_usage_does_not_imply_non_null_intent() async {
var content = '''
diff --git a/pkg/nnbd_migration/test/edit_plan_test.dart b/pkg/nnbd_migration/test/edit_plan_test.dart
index 99c9b49..1f9ccfa 100644
--- a/pkg/nnbd_migration/test/edit_plan_test.dart
+++ b/pkg/nnbd_migration/test/edit_plan_test.dart
@@ -242,6 +242,38 @@
'f(x) => x = () => null;');
}
+ Future<void> test_addCommentPostfix_before_closer() async {
+ await analyze('f(g) => g(0);');
+ checkPlan(
+ planner.addCommentPostfix(
+ planner.passThrough(findNode.integerLiteral('0')), '/* zero */'),
+ 'f(g) => g(0 /* zero */);');
+ }
+
+ Future<void> test_addCommentPostfix_before_other() async {
+ await analyze('f() => 0.isEven;');
+ checkPlan(
+ planner.addCommentPostfix(
+ planner.passThrough(findNode.integerLiteral('0')), '/* zero */'),
+ 'f() => 0 /* zero */ .isEven;');
+ }
+
+ Future<void> test_addCommentPostfix_before_semicolon() async {
+ await analyze('f() => 0;');
+ checkPlan(
+ planner.addCommentPostfix(
+ planner.passThrough(findNode.integerLiteral('0')), '/* zero */'),
+ 'f() => 0 /* zero */;');
+ }
+
+ Future<void> test_addCommentPostfix_before_space() async {
+ await analyze('f() => 0 + 1;');
+ checkPlan(
+ planner.addCommentPostfix(
+ planner.passThrough(findNode.integerLiteral('0')), '/* zero */'),
+ 'f() => 0 /* zero */ + 1;');
+ }
+
Future<void> test_addUnaryPostfix_inner_precedence_add_parens() async {
await analyze('f(x) => -x;');
checkPlan(
diff --git a/pkg/nnbd_migration/test/fix_aggregator_test.dart b/pkg/nnbd_migration/test/fix_aggregator_test.dart
index 8b15727..f3e3447 100644
--- a/pkg/nnbd_migration/test/fix_aggregator_test.dart
+++ b/pkg/nnbd_migration/test/fix_aggregator_test.dart
@@ -1114,6 +1114,58 @@
});
expect(previewInfo.applyTo(code), 'int x = 0;');
}
+
+ Future<void> test_warnOnDeadIf_false() async {
+ await analyze('''
+f(int i) {
+ if (i == null) print(i);
+}
+''');
+ var previewInfo = run({
+ findNode.statement('if'): NodeChangeForIfStatement()
+ ..conditionValue = false
+ }, warnOnWeakCode: true);
+ expect(previewInfo.applyTo(code, includeInformative: true), '''
+f(int i) {
+ if (i == null /* == false */) print(i);
+}
+''');
+ }
+
+ Future<void> test_warnOnDeadIf_true() async {
+ await analyze('''
+f(int i) {
+ if (i != null) print(i);
+}
+''');
+ var previewInfo = run({
+ findNode.statement('if'): NodeChangeForIfStatement()
+ ..conditionValue = true
+ }, warnOnWeakCode: true);
+ expect(previewInfo.applyTo(code, includeInformative: true), '''
+f(int i) {
+ if (i != null /* == true */) print(i);
+}
+''');
+ }
+
+ Future<void> test_warnOnNullAwareAccess() async {
+ var content = '''
+f(int i) {
+ print(i?.isEven);
+}
+''';
+ await analyze(content);
+ var previewInfo = run({
+ findNode.propertyAccess('?.'): NodeChangeForPropertyAccess()
+ ..removeNullAwareness = true
+ }, warnOnWeakCode: true);
+ expect(previewInfo.applyTo(code), content);
+ expect(previewInfo, hasLength(1));
+ var edit = previewInfo[content.indexOf('?')].single;
+ expect(edit.isInformative, isTrue);
+ expect(edit.length, '?'.length);
+ }
}
class FixAggregatorTestBase extends AbstractSingleUnitTest {
@@ -1125,9 +1177,9 @@
}
Map<int, List<AtomicEdit>> run(Map<AstNode, NodeChange> changes,
- {bool removeViaComments: false}) {
+ {bool removeViaComments = false, bool warnOnWeakCode = false}) {
return FixAggregator.run(testUnit, testCode, changes,
- removeViaComments: removeViaComments);
+ removeViaComments: removeViaComments, warnOnWeakCode: warnOnWeakCode);
}
}
diff --git a/pkg/nnbd_migration/test/instrumentation_test.dart b/pkg/nnbd_migration/test/instrumentation_test.dart
index 67cce5e..24433c5 100644
--- a/pkg/nnbd_migration/test/instrumentation_test.dart
+++ b/pkg/nnbd_migration/test/instrumentation_test.dart
@@ -133,13 +133,15 @@
Source source;
- Future<void> analyze(String content, {bool removeViaComments = false}) async {
+ Future<void> analyze(String content,
+ {bool removeViaComments = false, bool warnOnWeakCode = true}) async {
var sourcePath = convertPath('/home/test/lib/test.dart');
newFile(sourcePath, content: content);
var listener = new TestMigrationListener();
var migration = NullabilityMigration(listener,
instrumentation: _InstrumentationClient(this),
- removeViaComments: removeViaComments);
+ removeViaComments: removeViaComments,
+ warnOnWeakCode: warnOnWeakCode);
var result = await session.getResolvedUnit(sourcePath);
source = result.unit.declaredElement.source;
findNode = FindNode(content, result.unit);
@@ -251,7 +253,7 @@
}
}
''';
- await analyze(content);
+ await analyze(content, warnOnWeakCode: false);
var intAnnotation = findNode.typeAnnotation('int');
var commentPos = content.indexOf('/*');
var ifPos = content.indexOf('if');
@@ -274,7 +276,7 @@
if (i != null) return i;
}
''';
- await analyze(content);
+ await analyze(content, warnOnWeakCode: false);
var intAnnotation = findNode.typeAnnotation('int');
var commentPos = content.indexOf('/*');
var ifPos = content.indexOf('if');
@@ -296,7 +298,7 @@
}
}
''';
- await analyze(content);
+ await analyze(content, warnOnWeakCode: false);
var intAnnotation = findNode.typeAnnotation('int');
var commentPos = content.indexOf('/*');
var ifPos = content.indexOf('if');
@@ -321,7 +323,7 @@
}
}
''';
- await analyze(content);
+ await analyze(content, warnOnWeakCode: false);
var intAnnotation = findNode.typeAnnotation('int');
var commentPos = content.indexOf('/*');
var bodyPos = content.indexOf('i) {') + 4;
@@ -343,7 +345,7 @@
}
}
''';
- await analyze(content);
+ await analyze(content, warnOnWeakCode: false);
var intAnnotation = findNode.typeAnnotation('int');
var commentPos = content.indexOf('/*');
var ifPos = content.indexOf('if');
@@ -368,7 +370,7 @@
}
}
''';
- await analyze(content);
+ await analyze(content, warnOnWeakCode: false);
var intAnnotation = findNode.typeAnnotation('int');
var commentPos = content.indexOf('/*');
var bodyPos = content.indexOf('i) {') + 4;
@@ -432,7 +434,7 @@
Future<void> test_fix_reason_remove_question_from_question_dot() async {
var content = '_f(int/*!*/ i) => i?.isEven;';
- await analyze(content);
+ await analyze(content, warnOnWeakCode: false);
var commentPos = content.indexOf('/*');
var questionDotPos = content.indexOf('?.');
expect(changes.keys, unorderedEquals([commentPos, questionDotPos]));
@@ -444,7 +446,7 @@
Future<void>
test_fix_reason_remove_question_from_question_dot_method() async {
var content = '_f(int/*!*/ i) => i?.abs();';
- await analyze(content);
+ await analyze(content, warnOnWeakCode: false);
var commentPos = content.indexOf('/*');
var questionDotPos = content.indexOf('?.');
expect(changes.keys, unorderedEquals([commentPos, questionDotPos]));
diff --git a/pkg/test_runner/lib/src/test_suite.dart b/pkg/test_runner/lib/src/test_suite.dart
index b0cb187..6ac30e0 100644
--- a/pkg/test_runner/lib/src/test_suite.dart
+++ b/pkg/test_runner/lib/src/test_suite.dart
@@ -583,6 +583,8 @@
_enqueueStandardTest(testFile, expectationSet, onTest);
} else if (configuration.runtime.isBrowser) {
_enqueueBrowserTest(testFile, expectationSet, onTest);
+ } else if (suiteName == 'service') {
+ _enqueueServiceTest(testFile, expectationSet, onTest);
} else {
_enqueueStandardTest(testFile, expectationSet, onTest);
}
@@ -616,6 +618,45 @@
}
}
+ void _enqueueServiceTest(
+ TestFile testFile, Set<Expectation> expectations, TestCaseEvent onTest) {
+ var commonArguments = _commonArgumentsFromFile(testFile);
+
+ var vmOptionsList = getVmOptions(testFile);
+ assert(!vmOptionsList.isEmpty);
+
+ bool emitDdsTest = false;
+ for (int i = 0; i < 2; ++i) {
+ for (var vmOptionsVariant = 0;
+ vmOptionsVariant < vmOptionsList.length;
+ vmOptionsVariant++) {
+ var vmOptions = vmOptionsList[vmOptionsVariant];
+ var allVmOptions = vmOptions;
+ if (!extraVmOptions.isEmpty) {
+ allVmOptions = vmOptions.toList()..addAll(extraVmOptions);
+ }
+ if (emitDdsTest) {
+ allVmOptions.add('-DUSE_DDS=true');
+ }
+ var isCrashExpected = expectations.contains(Expectation.crash);
+ var commands = _makeCommands(
+ testFile,
+ vmOptionsVariant + (vmOptionsList.length * i),
+ allVmOptions,
+ commonArguments,
+ isCrashExpected);
+ var variantTestName =
+ testFile.name + '/${emitDdsTest ? 'dds' : 'service'}';
+ if (vmOptionsList.length > 1) {
+ variantTestName = "${testFile.name}_$vmOptionsVariant";
+ }
+
+ _addTestCase(testFile, variantTestName, commands, expectations, onTest);
+ }
+ emitDdsTest = true;
+ }
+ }
+
List<Command> _makeCommands(TestFile testFile, int vmOptionsVariant,
List<String> vmOptions, List<String> args, bool isCrashExpected) {
var commands = <Command>[];
diff --git a/pkg/vm_service/CHANGELOG.md b/pkg/vm_service/CHANGELOG.md
index 39645a7..292e393 100644
--- a/pkg/vm_service/CHANGELOG.md
+++ b/pkg/vm_service/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## Unreleased
+- Fixed issue where RPC format did not conform to the JSON-RPC 2.0
+ specification.
+
## 4.0.1
- Improved documentation.
- Fixed analysis issues.
diff --git a/pkg/vm_service/lib/src/vm_service.dart b/pkg/vm_service/lib/src/vm_service.dart
index 03d939e..a766007 100644
--- a/pkg/vm_service/lib/src/vm_service.dart
+++ b/pkg/vm_service/lib/src/vm_service.dart
@@ -1955,13 +1955,17 @@
Future get onDone => _onDoneCompleter.future;
- Future<T> _call<T>(String method, [Map args]) {
+ Future<T> _call<T>(String method, [Map args = const {}]) {
String id = '${++_id}';
Completer<T> completer = Completer<T>();
_completers[id] = completer;
_methodCalls[id] = method;
- Map m = {'id': id, 'method': method};
- if (args != null) m['params'] = args;
+ Map m = {
+ 'jsonrpc': '2.0',
+ 'id': id,
+ 'method': method,
+ 'params': args,
+ };
String message = jsonEncode(m);
_onSend.add(message);
_writeMessage(message);
diff --git a/pkg/vm_service/tool/dart/generate_dart.dart b/pkg/vm_service/tool/dart/generate_dart.dart
index 0e85f27..b85bc8c 100644
--- a/pkg/vm_service/tool/dart/generate_dart.dart
+++ b/pkg/vm_service/tool/dart/generate_dart.dart
@@ -118,13 +118,12 @@
Future get onDone => _onDoneCompleter.future;
- Future<T> _call<T>(String method, [Map args]) {
+ Future<T> _call<T>(String method, [Map args = const {}]) {
String id = '${++_id}';
Completer<T> completer = Completer<T>();
_completers[id] = completer;
_methodCalls[id] = method;
- Map m = {'id': id, 'method': method};
- if (args != null) m['params'] = args;
+ Map m = {'jsonrpc': '2.0', 'id': id, 'method': method, 'params': args,};
String message = jsonEncode(m);
_onSend.add(message);
_writeMessage(message);
diff --git a/runtime/observatory/lib/service_common.dart b/runtime/observatory/lib/service_common.dart
index 66ff984..48181ff 100644
--- a/runtime/observatory/lib/service_common.dart
+++ b/runtime/observatory/lib/service_common.dart
@@ -318,8 +318,12 @@
'params': {'id': serial, 'query': request.method}
});
} else {
- message = json.encode(
- {'id': serial, 'method': request.method, 'params': request.params});
+ message = json.encode({
+ 'jsonrpc': '2.0',
+ 'id': serial,
+ 'method': request.method,
+ 'params': request.params
+ });
}
if (request.method != 'getTagProfile' &&
request.method != 'getIsolateMetric' &&
diff --git a/runtime/observatory/tests/service/break_on_default_constructor_test.dart b/runtime/observatory/tests/service/break_on_default_constructor_test.dart
index bc504c74..d968ca2 100644
--- a/runtime/observatory/tests/service/break_on_default_constructor_test.dart
+++ b/runtime/observatory/tests/service/break_on_default_constructor_test.dart
@@ -66,7 +66,7 @@
fail("Expected to find function");
}
- isolate.resume();
+ await isolate.resume();
}
];
diff --git a/runtime/observatory/tests/service/client_name_rpc_test.dart b/runtime/observatory/tests/service/client_name_rpc_test.dart
index 41cbe4f..fa20430 100644
--- a/runtime/observatory/tests/service/client_name_rpc_test.dart
+++ b/runtime/observatory/tests/service/client_name_rpc_test.dart
@@ -63,4 +63,9 @@
},
];
-main(args) async => runVMTests(args, tests);
+main(args) async => runVMTests(
+ args,
+ tests,
+ // TODO(bkonyi): client names are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/client_resume_approvals_approve_then_disconnect_test.dart b/runtime/observatory/tests/service/client_resume_approvals_approve_then_disconnect_test.dart
index 427706f..462e3dc4 100644
--- a/runtime/observatory/tests/service/client_resume_approvals_approve_then_disconnect_test.dart
+++ b/runtime/observatory/tests/service/client_resume_approvals_approve_then_disconnect_test.dart
@@ -60,5 +60,12 @@
hasStoppedAtExit,
];
-Future<void> main(args) => runIsolateTests(args, test,
- testeeConcurrent: fooBar, pause_on_start: true, pause_on_exit: true);
+Future<void> main(args) => runIsolateTests(
+ args,
+ test,
+ testeeConcurrent: fooBar,
+ pause_on_start: true,
+ pause_on_exit: true,
+ // TODO(bkonyi): client names are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/client_resume_approvals_disconnect_test.dart b/runtime/observatory/tests/service/client_resume_approvals_disconnect_test.dart
index 9d23522..50c5d34 100644
--- a/runtime/observatory/tests/service/client_resume_approvals_disconnect_test.dart
+++ b/runtime/observatory/tests/service/client_resume_approvals_disconnect_test.dart
@@ -58,5 +58,12 @@
hasStoppedAtExit,
];
-Future<void> main(args) => runIsolateTests(args, test,
- testeeConcurrent: fooBar, pause_on_start: true, pause_on_exit: true);
+Future<void> main(args) => runIsolateTests(
+ args,
+ test,
+ testeeConcurrent: fooBar,
+ pause_on_start: true,
+ pause_on_exit: true,
+ // TODO(bkonyi): client names are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/client_resume_approvals_identical_names_test.dart b/runtime/observatory/tests/service/client_resume_approvals_identical_names_test.dart
index d3a09a9..27e026c 100644
--- a/runtime/observatory/tests/service/client_resume_approvals_identical_names_test.dart
+++ b/runtime/observatory/tests/service/client_resume_approvals_identical_names_test.dart
@@ -40,5 +40,12 @@
hasStoppedAtExit,
];
-Future<void> main(args) => runIsolateTests(args, sameClientNamesTest,
- testeeConcurrent: fooBar, pause_on_start: true, pause_on_exit: true);
+Future<void> main(args) => runIsolateTests(
+ args,
+ sameClientNamesTest,
+ testeeConcurrent: fooBar,
+ pause_on_start: true,
+ pause_on_exit: true,
+ // TODO(bkonyi): client names are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/client_resume_approvals_multiple_names_test.dart b/runtime/observatory/tests/service/client_resume_approvals_multiple_names_test.dart
index 5f26a9c..e92442c 100644
--- a/runtime/observatory/tests/service/client_resume_approvals_multiple_names_test.dart
+++ b/runtime/observatory/tests/service/client_resume_approvals_multiple_names_test.dart
@@ -58,5 +58,12 @@
},
];
-Future<void> main(args) => runIsolateTests(args, multipleClientNamesTest,
- testeeConcurrent: fooBar, pause_on_start: true, pause_on_exit: true);
+Future<void> main(args) => runIsolateTests(
+ args,
+ multipleClientNamesTest,
+ testeeConcurrent: fooBar,
+ pause_on_start: true,
+ pause_on_exit: true,
+ // TODO(bkonyi): client names are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/client_resume_approvals_name_change_test.dart b/runtime/observatory/tests/service/client_resume_approvals_name_change_test.dart
index 3d33112..b20a593 100644
--- a/runtime/observatory/tests/service/client_resume_approvals_name_change_test.dart
+++ b/runtime/observatory/tests/service/client_resume_approvals_name_change_test.dart
@@ -51,5 +51,12 @@
hasStoppedAtExit,
];
-Future<void> main(args) => runIsolateTests(args, nameChangeTest,
- testeeConcurrent: fooBar, pause_on_start: true, pause_on_exit: true);
+Future<void> main(args) => runIsolateTests(
+ args,
+ nameChangeTest,
+ testeeConcurrent: fooBar,
+ pause_on_start: true,
+ pause_on_exit: true,
+ // TODO(bkonyi): client names are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/client_resume_approvals_reload_test.dart b/runtime/observatory/tests/service/client_resume_approvals_reload_test.dart
index 250d349..50f7f45 100644
--- a/runtime/observatory/tests/service/client_resume_approvals_reload_test.dart
+++ b/runtime/observatory/tests/service/client_resume_approvals_reload_test.dart
@@ -60,5 +60,11 @@
},
];
-Future<void> main(args) => runIsolateTests(args, hotReloadTest,
- testeeConcurrent: fooBar, pause_on_start: true);
+Future<void> main(args) => runIsolateTests(
+ args,
+ hotReloadTest,
+ testeeConcurrent: fooBar,
+ pause_on_start: true,
+ // TODO(bkonyi): client names are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/enable_service_port_fallback_positive_test.dart b/runtime/observatory/tests/service/enable_service_port_fallback_positive_test.dart
index ca25d5f..bbac574 100644
--- a/runtime/observatory/tests/service/enable_service_port_fallback_positive_test.dart
+++ b/runtime/observatory/tests/service/enable_service_port_fallback_positive_test.dart
@@ -21,11 +21,15 @@
main(args) async {
selectedPort = await _getUnusedPort();
- await runVMTests(args, tests,
- enable_service_port_fallback: true,
- // Choose a port number that should always be open.
- port: selectedPort,
- extraArgs: []);
+ await runVMTests(
+ args, tests,
+ enable_service_port_fallback: true,
+ // Choose a port number that should always be open.
+ port: selectedPort,
+ extraArgs: [],
+ // TODO(bkonyi): investigate failure.
+ enableDds: false,
+ );
}
Future<int> _getUnusedPort() async {
diff --git a/runtime/observatory/tests/service/external_service_asynchronous_invocation_test.dart b/runtime/observatory/tests/service/external_service_asynchronous_invocation_test.dart
index 2778167..58d44de 100644
--- a/runtime/observatory/tests/service/external_service_asynchronous_invocation_test.dart
+++ b/runtime/observatory/tests/service/external_service_asynchronous_invocation_test.dart
@@ -164,4 +164,8 @@
},
];
-main(args) => runIsolateTests(args, tests);
+main(args) => runIsolateTests(
+ args, tests,
+ // TODO(bkonyi): service extensions are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/external_service_disappear_test.dart b/runtime/observatory/tests/service/external_service_disappear_test.dart
index eafe5a6..a015686 100644
--- a/runtime/observatory/tests/service/external_service_disappear_test.dart
+++ b/runtime/observatory/tests/service/external_service_disappear_test.dart
@@ -89,4 +89,8 @@
},
];
-main(args) => runIsolateTests(args, tests);
+main(args) => runIsolateTests(
+ args, tests,
+ // TODO(bkonyi): service extensions are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/external_service_notification_invocation_test.dart b/runtime/observatory/tests/service/external_service_notification_invocation_test.dart
index 3b1e695..a5bfd64 100644
--- a/runtime/observatory/tests/service/external_service_notification_invocation_test.dart
+++ b/runtime/observatory/tests/service/external_service_notification_invocation_test.dart
@@ -83,4 +83,9 @@
},
];
-main(args) => runIsolateTests(args, tests);
+main(args) => runIsolateTests(
+ args,
+ tests,
+ // TODO(bkonyi): service extensions are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/external_service_registration_test.dart b/runtime/observatory/tests/service/external_service_registration_test.dart
index 2ec0d95..ce0aea9 100644
--- a/runtime/observatory/tests/service/external_service_registration_test.dart
+++ b/runtime/observatory/tests/service/external_service_registration_test.dart
@@ -123,4 +123,9 @@
},
];
-main(args) => runIsolateTests(args, tests);
+main(args) => runIsolateTests(
+ args,
+ tests,
+ // TODO(bkonyi): service extensions are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/external_service_registration_via_notification_test.dart b/runtime/observatory/tests/service/external_service_registration_via_notification_test.dart
index 333c24e..80729ce 100644
--- a/runtime/observatory/tests/service/external_service_registration_via_notification_test.dart
+++ b/runtime/observatory/tests/service/external_service_registration_via_notification_test.dart
@@ -103,4 +103,8 @@
},
];
-main(args) => runIsolateTests(args, tests);
+main(args) => runIsolateTests(
+ args, tests,
+ // TODO(bkonyi): service extensions are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/external_service_synchronous_invocation_test.dart b/runtime/observatory/tests/service/external_service_synchronous_invocation_test.dart
index 97917b3..45c58d8 100644
--- a/runtime/observatory/tests/service/external_service_synchronous_invocation_test.dart
+++ b/runtime/observatory/tests/service/external_service_synchronous_invocation_test.dart
@@ -126,4 +126,8 @@
},
];
-main(args) => runIsolateTests(args, tests);
+main(args) => runIsolateTests(
+ args, tests,
+ // TODO(bkonyi): service extensions are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/get_client_name_rpc_test.dart b/runtime/observatory/tests/service/get_client_name_rpc_test.dart
index d503a91..33f2c21 100644
--- a/runtime/observatory/tests/service/get_client_name_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_client_name_rpc_test.dart
@@ -37,4 +37,10 @@
},
];
-Future<void> main(args) => runIsolateTests(args, test, testeeBefore: fooBar);
+Future<void> main(args) => runIsolateTests(
+ args,
+ test,
+ testeeBefore: fooBar,
+ // TODO(bkonyi): client names are not yet supported in DDS.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/malformed_test.dart b/runtime/observatory/tests/service/malformed_test.dart
index 5fff3fd..9e277c8 100644
--- a/runtime/observatory/tests/service/malformed_test.dart
+++ b/runtime/observatory/tests/service/malformed_test.dart
@@ -37,4 +37,11 @@
},
];
-main(args) => runIsolateTests(args, tests);
+main(args) => runIsolateTests(
+ args,
+ tests,
+ // This test hangs with DDS as package:json_rpc_2 can't parse the JSON
+ // response and is unable to determine the request ID, so the malformed
+ // JSON request will never complete.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/network_profiling_test.dart b/runtime/observatory/tests/service/network_profiling_test.dart
index c02b278..4da5995 100644
--- a/runtime/observatory/tests/service/network_profiling_test.dart
+++ b/runtime/observatory/tests/service/network_profiling_test.dart
@@ -7,8 +7,11 @@
import 'dart:developer';
import 'dart:io' as io;
import 'dart:isolate';
+
+import 'package:expect/expect.dart';
import 'package:observatory/service_io.dart';
import 'package:test/test.dart';
+
import 'service_test_common.dart';
import 'test_helper.dart';
@@ -115,6 +118,9 @@
expect(stats.length, 3);
stats.forEach((socket) {
expect(socket['address'], contains(localhost));
+ Expect.type<int>(socket['startTime']);
+ Expect.type<int>(socket['id']);
+ Expect.type<int>(socket['port']);
if (socket['socketType'] == 'tcp') {
expect(socket['writeBytes'], content.length);
expect(socket.containsKey('lastWriteTime'), true);
diff --git a/runtime/observatory/tests/service/observatory_assets_test.dart b/runtime/observatory/tests/service/observatory_assets_test.dart
index 4b8f8e2..a78f448 100644
--- a/runtime/observatory/tests/service/observatory_assets_test.dart
+++ b/runtime/observatory/tests/service/observatory_assets_test.dart
@@ -22,4 +22,8 @@
}
];
-main(args) async => runVMTests(args, tests);
+main(args) async => runVMTests(
+ args, tests,
+ // TODO(bkonyi): DDS doesn't forward Observatory assets properly yet.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/pause_on_start_and_exit_with_child_test.dart b/runtime/observatory/tests/service/pause_on_start_and_exit_with_child_test.dart
index 1d3a8bf..cb4b288 100644
--- a/runtime/observatory/tests/service/pause_on_start_and_exit_with_child_test.dart
+++ b/runtime/observatory/tests/service/pause_on_start_and_exit_with_child_test.dart
@@ -101,12 +101,16 @@
},
];
-main(args) => runIsolateTests(args, tests,
- testeeConcurrent: testMain,
- pause_on_start: true,
- pause_on_exit: true,
- verbose_vm: true,
- extraArgs: [
- '--trace-service',
- '--trace-service-verbose',
- ]);
+main(args) => runIsolateTests(
+ args, tests,
+ testeeConcurrent: testMain,
+ pause_on_start: true,
+ pause_on_exit: true,
+ verbose_vm: true,
+ extraArgs: [
+ '--trace-service',
+ '--trace-service-verbose',
+ ],
+ // TODO(bkonyi): investigate failure.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions2_test.dart b/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions2_test.dart
index 850177a..6f98284 100644
--- a/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions2_test.dart
+++ b/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions2_test.dart
@@ -61,7 +61,13 @@
}
];
-main(args) => runIsolateTests(args, tests,
- pause_on_unhandled_exceptions: true,
- testeeConcurrent: testeeMain,
- extraArgs: extraDebuggingArgs);
+main(args) => runIsolateTests(
+ args,
+ tests,
+ pause_on_unhandled_exceptions: true,
+ testeeConcurrent: testeeMain,
+ extraArgs: extraDebuggingArgs,
+ // TODO(bkonyi): causes ASSERT in debug mode, unrelated to DDS.
+ // See https://github.com/dart-lang/sdk/issues/41379.
+ enableDds: false,
+ );
diff --git a/runtime/observatory/tests/service/service.status b/runtime/observatory/tests/service/service.status
index 20cc72a..cf5797a 100644
--- a/runtime/observatory/tests/service/service.status
+++ b/runtime/observatory/tests/service/service.status
@@ -29,6 +29,7 @@
*: SkipByDesign
[ $system == windows ]
+*: Slow
async_generator_breakpoint_test: Skip # Issue 29145
dev_fs_http_put_weird_char_test: Skip # Windows disallows carriage returns in paths
dev_fs_weird_char_test: Skip # Windows disallows question mark in paths
diff --git a/runtime/observatory/tests/service/stream_subscription_test.dart b/runtime/observatory/tests/service/stream_subscription_test.dart
new file mode 100644
index 0000000..56f8420
--- /dev/null
+++ b/runtime/observatory/tests/service/stream_subscription_test.dart
@@ -0,0 +1,58 @@
+// Copyright (c) 2020, 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 'package:observatory/service_io.dart';
+import 'package:test/test.dart';
+
+import 'test_helper.dart';
+
+Future streamListen(VM vm, String streamId) async =>
+ await vm.invokeRpcNoUpgrade(
+ 'streamListen',
+ {
+ 'streamId': streamId,
+ },
+ );
+
+Future streamCancel(VM vm, String streamId) async =>
+ await vm.invokeRpcNoUpgrade(
+ 'streamCancel',
+ {
+ 'streamId': streamId,
+ },
+ );
+
+var tests = <VMTest>[
+ // Check double subscription fails.
+ (VM vm) async {
+ await streamListen(vm, '_Echo');
+ try {
+ await streamListen(vm, '_Echo');
+ fail('Subscribed to stream twice');
+ } on ServerRpcException catch (e) {
+ expect(e.message, 'Stream already subscribed');
+ }
+ },
+ // Check double cancellation fails.
+ (VM vm) async {
+ await streamCancel(vm, '_Echo');
+ try {
+ await streamCancel(vm, '_Echo');
+ fail('Double cancellation of stream successful');
+ } on ServerRpcException catch (e) {
+ expect(e.message, 'Stream not subscribed');
+ }
+ },
+ // Check subscription to invalid stream fails.
+ (VM vm) async {
+ try {
+ await streamListen(vm, 'Foo');
+ fail('Subscribed to invalid stream');
+ } on ServerRpcException catch (e) {
+ expect(e.message, "streamListen: invalid 'streamId' parameter: Foo");
+ }
+ }
+];
+
+main(args) => runVMTests(args, tests);
diff --git a/runtime/observatory/tests/service/test_helper.dart b/runtime/observatory/tests/service/test_helper.dart
index 1dd5989..b22294d 100644
--- a/runtime/observatory/tests/service/test_helper.dart
+++ b/runtime/observatory/tests/service/test_helper.dart
@@ -7,6 +7,7 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
+import 'package:dds/dds.dart';
import 'package:observatory/service_io.dart';
import 'package:test/test.dart';
import 'service_test_common.dart';
@@ -16,6 +17,9 @@
const bool useCausalAsyncStacks =
const bool.fromEnvironment('dart.developer.causal_async_stacks');
+/// Determines whether DDS is enabled for this test run.
+const bool useDds = const bool.fromEnvironment('USE_DDS');
+
/// The extra arguments to use
const List<String> extraDebuggingArgs = useCausalAsyncStacks
? const ['--causal-async-stacks', '--no-lazy-async-stacks']
@@ -97,6 +101,8 @@
class _ServiceTesteeLauncher {
Process process;
final List<String> args;
+ Future<void> get exited => _processCompleter.future;
+ final _processCompleter = Completer<void>();
bool killedByTester = false;
_ServiceTesteeLauncher() : args = [Platform.script.toFilePath()] {}
@@ -286,6 +292,7 @@
throw "Testee exited with $exitCode";
}
print("** Process exited");
+ _processCompleter.complete();
});
// Wait for the blank line which signals that we're ready to run.
@@ -295,9 +302,16 @@
}
final content = await serviceInfoFile.readAsString();
final infoJson = json.decode(content);
- uri = Uri.parse(infoJson['uri']);
+ String rawUri = infoJson['uri'];
+
+ // If rawUri ends with a /, Uri.parse will include an empty string as the
+ // last path segment. Make sure it's not there to ensure we have a
+ // consistent Uri.
+ if (rawUri.endsWith('/')) {
+ rawUri = rawUri.substring(0, rawUri.length - 1);
+ }
+ uri = Uri.parse(rawUri);
completer.complete(uri);
- print('** Signaled to run test queries on $uri');
});
return completer.future;
}
@@ -314,7 +328,7 @@
void setupAddresses(Uri serverAddress) {
serviceWebsocketAddress =
- 'ws://${serverAddress.authority}${serverAddress.path}ws';
+ 'ws://${serverAddress.authority}${serverAddress.path}/ws';
serviceHttpAddress = 'http://${serverAddress.authority}${serverAddress.path}';
}
@@ -331,78 +345,126 @@
bool pause_on_unhandled_exceptions: false,
bool enable_service_port_fallback: false,
bool testeeControlsServer: false,
+ bool enableDds: true,
int port = 0,
}) {
if (executableArgs == null) {
executableArgs = Platform.executableArguments;
}
-
- final process = new _ServiceTesteeLauncher();
- final name = Platform.script.pathSegments.last;
+ DartDevelopmentService dds;
WebSocketVM vm;
- setUp(() async {
- await process
- .launch(
- pause_on_start,
- pause_on_exit,
- pause_on_unhandled_exceptions,
- enable_service_port_fallback,
- testeeControlsServer,
- port,
- extraArgs,
- executableArgs)
- .then((Uri serverAddress) async {
- if (mainArgs.contains("--gdb")) {
- final pid = process.process.pid;
- final wait = new Duration(seconds: 10);
- print("Testee has pid $pid, waiting $wait before continuing");
- sleep(wait);
- }
- setupAddresses(serverAddress);
- vm = new WebSocketVM(new WebSocketVMTarget(serviceWebsocketAddress));
- print('Loading VM...');
- await vm.load();
- print('Done loading VM');
- });
- });
+ _ServiceTesteeLauncher process;
+ bool testsDone = false;
- test(
- name,
- () async {
- // Run vm tests.
- if (vmTests != null) {
- int testIndex = 1;
- final totalTests = vmTests.length;
- for (var test in vmTests) {
- vm.verbose = verbose_vm;
- print('Running $name [$testIndex/$totalTests]');
- testIndex++;
- await test(vm);
- }
+ ignoreLateException(Function f) async {
+ try {
+ await f();
+ } catch (error, stackTrace) {
+ if (testsDone) {
+ print('Ignoring late exception during process exit:\n'
+ '$error\n$stackTrace');
+ } else {
+ rethrow;
}
+ }
+ }
- // Run isolate tests.
- if (isolateTests != null) {
- final isolate = await getFirstIsolate(vm);
- int testIndex = 1;
- final totalTests = isolateTests.length;
- for (var test in isolateTests) {
- vm.verbose = verbose_vm;
- print('Running $name [$testIndex/$totalTests]');
- testIndex++;
- await test(isolate);
- }
- }
- },
- retry: 0,
- // Some service tests run fairly long (e.g., valid_source_locations_test).
- timeout: Timeout.none,
+ setUp(
+ () => ignoreLateException(
+ () async {
+ process = _ServiceTesteeLauncher();
+ await process
+ .launch(
+ pause_on_start,
+ pause_on_exit,
+ pause_on_unhandled_exceptions,
+ enable_service_port_fallback,
+ testeeControlsServer,
+ port,
+ extraArgs,
+ executableArgs)
+ .then((Uri serverAddress) async {
+ if (mainArgs.contains("--gdb")) {
+ final pid = process.process.pid;
+ final wait = new Duration(seconds: 10);
+ print("Testee has pid $pid, waiting $wait before continuing");
+ sleep(wait);
+ }
+ if (useDds) {
+ dds = await DartDevelopmentService.startDartDevelopmentService(
+ serverAddress);
+ setupAddresses(dds.uri);
+ } else {
+ setupAddresses(serverAddress);
+ }
+ print('** Signaled to run test queries on $serviceHttpAddress'
+ ' (${useDds ? "DDS" : "VM Service"})');
+ vm =
+ new WebSocketVM(new WebSocketVMTarget(serviceWebsocketAddress));
+ print('Loading VM...');
+ await vm.load();
+ print('Done loading VM');
+ });
+ },
+ ),
);
- tearDown(() {
- print('All service tests completed successfully.');
- process.requestExit();
- });
+ tearDown(
+ () => ignoreLateException(
+ () async {
+ if (useDds) {
+ await dds.shutdown();
+ }
+ process.requestExit();
+ },
+ ),
+ );
+
+ final name = Platform.script.pathSegments.last;
+ runTest(String name) {
+ test(
+ '$name (${useDds ? 'DDS' : 'VM Service'})',
+ () => ignoreLateException(
+ () async {
+ // Run vm tests.
+ if (vmTests != null) {
+ int testIndex = 1;
+ final totalTests = vmTests.length;
+ for (var test in vmTests) {
+ vm.verbose = verbose_vm;
+ print('Running $name [$testIndex/$totalTests]');
+ testIndex++;
+ await test(vm);
+ }
+ }
+
+ // Run isolate tests.
+ if (isolateTests != null) {
+ final isolate = await getFirstIsolate(vm);
+ int testIndex = 1;
+ final totalTests = isolateTests.length;
+ for (var test in isolateTests) {
+ vm.verbose = verbose_vm;
+ print('Running $name [$testIndex/$totalTests]');
+ testIndex++;
+ await test(isolate);
+ }
+ }
+
+ print('All service tests completed successfully.');
+ testsDone = true;
+ },
+ ),
+ // Some service tests run fairly long (e.g., valid_source_locations_test).
+ timeout: Timeout.none,
+ );
+ }
+
+ if (useDds && !enableDds) {
+ print('Skipping DDS run for $name');
+ } else {
+ runTest(name);
+ }
}
Future<Isolate> getFirstIsolate(WebSocketVM vm) async {
@@ -460,6 +522,7 @@
bool verbose_vm: false,
bool pause_on_unhandled_exceptions: false,
bool testeeControlsServer: false,
+ bool enableDds: true,
List<String> extraArgs}) async {
assert(!pause_on_start || testeeBefore == null);
if (_isTestee()) {
@@ -477,7 +540,8 @@
pause_on_exit: pause_on_exit,
verbose_vm: verbose_vm,
pause_on_unhandled_exceptions: pause_on_unhandled_exceptions,
- testeeControlsServer: testeeControlsServer);
+ testeeControlsServer: testeeControlsServer,
+ enableDds: enableDds);
}
}
@@ -529,6 +593,7 @@
bool verbose_vm: false,
bool pause_on_unhandled_exceptions: false,
bool enable_service_port_fallback: false,
+ bool enableDds: true,
int port = 0,
List<String> extraArgs,
List<String> executableArgs}) async {
@@ -549,6 +614,7 @@
verbose_vm: verbose_vm,
pause_on_unhandled_exceptions: pause_on_unhandled_exceptions,
enable_service_port_fallback: enable_service_port_fallback,
+ enableDds: enableDds,
port: port,
);
}
diff --git a/runtime/observatory/tests/service/verify_http_timeline_test.dart b/runtime/observatory/tests/service/verify_http_timeline_test.dart
index a555b11..22fae9b 100644
--- a/runtime/observatory/tests/service/verify_http_timeline_test.dart
+++ b/runtime/observatory/tests/service/verify_http_timeline_test.dart
@@ -62,7 +62,7 @@
}
Future<HttpServer> startServer() async {
- final server = await HttpServer.bind(InternetAddress.loopbackIPv4, 8011);
+ final server = await HttpServer.bind(InternetAddress.loopbackIPv4, 0);
server.listen((request) async {
final response = request.response;
randomlyAddCookie(response);
diff --git a/runtime/observatory/tests/service/vm_timeline_events_test.dart b/runtime/observatory/tests/service/vm_timeline_events_test.dart
index 1b77ed1..a47bcf2 100644
--- a/runtime/observatory/tests/service/vm_timeline_events_test.dart
+++ b/runtime/observatory/tests/service/vm_timeline_events_test.dart
@@ -9,10 +9,14 @@
import 'service_test_common.dart';
import 'test_helper.dart';
-primeDartTimeline() {
+primeDartTimeline() async {
while (true) {
Timeline.startSync('apple');
Timeline.finishSync();
+ // Give the VM a chance to send the timeline events. This test is
+ // significantly slower if we loop without yielding control after each
+ // iteration.
+ await Future.delayed(const Duration(milliseconds: 1));
}
}
@@ -22,8 +26,8 @@
return events.where(filter).toList();
}
-Completer completer = new Completer();
-int eventCount = 0;
+Completer completer;
+int eventCount;
onTimelineEvent(ServiceEvent event) {
eventCount++;
@@ -35,6 +39,11 @@
var tests = <IsolateTest>[
(Isolate isolate) async {
+ // Clear global state.
+ eventCount = 0;
+ completer = Completer<void>();
+ },
+ (Isolate isolate) async {
// Subscribe to the Timeline stream.
await subscribeToStream(isolate.vm, VM.kTimelineStream, onTimelineEvent);
},
diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn
index e3b2a7a..d7fe4a2 100644
--- a/runtime/vm/BUILD.gn
+++ b/runtime/vm/BUILD.gn
@@ -105,6 +105,16 @@
])
sources = rebase_path(compiler_sources, ".", "./compiler/")
include_dirs = [ ".." ]
+ if (is_fuchsia) {
+ if (using_fuchsia_sdk) {
+ extra_deps = [ "$fuchsia_sdk_root/pkg:trace-engine" ]
+ } else {
+ extra_deps = [
+ "//zircon/public/lib/fbl",
+ "//zircon/public/lib/trace-engine",
+ ]
+ }
+ }
}
library_for_all_configs("libdart_lib") {
@@ -206,7 +216,9 @@
"..:dart_maybe_product_config",
":libdart_vm_config",
]
- sources = [ "compiler/offsets_extractor.cc" ]
+ sources = [
+ "compiler/offsets_extractor.cc",
+ ]
include_dirs = [ ".." ]
}
@@ -218,6 +230,8 @@
"..:dart_maybe_product_config",
":libdart_vm_config",
]
- sources = [ "compiler/offsets_extractor.cc" ]
+ sources = [
+ "compiler/offsets_extractor.cc",
+ ]
include_dirs = [ ".." ]
}
diff --git a/runtime/vm/compiler/aot/aot_call_specializer.h b/runtime/vm/compiler/aot/aot_call_specializer.h
index 44ea0c2..a14acd2 100644
--- a/runtime/vm/compiler/aot/aot_call_specializer.h
+++ b/runtime/vm/compiler/aot/aot_call_specializer.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_AOT_AOT_CALL_SPECIALIZER_H_
#define RUNTIME_VM_COMPILER_AOT_AOT_CALL_SPECIALIZER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/call_specializer.h"
namespace dart {
diff --git a/runtime/vm/compiler/aot/dispatch_table_generator.h b/runtime/vm/compiler/aot/dispatch_table_generator.h
index 830e122..f987606 100644
--- a/runtime/vm/compiler/aot/dispatch_table_generator.h
+++ b/runtime/vm/compiler/aot/dispatch_table_generator.h
@@ -5,11 +5,13 @@
#ifndef RUNTIME_VM_COMPILER_AOT_DISPATCH_TABLE_GENERATOR_H_
#define RUNTIME_VM_COMPILER_AOT_DISPATCH_TABLE_GENERATOR_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/frontend/kernel_translation_helper.h"
#include "vm/object.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
class ClassTable;
@@ -109,6 +111,4 @@
} // namespace compiler
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
-
#endif // RUNTIME_VM_COMPILER_AOT_DISPATCH_TABLE_GENERATOR_H_
diff --git a/runtime/vm/compiler/aot/precompiler.cc b/runtime/vm/compiler/aot/precompiler.cc
index 0854325..c9be7d3 100644
--- a/runtime/vm/compiler/aot/precompiler.cc
+++ b/runtime/vm/compiler/aot/precompiler.cc
@@ -4,8 +4,6 @@
#include "vm/compiler/aot/precompiler.h"
-#ifndef DART_PRECOMPILED_RUNTIME
-
#include "platform/unicode.h"
#include "vm/class_finalizer.h"
#include "vm/code_patcher.h"
@@ -679,10 +677,10 @@
entry = view.Get<Code::kSCallTableFunctionTarget>();
if (entry.IsFunction()) {
AddFunction(Function::Cast(entry), FLAG_retain_function_objects);
- ASSERT(view.Get<Code::kSCallTableCodeTarget>() == Code::null());
+ ASSERT(view.Get<Code::kSCallTableCodeOrTypeTarget>() == Code::null());
continue;
}
- entry = view.Get<Code::kSCallTableCodeTarget>();
+ entry = view.Get<Code::kSCallTableCodeOrTypeTarget>();
if (entry.IsCode() && Code::Cast(entry).IsAllocationStubCode()) {
cls ^= Code::Cast(entry).owner();
AddInstantiatedClass(cls);
@@ -896,6 +894,11 @@
return;
}
+ if (instance.raw() == Object::sentinel().raw() ||
+ instance.raw() == Object::transition_sentinel().raw()) {
+ return;
+ }
+
const Class& cls = Class::Handle(Z, instance.clazz());
AddInstantiatedClass(cls);
@@ -973,14 +976,16 @@
if (field.is_static()) {
const Object& value = Object::Handle(Z, field.StaticValue());
- if (value.IsInstance()) {
+ // Should not be in the middle of initialization while precompiling.
+ ASSERT(value.raw() != Object::transition_sentinel().raw());
+
+ if (value.raw() != Object::sentinel().raw() &&
+ value.raw() != Object::null()) {
+ ASSERT(value.IsInstance());
AddConstObject(Instance::Cast(value));
}
if (field.has_nontrivial_initializer()) {
- // Should not be in the middle of initialization while precompiling.
- ASSERT(value.raw() != Object::transition_sentinel().raw());
-
if (!field.HasInitializerFunction() ||
!Function::Handle(Z, field.InitializerFunction()).HasCode()) {
if (FLAG_trace_precompiler) {
@@ -1579,11 +1584,11 @@
target_function_ = view.Get<Code::kSCallTableFunctionTarget>();
if (target_function_.IsNull()) continue;
- ASSERT(view.Get<Code::kSCallTableCodeTarget>() == Code::null());
+ ASSERT(view.Get<Code::kSCallTableCodeOrTypeTarget>() == Code::null());
ASSERT(target_function_.HasCode());
target_code_ = target_function_.CurrentCode();
ASSERT(!target_code_.IsStubCode());
- view.Set<Code::kSCallTableCodeTarget>(target_code_);
+ view.Set<Code::kSCallTableCodeOrTypeTarget>(target_code_);
view.Set<Code::kSCallTableFunctionTarget>(Object::null_function());
if (FLAG_trace_precompiler) {
THR_Print("Updated static call entry to %s in \"%s\"\n",
@@ -3127,5 +3132,3 @@
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
} // namespace dart
-
-#endif // DART_PRECOMPILED_RUNTIME
diff --git a/runtime/vm/compiler/aot/precompiler.h b/runtime/vm/compiler/aot/precompiler.h
index 8de467a..24d8c8c 100644
--- a/runtime/vm/compiler/aot/precompiler.h
+++ b/runtime/vm/compiler/aot/precompiler.h
@@ -5,7 +5,9 @@
#ifndef RUNTIME_VM_COMPILER_AOT_PRECOMPILER_H_
#define RUNTIME_VM_COMPILER_AOT_PRECOMPILER_H_
-#ifndef DART_PRECOMPILED_RUNTIME
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
#include "vm/allocation.h"
#include "vm/compiler/aot/dispatch_table_generator.h"
@@ -563,6 +565,4 @@
} // namespace dart
-#endif // DART_PRECOMPILED_RUNTIME
-
#endif // RUNTIME_VM_COMPILER_AOT_PRECOMPILER_H_
diff --git a/runtime/vm/compiler/asm_intrinsifier.cc b/runtime/vm/compiler/asm_intrinsifier.cc
index 0886fe4..3e3957f 100644
--- a/runtime/vm/compiler/asm_intrinsifier.cc
+++ b/runtime/vm/compiler/asm_intrinsifier.cc
@@ -2,9 +2,6 @@
// 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 for intrinsifying functions.
-
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#define SHOULD_NOT_INCLUDE_RUNTIME
#include "vm/compiler/asm_intrinsifier.h"
@@ -36,5 +33,3 @@
} // namespace compiler
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/asm_intrinsifier.h b/runtime/vm/compiler/asm_intrinsifier.h
index 59b3f63..01fd20d 100644
--- a/runtime/vm/compiler/asm_intrinsifier.h
+++ b/runtime/vm/compiler/asm_intrinsifier.h
@@ -6,6 +6,10 @@
#ifndef RUNTIME_VM_COMPILER_ASM_INTRINSIFIER_H_
#define RUNTIME_VM_COMPILER_ASM_INTRINSIFIER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
#include "vm/compiler/recognized_methods_list.h"
diff --git a/runtime/vm/compiler/asm_intrinsifier_arm.cc b/runtime/vm/compiler/asm_intrinsifier_arm.cc
index 86679cb..aff1c83 100644
--- a/runtime/vm/compiler/asm_intrinsifier_arm.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_arm.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
-#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM)
#define SHOULD_NOT_INCLUDE_RUNTIME
@@ -2348,4 +2348,4 @@
} // namespace compiler
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM)
diff --git a/runtime/vm/compiler/asm_intrinsifier_arm64.cc b/runtime/vm/compiler/asm_intrinsifier_arm64.cc
index aaf35b7..a8a5491 100644
--- a/runtime/vm/compiler/asm_intrinsifier_arm64.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_arm64.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
-#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM64)
#define SHOULD_NOT_INCLUDE_RUNTIME
@@ -2418,4 +2418,4 @@
} // namespace compiler
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM64)
diff --git a/runtime/vm/compiler/asm_intrinsifier_ia32.cc b/runtime/vm/compiler/asm_intrinsifier_ia32.cc
index edcc866..0f0f759 100644
--- a/runtime/vm/compiler/asm_intrinsifier_ia32.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_ia32.cc
@@ -9,7 +9,7 @@
// Dart method was intrinsified.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
-#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_IA32)
#define SHOULD_NOT_INCLUDE_RUNTIME
@@ -2355,4 +2355,4 @@
} // namespace compiler
} // namespace dart
-#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_IA32)
diff --git a/runtime/vm/compiler/asm_intrinsifier_x64.cc b/runtime/vm/compiler/asm_intrinsifier_x64.cc
index c4dc1b6..6ce01a9 100644
--- a/runtime/vm/compiler/asm_intrinsifier_x64.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_x64.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
-#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_X64)
#define SHOULD_NOT_INCLUDE_RUNTIME
@@ -2386,4 +2386,4 @@
} // namespace compiler
} // namespace dart
-#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_X64)
diff --git a/runtime/vm/compiler/assembler/assembler.h b/runtime/vm/compiler/assembler/assembler.h
index f702109..336640a 100644
--- a/runtime/vm/compiler/assembler/assembler.h
+++ b/runtime/vm/compiler/assembler/assembler.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_
#define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "platform/assert.h"
#include "vm/allocation.h"
#include "vm/compiler/assembler/object_pool_builder.h"
diff --git a/runtime/vm/compiler/assembler/assembler_arm.cc b/runtime/vm/compiler/assembler/assembler_arm.cc
index 35f8ced..cac81b9 100644
--- a/runtime/vm/compiler/assembler/assembler_arm.cc
+++ b/runtime/vm/compiler/assembler/assembler_arm.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // NOLINT
-#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM)
#define SHOULD_NOT_INCLUDE_RUNTIME
@@ -3805,4 +3805,4 @@
} // namespace compiler
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM)
diff --git a/runtime/vm/compiler/assembler/assembler_arm.h b/runtime/vm/compiler/assembler/assembler_arm.h
index 81ed9f6..5f2165a 100644
--- a/runtime/vm/compiler/assembler/assembler_arm.h
+++ b/runtime/vm/compiler/assembler/assembler_arm.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_ARM_H_
#define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_ARM_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_
#error Do not include assembler_arm.h directly; use assembler.h instead.
#endif
@@ -814,7 +818,7 @@
void LoadWordFromPoolOffset(Register rd,
int32_t offset,
Register pp,
- Condition cond);
+ Condition cond = AL);
void LoadObject(Register rd, const Object& object, Condition cond = AL);
void LoadUniqueObject(Register rd, const Object& object, Condition cond = AL);
diff --git a/runtime/vm/compiler/assembler/assembler_arm64.cc b/runtime/vm/compiler/assembler/assembler_arm64.cc
index a22a4fa..e418a0c 100644
--- a/runtime/vm/compiler/assembler/assembler_arm64.cc
+++ b/runtime/vm/compiler/assembler/assembler_arm64.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // NOLINT
-#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM64)
#define SHOULD_NOT_INCLUDE_RUNTIME
@@ -1984,4 +1984,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM64)
diff --git a/runtime/vm/compiler/assembler/assembler_arm64.h b/runtime/vm/compiler/assembler/assembler_arm64.h
index 071bb36..d2b5e28 100644
--- a/runtime/vm/compiler/assembler/assembler_arm64.h
+++ b/runtime/vm/compiler/assembler/assembler_arm64.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_ARM64_H_
#define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_ARM64_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_
#error Do not include assembler_arm64.h directly; use assembler.h instead.
#endif
diff --git a/runtime/vm/compiler/assembler/assembler_base.cc b/runtime/vm/compiler/assembler/assembler_base.cc
index 7ad426d..9f00096 100644
--- a/runtime/vm/compiler/assembler/assembler_base.cc
+++ b/runtime/vm/compiler/assembler/assembler_base.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/assembler/assembler_base.h"
#include "platform/utils.h"
@@ -389,5 +387,3 @@
} // namespace compiler
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/assembler/assembler_base.h b/runtime/vm/compiler/assembler/assembler_base.h
index 11f587c..419ec7d 100644
--- a/runtime/vm/compiler/assembler/assembler_base.h
+++ b/runtime/vm/compiler/assembler/assembler_base.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_BASE_H_
#define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_BASE_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "platform/assert.h"
#include "vm/allocation.h"
#include "vm/compiler/assembler/object_pool_builder.h"
diff --git a/runtime/vm/compiler/assembler/assembler_ia32.cc b/runtime/vm/compiler/assembler/assembler_ia32.cc
index 1ef9cda..df6fe5f 100644
--- a/runtime/vm/compiler/assembler/assembler_ia32.cc
+++ b/runtime/vm/compiler/assembler/assembler_ia32.cc
@@ -14,15 +14,11 @@
namespace dart {
-#if !defined(DART_PRECOMPILED_RUNTIME)
DECLARE_FLAG(bool, inline_alloc);
DECLARE_FLAG(bool, use_slow_path);
-#endif
namespace compiler {
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
class DirectCallRelocation : public AssemblerFixup {
public:
void Process(const MemoryRegion& region, intptr_t position) {
@@ -2794,8 +2790,6 @@
}
}
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
-
} // namespace compiler
} // namespace dart
diff --git a/runtime/vm/compiler/assembler/assembler_ia32.h b/runtime/vm/compiler/assembler/assembler_ia32.h
index 286b6f9..b487548 100644
--- a/runtime/vm/compiler/assembler/assembler_ia32.h
+++ b/runtime/vm/compiler/assembler/assembler_ia32.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_IA32_H_
#define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_IA32_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_
#error Do not include assembler_ia32.h directly; use assembler.h instead.
#endif
diff --git a/runtime/vm/compiler/assembler/assembler_x64.cc b/runtime/vm/compiler/assembler/assembler_x64.cc
index a7b9cb5..624b28e 100644
--- a/runtime/vm/compiler/assembler/assembler_x64.cc
+++ b/runtime/vm/compiler/assembler/assembler_x64.cc
@@ -14,17 +14,13 @@
namespace dart {
-#if !defined(DART_PRECOMPILED_RUNTIME)
DECLARE_FLAG(bool, check_code_pointer);
DECLARE_FLAG(bool, inline_alloc);
DECLARE_FLAG(bool, precompiled_mode);
DECLARE_FLAG(bool, use_slow_path);
-#endif
namespace compiler {
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
Assembler::Assembler(ObjectPoolBuilder* object_pool_builder,
bool use_far_branches)
: AssemblerBase(object_pool_builder), constant_pool_allowed_(false) {
@@ -2299,8 +2295,6 @@
}
}
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
-
} // namespace compiler
} // namespace dart
diff --git a/runtime/vm/compiler/assembler/assembler_x64.h b/runtime/vm/compiler/assembler/assembler_x64.h
index 42a17d8..e39a7f2 100644
--- a/runtime/vm/compiler/assembler/assembler_x64.h
+++ b/runtime/vm/compiler/assembler/assembler_x64.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_X64_H_
#define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_X64_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_
#error Do not include assembler_x64.h directly; use assembler.h instead.
#endif
diff --git a/runtime/vm/compiler/assembler/disassembler.cc b/runtime/vm/compiler/assembler/disassembler.cc
index 89e9204..8dd66a3 100644
--- a/runtime/vm/compiler/assembler/disassembler.cc
+++ b/runtime/vm/compiler/assembler/disassembler.cc
@@ -369,13 +369,22 @@
auto& cls = Class::Handle(zone);
auto& kind_type_and_offset = Smi::Handle(zone);
auto& function = Function::Handle(zone);
+ auto& object = Object::Handle(zone);
auto& code = Code::Handle(zone);
+ auto& dst_type = AbstractType::Handle(zone);
if (!table.IsNull()) {
StaticCallsTable static_calls(table);
for (auto& call : static_calls) {
kind_type_and_offset = call.Get<Code::kSCallTableKindAndOffset>();
function = call.Get<Code::kSCallTableFunctionTarget>();
- code = call.Get<Code::kSCallTableCodeTarget>();
+ object = call.Get<Code::kSCallTableCodeOrTypeTarget>();
+
+ dst_type = AbstractType::null();
+ if (object.IsAbstractType()) {
+ dst_type = AbstractType::Cast(object).raw();
+ } else if (object.IsCode()) {
+ code = Code::Cast(object).raw();
+ }
auto kind = Code::KindField::decode(kind_type_and_offset.Value());
auto offset = Code::OffsetField::decode(kind_type_and_offset.Value());
@@ -389,6 +398,9 @@
case Code::kPcRelativeCall:
skind = "pc-relative-call";
break;
+ case Code::kPcRelativeTTSCall:
+ skind = "pc-relative-tts-call";
+ break;
case Code::kPcRelativeTailCall:
skind = "pc-relative-tail-call";
break;
@@ -398,7 +410,10 @@
default:
UNREACHABLE();
}
- if (function.IsNull()) {
+ if (!dst_type.IsNull()) {
+ THR_Print(" 0x%" Px ": type testing stub %s, (%s)%s\n",
+ base + offset, dst_type.ToCString(), skind, s_entry_point);
+ } else if (function.IsNull()) {
cls ^= code.owner();
if (cls.IsNull()) {
THR_Print(" 0x%" Px ": %s, (%s)%s\n", base + offset,
diff --git a/runtime/vm/compiler/backend/block_builder.h b/runtime/vm/compiler/backend/block_builder.h
index afca0e8..7cf8b86 100644
--- a/runtime/vm/compiler/backend/block_builder.h
+++ b/runtime/vm/compiler/backend/block_builder.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_BLOCK_BUILDER_H_
#define RUNTIME_VM_COMPILER_BACKEND_BLOCK_BUILDER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
diff --git a/runtime/vm/compiler/backend/block_scheduler.cc b/runtime/vm/compiler/backend/block_scheduler.cc
index 0d84725..9807a19 100644
--- a/runtime/vm/compiler/backend/block_scheduler.cc
+++ b/runtime/vm/compiler/backend/block_scheduler.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/block_scheduler.h"
#include "vm/allocation.h"
@@ -304,5 +302,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/block_scheduler.h b/runtime/vm/compiler/backend/block_scheduler.h
index 4bcdf15..305cbf3 100644
--- a/runtime/vm/compiler/backend/block_scheduler.h
+++ b/runtime/vm/compiler/backend/block_scheduler.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_BLOCK_SCHEDULER_H_
#define RUNTIME_VM_COMPILER_BACKEND_BLOCK_SCHEDULER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
namespace dart {
diff --git a/runtime/vm/compiler/backend/branch_optimizer.cc b/runtime/vm/compiler/backend/branch_optimizer.cc
index 1f9e9f3..3c58635 100644
--- a/runtime/vm/compiler/backend/branch_optimizer.cc
+++ b/runtime/vm/compiler/backend/branch_optimizer.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/branch_optimizer.h"
#include "vm/compiler/backend/flow_graph.h"
@@ -349,5 +347,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/branch_optimizer.h b/runtime/vm/compiler/backend/branch_optimizer.h
index 8d8136d..ca91b16 100644
--- a/runtime/vm/compiler/backend/branch_optimizer.h
+++ b/runtime/vm/compiler/backend/branch_optimizer.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_BRANCH_OPTIMIZER_H_
#define RUNTIME_VM_COMPILER_BACKEND_BRANCH_OPTIMIZER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
namespace dart {
diff --git a/runtime/vm/compiler/backend/code_statistics.h b/runtime/vm/compiler/backend/code_statistics.h
index cfc4cd95e..75d3274 100644
--- a/runtime/vm/compiler/backend/code_statistics.h
+++ b/runtime/vm/compiler/backend/code_statistics.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_CODE_STATISTICS_H_
#define RUNTIME_VM_COMPILER_BACKEND_CODE_STATISTICS_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/backend/il.h"
#include "vm/object.h"
diff --git a/runtime/vm/compiler/backend/compile_type.h b/runtime/vm/compiler/backend/compile_type.h
index d6477b1..f72eb52 100644
--- a/runtime/vm/compiler/backend/compile_type.h
+++ b/runtime/vm/compiler/backend/compile_type.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_COMPILE_TYPE_H_
#define RUNTIME_VM_COMPILER_BACKEND_COMPILE_TYPE_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
#include "vm/class_id.h"
#include "vm/compiler/runtime_api.h"
diff --git a/runtime/vm/compiler/backend/constant_propagator.cc b/runtime/vm/compiler/backend/constant_propagator.cc
index ca953b5..11b1099 100644
--- a/runtime/vm/compiler/backend/constant_propagator.cc
+++ b/runtime/vm/compiler/backend/constant_propagator.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/constant_propagator.h"
#include "vm/bit_vector.h"
@@ -596,7 +594,11 @@
const intptr_t right_cid = instr->right()->Type()->ToCid();
// If exact classes (cids) are known and they differ, the result
// of strict compare can be computed.
+ // The only exception is comparison with special sentinel value
+ // (used for lazy initialization) which can be compared to a
+ // value of any type. Sentinel value has kNeverCid.
if ((left_cid != kDynamicCid) && (right_cid != kDynamicCid) &&
+ (left_cid != kNeverCid) && (right_cid != kNeverCid) &&
(left_cid != right_cid)) {
const bool result = (instr->kind() != Token::kEQ_STRICT);
SetValue(instr, Bool::Get(result));
@@ -1674,5 +1676,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/constant_propagator.h b/runtime/vm/compiler/backend/constant_propagator.h
index dd32d16..6150081 100644
--- a/runtime/vm/compiler/backend/constant_propagator.h
+++ b/runtime/vm/compiler/backend/constant_propagator.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_CONSTANT_PROPAGATOR_H_
#define RUNTIME_VM_COMPILER_BACKEND_CONSTANT_PROPAGATOR_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
diff --git a/runtime/vm/compiler/backend/evaluator.cc b/runtime/vm/compiler/backend/evaluator.cc
index f6adab3..e61c9d7 100644
--- a/runtime/vm/compiler/backend/evaluator.cc
+++ b/runtime/vm/compiler/backend/evaluator.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/evaluator.h"
namespace dart {
@@ -237,5 +235,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/evaluator.h b/runtime/vm/compiler/backend/evaluator.h
index 8c8e814..13590f9 100644
--- a/runtime/vm/compiler/backend/evaluator.h
+++ b/runtime/vm/compiler/backend/evaluator.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_EVALUATOR_H_
#define RUNTIME_VM_COMPILER_BACKEND_EVALUATOR_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
diff --git a/runtime/vm/compiler/backend/flow_graph.cc b/runtime/vm/compiler/backend/flow_graph.cc
index 5cde585..2ad41c6 100644
--- a/runtime/vm/compiler/backend/flow_graph.cc
+++ b/runtime/vm/compiler/backend/flow_graph.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/flow_graph.h"
#include "vm/bit_vector.h"
@@ -2703,5 +2701,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/flow_graph.h b/runtime/vm/compiler/backend/flow_graph.h
index 03a2239..67c1fed 100644
--- a/runtime/vm/compiler/backend/flow_graph.h
+++ b/runtime/vm/compiler/backend/flow_graph.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_H_
#define RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/bit_vector.h"
#include "vm/compiler/backend/il.h"
#include "vm/growable_array.h"
@@ -156,11 +160,10 @@
}
intptr_t CurrentContextEnvIndex() const {
-#if !defined(DART_PRECOMPILED_RUNTIME)
if (function().HasBytecode()) {
return -1;
}
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
+
return EnvIndex(parsed_function().current_context_var());
}
diff --git a/runtime/vm/compiler/backend/flow_graph_checker.cc b/runtime/vm/compiler/backend/flow_graph_checker.cc
index 7814dd1..5b753ce 100644
--- a/runtime/vm/compiler/backend/flow_graph_checker.cc
+++ b/runtime/vm/compiler/backend/flow_graph_checker.cc
@@ -2,7 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
#if defined(DEBUG)
#include "vm/compiler/backend/flow_graph_checker.h"
@@ -474,4 +473,3 @@
} // namespace dart
#endif // defined(DEBUG)
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/flow_graph_checker.h b/runtime/vm/compiler/backend/flow_graph_checker.h
index c86fab8..0079d98 100644
--- a/runtime/vm/compiler/backend/flow_graph_checker.h
+++ b/runtime/vm/compiler/backend/flow_graph_checker.h
@@ -5,7 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_CHECKER_H_
#define RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_CHECKER_H_
-#if !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#if defined(DEBUG)
#include "vm/compiler/backend/flow_graph.h"
@@ -69,6 +72,5 @@
} // namespace dart
#endif // defined(DEBUG)
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_CHECKER_H_
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.cc b/runtime/vm/compiler/backend/flow_graph_compiler.cc
index f9f22ba..bfc7d5b 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler.cc
@@ -44,8 +44,6 @@
DEFINE_FLAG(bool, enable_peephole, true, "Enable peephole optimization");
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
DEFINE_FLAG(bool,
enable_simd_inline,
true,
@@ -775,17 +773,17 @@
const auto entry_point = entry_kind == Code::EntryKind::kUnchecked
? Code::kUncheckedEntry
: Code::kDefaultEntry;
- static_calls_target_table_.Add(
- new (zone()) StaticCallsStruct(Code::kPcRelativeCall, entry_point,
- assembler()->CodeSize(), &function, NULL));
+ static_calls_target_table_.Add(new (zone()) StaticCallsStruct(
+ Code::kPcRelativeCall, entry_point, assembler()->CodeSize(), &function,
+ nullptr, nullptr));
}
void FlowGraphCompiler::AddPcRelativeCallStubTarget(const Code& stub_code) {
ASSERT(stub_code.IsZoneHandle() || stub_code.IsReadOnlyHandle());
ASSERT(!stub_code.IsNull());
static_calls_target_table_.Add(new (zone()) StaticCallsStruct(
- Code::kPcRelativeCall, Code::kDefaultEntry, assembler()->CodeSize(), NULL,
- &stub_code));
+ Code::kPcRelativeCall, Code::kDefaultEntry, assembler()->CodeSize(),
+ nullptr, &stub_code, nullptr));
}
void FlowGraphCompiler::AddPcRelativeTailCallStubTarget(const Code& stub_code) {
@@ -793,7 +791,16 @@
ASSERT(!stub_code.IsNull());
static_calls_target_table_.Add(new (zone()) StaticCallsStruct(
Code::kPcRelativeTailCall, Code::kDefaultEntry, assembler()->CodeSize(),
- nullptr, &stub_code));
+ nullptr, &stub_code, nullptr));
+}
+
+void FlowGraphCompiler::AddPcRelativeTTSCallTypeTarget(
+ const AbstractType& dst_type) {
+ ASSERT(dst_type.IsZoneHandle() || dst_type.IsReadOnlyHandle());
+ ASSERT(!dst_type.IsNull());
+ static_calls_target_table_.Add(new (zone()) StaticCallsStruct(
+ Code::kPcRelativeTTSCall, Code::kDefaultEntry, assembler()->CodeSize(),
+ nullptr, nullptr, &dst_type));
}
void FlowGraphCompiler::AddStaticCallTarget(const Function& func,
@@ -803,14 +810,15 @@
? Code::kUncheckedEntry
: Code::kDefaultEntry;
static_calls_target_table_.Add(new (zone()) StaticCallsStruct(
- Code::kCallViaCode, entry_point, assembler()->CodeSize(), &func, NULL));
+ Code::kCallViaCode, entry_point, assembler()->CodeSize(), &func, nullptr,
+ nullptr));
}
void FlowGraphCompiler::AddStubCallTarget(const Code& code) {
ASSERT(code.IsZoneHandle() || code.IsReadOnlyHandle());
- static_calls_target_table_.Add(
- new (zone()) StaticCallsStruct(Code::kCallViaCode, Code::kDefaultEntry,
- assembler()->CodeSize(), NULL, &code));
+ static_calls_target_table_.Add(new (zone()) StaticCallsStruct(
+ Code::kCallViaCode, Code::kDefaultEntry, assembler()->CodeSize(), nullptr,
+ &code, nullptr));
}
void FlowGraphCompiler::AddDispatchTableCallTarget(
@@ -1220,11 +1228,17 @@
view.Set<Code::kSCallTableKindAndOffset>(kind_type_and_offset);
const Object* target = nullptr;
if (entry->function != nullptr) {
- view.Set<Code::kSCallTableFunctionTarget>(*calls[i]->function);
+ target = entry->function;
+ view.Set<Code::kSCallTableFunctionTarget>(*entry->function);
}
- if (entry->code != NULL) {
+ if (entry->code != nullptr) {
ASSERT(target == nullptr);
- view.Set<Code::kSCallTableCodeTarget>(*calls[i]->code);
+ target = entry->code;
+ view.Set<Code::kSCallTableCodeOrTypeTarget>(*entry->code);
+ }
+ if (entry->dst_type != nullptr) {
+ ASSERT(target == nullptr);
+ view.Set<Code::kSCallTableCodeOrTypeTarget>(*entry->dst_type);
}
}
code.set_static_calls_target_table(targets);
@@ -2360,8 +2374,9 @@
// We "dereference" the type parameter for the TTS call but leave the type
// parameter in the TypeTestABI::kDstTypeReg for fallback into
// SubtypeTestCache.
- ASSERT(dst_type.IsTypeParameter() ==
- (TypeTestABI::kDstTypeReg != dst_type_reg_to_call));
+ ASSERT(dst_type_reg_to_call == kNoRegister ||
+ (dst_type.IsTypeParameter() ==
+ (TypeTestABI::kDstTypeReg != dst_type_reg_to_call)));
// We can handle certain types very efficiently on the call site (with a
// bailout to the normal stub, which will do a runtime call).
@@ -2788,6 +2803,5 @@
}
#undef __
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
} // namespace dart
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.h b/runtime/vm/compiler/backend/flow_graph_compiler.h
index 0097fcd..8b42dc0 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler.h
+++ b/runtime/vm/compiler/backend/flow_graph_compiler.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_COMPILER_H_
#define RUNTIME_VM_COMPILER_BACKEND_FLOW_GRAPH_COMPILER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include <functional>
#include "vm/allocation.h"
@@ -973,6 +977,7 @@
Code::EntryKind entry_kind);
void AddPcRelativeCallStubTarget(const Code& stub_code);
void AddPcRelativeTailCallStubTarget(const Code& stub_code);
+ void AddPcRelativeTTSCallTypeTarget(const AbstractType& type);
void AddStaticCallTarget(const Function& function,
Code::EntryKind entry_kind);
@@ -1150,21 +1155,27 @@
Code::CallKind call_kind;
Code::CallEntryPoint entry_point;
const intptr_t offset;
- const Function* function; // Can be NULL.
- const Code* code; // Can be NULL.
+ const Function* function; // Can be nullptr.
+ const Code* code; // Can be nullptr.
+ const AbstractType* dst_type; // Can be nullptr.
StaticCallsStruct(Code::CallKind call_kind,
Code::CallEntryPoint entry_point,
intptr_t offset_arg,
const Function* function_arg,
- const Code* code_arg)
+ const Code* code_arg,
+ const AbstractType* dst_type)
: call_kind(call_kind),
entry_point(entry_point),
offset(offset_arg),
function(function_arg),
- code(code_arg) {
- ASSERT((function == NULL) || function->IsZoneHandle());
- ASSERT((code == NULL) || code->IsZoneHandle() ||
+ code(code_arg),
+ dst_type(dst_type) {
+ ASSERT(function == nullptr || function->IsZoneHandle());
+ ASSERT(code == nullptr || code->IsZoneHandle() ||
code->IsReadOnlyHandle());
+ ASSERT(dst_type == nullptr || dst_type->IsZoneHandle() ||
+ dst_type->IsReadOnlyHandle());
+ ASSERT(code == nullptr || dst_type == nullptr);
}
private:
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
index 2d5388c..f2e8e44 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
-#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM)
#include "vm/compiler/backend/flow_graph_compiler.h"
@@ -763,8 +763,16 @@
const AbstractType& dst_type,
const String& dst_name,
LocationSummary* locs) {
+ // If the dst_type is instantiated we know the target TTS stub at
+ // compile-time and can therefore use a pc-relative call.
+ const bool use_pc_relative_call = dst_type.IsInstantiated() &&
+ FLAG_precompiled_mode &&
+ FLAG_use_bare_instructions;
+
const Register kRegToCall =
- dst_type.IsTypeParameter() ? R9 : TypeTestABI::kDstTypeReg;
+ use_pc_relative_call
+ ? kNoRegister
+ : (dst_type.IsTypeParameter() ? R9 : TypeTestABI::kDstTypeReg);
const Register kScratchReg = R4;
compiler::Label done;
@@ -788,14 +796,19 @@
ASSERT((sub_type_cache_index + 1) == dst_name_index);
ASSERT(__ constant_pool_allowed());
- __ LoadField(
- R9,
- compiler::FieldAddress(
- kRegToCall,
- compiler::target::AbstractType::type_test_stub_entry_point_offset()));
- __ LoadWordFromPoolOffset(TypeTestABI::kSubtypeTestCacheReg,
- sub_type_cache_offset, PP, AL);
- __ blx(R9);
+ if (use_pc_relative_call) {
+ __ LoadWordFromPoolOffset(TypeTestABI::kSubtypeTestCacheReg,
+ sub_type_cache_offset, PP);
+ __ GenerateUnRelocatedPcRelativeCall();
+ AddPcRelativeTTSCallTypeTarget(dst_type);
+ } else {
+ __ LoadField(R9, compiler::FieldAddress(
+ kRegToCall, compiler::target::AbstractType::
+ type_test_stub_entry_point_offset()));
+ __ LoadWordFromPoolOffset(TypeTestABI::kSubtypeTestCacheReg,
+ sub_type_cache_offset, PP);
+ __ blx(R9);
+ }
EmitCallsiteMetadata(token_pos, deopt_id, RawPcDescriptors::kOther, locs);
__ Bind(&done);
}
@@ -1871,4 +1884,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM)
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc
index 051740f..3f42db3 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
-#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM64)
#include "vm/compiler/backend/flow_graph_compiler.h"
@@ -725,8 +725,16 @@
const AbstractType& dst_type,
const String& dst_name,
LocationSummary* locs) {
+ // If the dst_type is instantiated we know the target TTS stub at
+ // compile-time and can therefore use a pc-relative call.
+ const bool use_pc_relative_call = dst_type.IsInstantiated() &&
+ FLAG_precompiled_mode &&
+ FLAG_use_bare_instructions;
+
const Register kRegToCall =
- dst_type.IsTypeParameter() ? R9 : TypeTestABI::kDstTypeReg;
+ use_pc_relative_call
+ ? kNoRegister
+ : (dst_type.IsTypeParameter() ? R9 : TypeTestABI::kDstTypeReg);
const Register kScratchReg = R4;
compiler::Label done;
@@ -749,12 +757,19 @@
ASSERT((sub_type_cache_index + 1) == dst_name_index);
ASSERT(__ constant_pool_allowed());
- __ LoadField(
- R9, compiler::FieldAddress(
- kRegToCall, AbstractType::type_test_stub_entry_point_offset()));
- __ LoadWordFromPoolOffset(TypeTestABI::kSubtypeTestCacheReg,
- sub_type_cache_offset);
- __ blr(R9);
+ if (use_pc_relative_call) {
+ __ LoadWordFromPoolOffset(TypeTestABI::kSubtypeTestCacheReg,
+ sub_type_cache_offset);
+ __ GenerateUnRelocatedPcRelativeCall();
+ AddPcRelativeTTSCallTypeTarget(dst_type);
+ } else {
+ __ LoadField(
+ R9, compiler::FieldAddress(
+ kRegToCall, AbstractType::type_test_stub_entry_point_offset()));
+ __ LoadWordFromPoolOffset(TypeTestABI::kSubtypeTestCacheReg,
+ sub_type_cache_offset);
+ __ blr(R9);
+ }
EmitCallsiteMetadata(token_pos, deopt_id, RawPcDescriptors::kOther, locs);
__ Bind(&done);
}
@@ -1794,4 +1809,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM64)
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc b/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc
index d982292..2c7eac4 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
-#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_IA32)
#include "vm/compiler/backend/flow_graph_compiler.h"
@@ -1602,4 +1602,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_IA32)
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc b/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc
index cade733..e75ab34 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
-#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_X64)
#include "vm/compiler/backend/flow_graph_compiler.h"
@@ -730,11 +730,17 @@
const AbstractType& dst_type,
const String& dst_name,
LocationSummary* locs) {
- compiler::Label done;
-
- const Register kRegToCall =
+ // If the dst_type is instantiated we know the target TTS stub at
+ // compile-time and can therefore use a pc-relative call.
+ const bool use_pc_relative_call = dst_type.IsInstantiated() &&
+ FLAG_precompiled_mode &&
+ FLAG_use_bare_instructions;
+ const Register kScratchReg =
dst_type.IsTypeParameter() ? RSI : TypeTestABI::kDstTypeReg;
- const Register kScratchReg = kRegToCall;
+
+ const Register kRegToCall = use_pc_relative_call ? kNoRegister : kScratchReg;
+
+ compiler::Label done;
GenerateAssertAssignableViaTypeTestingStub(receiver_type, dst_type, dst_name,
kRegToCall, kScratchReg, &done);
@@ -756,8 +762,13 @@
__ movq(TypeTestABI::kSubtypeTestCacheReg,
compiler::Address(PP, sub_type_cache_offset));
- __ call(compiler::FieldAddress(
- kRegToCall, AbstractType::type_test_stub_entry_point_offset()));
+ if (use_pc_relative_call) {
+ __ GenerateUnRelocatedPcRelativeCall();
+ AddPcRelativeTTSCallTypeTarget(dst_type);
+ } else {
+ __ call(compiler::FieldAddress(
+ kRegToCall, AbstractType::type_test_stub_entry_point_offset()));
+ }
EmitCallsiteMetadata(token_pos, deopt_id, RawPcDescriptors::kOther, locs);
__ Bind(&done);
}
@@ -1763,4 +1774,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_X64)
diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc
index eca6a6c..8b9836a 100644
--- a/runtime/vm/compiler/backend/il.cc
+++ b/runtime/vm/compiler/backend/il.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/il.h"
#include "vm/bit_vector.h"
@@ -6152,5 +6150,3 @@
#undef __
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/il.h b/runtime/vm/compiler/backend/il.h
index e635815..a0816ba 100644
--- a/runtime/vm/compiler/backend/il.h
+++ b/runtime/vm/compiler/backend/il.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_IL_H_
#define RUNTIME_VM_COMPILER_BACKEND_IL_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include <memory>
#include <utility>
diff --git a/runtime/vm/compiler/backend/il_arm.cc b/runtime/vm/compiler/backend/il_arm.cc
index 5e3faea..71bb295 100644
--- a/runtime/vm/compiler/backend/il_arm.cc
+++ b/runtime/vm/compiler/backend/il_arm.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
-#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM)
#include "vm/compiler/backend/il.h"
@@ -7491,4 +7491,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM)
diff --git a/runtime/vm/compiler/backend/il_arm64.cc b/runtime/vm/compiler/backend/il_arm64.cc
index 7393059..10bac83 100644
--- a/runtime/vm/compiler/backend/il_arm64.cc
+++ b/runtime/vm/compiler/backend/il_arm64.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
-#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM64)
#include "vm/compiler/backend/il.h"
@@ -6434,4 +6434,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM64)
diff --git a/runtime/vm/compiler/backend/il_deserializer.cc b/runtime/vm/compiler/backend/il_deserializer.cc
index c8d0916..abc152e 100644
--- a/runtime/vm/compiler/backend/il_deserializer.cc
+++ b/runtime/vm/compiler/backend/il_deserializer.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/il_deserializer.h"
#include "vm/compiler/backend/il_serializer.h"
@@ -2485,5 +2483,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/il_deserializer.h b/runtime/vm/compiler/backend/il_deserializer.h
index 9e8d40b..3959d37 100644
--- a/runtime/vm/compiler/backend/il_deserializer.h
+++ b/runtime/vm/compiler/backend/il_deserializer.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_IL_DESERIALIZER_H_
#define RUNTIME_VM_COMPILER_BACKEND_IL_DESERIALIZER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "platform/assert.h"
#include "vm/allocation.h"
diff --git a/runtime/vm/compiler/backend/il_ia32.cc b/runtime/vm/compiler/backend/il_ia32.cc
index 745c44ea..57c00db 100644
--- a/runtime/vm/compiler/backend/il_ia32.cc
+++ b/runtime/vm/compiler/backend/il_ia32.cc
@@ -4,7 +4,7 @@
#include "platform/globals.h"
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
-#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_IA32)
#include "vm/compiler/backend/il.h"
@@ -6340,4 +6340,4 @@
#undef __
-#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_IA32)
diff --git a/runtime/vm/compiler/backend/il_printer.h b/runtime/vm/compiler/backend/il_printer.h
index becdf59..96268c8 100644
--- a/runtime/vm/compiler/backend/il_printer.h
+++ b/runtime/vm/compiler/backend/il_printer.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_IL_PRINTER_H_
#define RUNTIME_VM_COMPILER_BACKEND_IL_PRINTER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "platform/text_buffer.h"
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
diff --git a/runtime/vm/compiler/backend/il_serializer.cc b/runtime/vm/compiler/backend/il_serializer.cc
index bdd8812..cfab7bb 100644
--- a/runtime/vm/compiler/backend/il_serializer.cc
+++ b/runtime/vm/compiler/backend/il_serializer.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/il_serializer.h"
#include "vm/compiler/backend/flow_graph.h"
@@ -1484,5 +1482,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/il_serializer.h b/runtime/vm/compiler/backend/il_serializer.h
index 0e02cd2..eb7795e 100644
--- a/runtime/vm/compiler/backend/il_serializer.h
+++ b/runtime/vm/compiler/backend/il_serializer.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_IL_SERIALIZER_H_
#define RUNTIME_VM_COMPILER_BACKEND_IL_SERIALIZER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "platform/assert.h"
#include "platform/text_buffer.h"
diff --git a/runtime/vm/compiler/backend/il_x64.cc b/runtime/vm/compiler/backend/il_x64.cc
index 0ab1b74..1109aff 100644
--- a/runtime/vm/compiler/backend/il_x64.cc
+++ b/runtime/vm/compiler/backend/il_x64.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
-#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_X64)
#include "vm/compiler/backend/il.h"
@@ -6720,4 +6720,4 @@
#undef __
-#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_X64)
diff --git a/runtime/vm/compiler/backend/inliner.cc b/runtime/vm/compiler/backend/inliner.cc
index c124196..1daefa0 100644
--- a/runtime/vm/compiler/backend/inliner.cc
+++ b/runtime/vm/compiler/backend/inliner.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/inliner.h"
#include "vm/compiler/aot/aot_call_specializer.h"
@@ -4267,5 +4265,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/inliner.h b/runtime/vm/compiler/backend/inliner.h
index 5aa3c1a..c31a954 100644
--- a/runtime/vm/compiler/backend/inliner.h
+++ b/runtime/vm/compiler/backend/inliner.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_INLINER_H_
#define RUNTIME_VM_COMPILER_BACKEND_INLINER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
#include "vm/growable_array.h"
#include "vm/token_position.h"
diff --git a/runtime/vm/compiler/backend/linearscan.cc b/runtime/vm/compiler/backend/linearscan.cc
index 9bcd928..2aa6944 100644
--- a/runtime/vm/compiler/backend/linearscan.cc
+++ b/runtime/vm/compiler/backend/linearscan.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/linearscan.h"
#include "vm/bit_vector.h"
@@ -2991,5 +2989,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/linearscan.h b/runtime/vm/compiler/backend/linearscan.h
index 4bb868b..740e489 100644
--- a/runtime/vm/compiler/backend/linearscan.h
+++ b/runtime/vm/compiler/backend/linearscan.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_LINEARSCAN_H_
#define RUNTIME_VM_COMPILER_BACKEND_LINEARSCAN_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
#include "vm/growable_array.h"
diff --git a/runtime/vm/compiler/backend/locations.cc b/runtime/vm/compiler/backend/locations.cc
index 2153fac..f5853c2 100644
--- a/runtime/vm/compiler/backend/locations.cc
+++ b/runtime/vm/compiler/backend/locations.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/locations.h"
#include "vm/compiler/assembler/assembler.h"
@@ -394,5 +392,3 @@
#endif
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/locations.h b/runtime/vm/compiler/backend/locations.h
index 117092a..a270ad8 100644
--- a/runtime/vm/compiler/backend/locations.h
+++ b/runtime/vm/compiler/backend/locations.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_H_
#define RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
#include "vm/bitfield.h"
#include "vm/bitmap.h"
diff --git a/runtime/vm/compiler/backend/locations_helpers.h b/runtime/vm/compiler/backend/locations_helpers.h
index 5e7969a..6b62e40 100644
--- a/runtime/vm/compiler/backend/locations_helpers.h
+++ b/runtime/vm/compiler/backend/locations_helpers.h
@@ -43,6 +43,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_HELPERS_H_
#define RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_HELPERS_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/locations.h"
namespace dart {
diff --git a/runtime/vm/compiler/backend/locations_helpers_arm.h b/runtime/vm/compiler/backend/locations_helpers_arm.h
index 6eecc9f..4a651cc 100644
--- a/runtime/vm/compiler/backend/locations_helpers_arm.h
+++ b/runtime/vm/compiler/backend/locations_helpers_arm.h
@@ -9,6 +9,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_HELPERS_ARM_H_
#define RUNTIME_VM_COMPILER_BACKEND_LOCATIONS_HELPERS_ARM_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
namespace dart {
// QRegisterView is a wrapper around QRegister that provides helpers for
diff --git a/runtime/vm/compiler/backend/loops.cc b/runtime/vm/compiler/backend/loops.cc
index b8edbc0..21a4a77 100644
--- a/runtime/vm/compiler/backend/loops.cc
+++ b/runtime/vm/compiler/backend/loops.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/loops.h"
#include "vm/bit_vector.h"
@@ -1192,5 +1190,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/loops.h b/runtime/vm/compiler/backend/loops.h
index 26875ab..704508b 100644
--- a/runtime/vm/compiler/backend/loops.h
+++ b/runtime/vm/compiler/backend/loops.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_LOOPS_H_
#define RUNTIME_VM_COMPILER_BACKEND_LOOPS_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include <utility>
#include "vm/allocation.h"
diff --git a/runtime/vm/compiler/backend/range_analysis.cc b/runtime/vm/compiler/backend/range_analysis.cc
index 7ab4dc2..f81e017 100644
--- a/runtime/vm/compiler/backend/range_analysis.cc
+++ b/runtime/vm/compiler/backend/range_analysis.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/range_analysis.h"
#include "vm/bit_vector.h"
@@ -3045,5 +3043,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/range_analysis.h b/runtime/vm/compiler/backend/range_analysis.h
index 720103b..0ed4936 100644
--- a/runtime/vm/compiler/backend/range_analysis.h
+++ b/runtime/vm/compiler/backend/range_analysis.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_RANGE_ANALYSIS_H_
#define RUNTIME_VM_COMPILER_BACKEND_RANGE_ANALYSIS_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
diff --git a/runtime/vm/compiler/backend/redundancy_elimination.cc b/runtime/vm/compiler/backend/redundancy_elimination.cc
index 01e5c51..45c4b24 100644
--- a/runtime/vm/compiler/backend/redundancy_elimination.cc
+++ b/runtime/vm/compiler/backend/redundancy_elimination.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/redundancy_elimination.h"
#include "vm/bit_vector.h"
@@ -3840,5 +3838,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/redundancy_elimination.h b/runtime/vm/compiler/backend/redundancy_elimination.h
index fd9b9c8..84fc7d2 100644
--- a/runtime/vm/compiler/backend/redundancy_elimination.h
+++ b/runtime/vm/compiler/backend/redundancy_elimination.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_REDUNDANCY_ELIMINATION_H_
#define RUNTIME_VM_COMPILER_BACKEND_REDUNDANCY_ELIMINATION_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
diff --git a/runtime/vm/compiler/backend/sexpression.cc b/runtime/vm/compiler/backend/sexpression.cc
index 8b33ea5..12006b4 100644
--- a/runtime/vm/compiler/backend/sexpression.cc
+++ b/runtime/vm/compiler/backend/sexpression.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/sexpression.h"
#include <ctype.h>
@@ -687,5 +685,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/sexpression.h b/runtime/vm/compiler/backend/sexpression.h
index 461e3eb..40b79a3 100644
--- a/runtime/vm/compiler/backend/sexpression.h
+++ b/runtime/vm/compiler/backend/sexpression.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_SEXPRESSION_H_
#define RUNTIME_VM_COMPILER_BACKEND_SEXPRESSION_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "platform/text_buffer.h"
#include "vm/allocation.h"
diff --git a/runtime/vm/compiler/backend/slot.cc b/runtime/vm/compiler/backend/slot.cc
index 3ebb148..bab1c7a 100644
--- a/runtime/vm/compiler/backend/slot.cc
+++ b/runtime/vm/compiler/backend/slot.cc
@@ -4,8 +4,6 @@
#include "vm/compiler/backend/slot.h"
-#ifndef DART_PRECOMPILED_RUNTIME
-
#include "vm/compiler/compiler_state.h"
#include "vm/hash_map.h"
#include "vm/parser.h"
@@ -227,11 +225,6 @@
is_nullable = false;
}
- if (field.is_late()) {
- // TODO(dartbug.com/40796): Extend CompileType to handle lateness.
- is_nullable = true;
- }
-
const Slot& slot = SlotCache::Instance(thread).Canonicalize(Slot(
Kind::kDartField,
IsImmutableBit::encode((field.is_final() && !field.is_late()) ||
@@ -323,5 +316,3 @@
}
} // namespace dart
-
-#endif // DART_PRECOMPILED_RUNTIME
diff --git a/runtime/vm/compiler/backend/slot.h b/runtime/vm/compiler/backend/slot.h
index 6f6faa8..8115c6a 100644
--- a/runtime/vm/compiler/backend/slot.h
+++ b/runtime/vm/compiler/backend/slot.h
@@ -24,6 +24,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_SLOT_H_
#define RUNTIME_VM_COMPILER_BACKEND_SLOT_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/compile_type.h"
#include "vm/thread.h"
diff --git a/runtime/vm/compiler/backend/type_propagator.cc b/runtime/vm/compiler/backend/type_propagator.cc
index 39e92e5..dc47a68 100644
--- a/runtime/vm/compiler/backend/type_propagator.cc
+++ b/runtime/vm/compiler/backend/type_propagator.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/backend/type_propagator.h"
#include "platform/text_buffer.h"
@@ -1750,5 +1748,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/backend/type_propagator.h b/runtime/vm/compiler/backend/type_propagator.h
index 65ef9f4..5c27420 100644
--- a/runtime/vm/compiler/backend/type_propagator.h
+++ b/runtime/vm/compiler/backend/type_propagator.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_BACKEND_TYPE_PROPAGATOR_H_
#define RUNTIME_VM_COMPILER_BACKEND_TYPE_PROPAGATOR_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
diff --git a/runtime/vm/compiler/call_specializer.cc b/runtime/vm/compiler/call_specializer.cc
index e074143..9f1ef36 100644
--- a/runtime/vm/compiler/call_specializer.cc
+++ b/runtime/vm/compiler/call_specializer.cc
@@ -2,7 +2,6 @@
// 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.
-#ifndef DART_PRECOMPILED_RUNTIME
#include "vm/compiler/call_specializer.h"
#include "vm/compiler/backend/flow_graph_compiler.h"
@@ -1794,4 +1793,3 @@
}
} // namespace dart
-#endif // DART_PRECOMPILED_RUNTIME
diff --git a/runtime/vm/compiler/call_specializer.h b/runtime/vm/compiler/call_specializer.h
index da606b0..c1be9a2 100644
--- a/runtime/vm/compiler/call_specializer.h
+++ b/runtime/vm/compiler/call_specializer.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_CALL_SPECIALIZER_H_
#define RUNTIME_VM_COMPILER_CALL_SPECIALIZER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
diff --git a/runtime/vm/compiler/cha.cc b/runtime/vm/compiler/cha.cc
index 53e2480..b7307f6 100644
--- a/runtime/vm/compiler/cha.cc
+++ b/runtime/vm/compiler/cha.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/cha.h"
#include "vm/class_table.h"
#include "vm/flags.h"
@@ -173,5 +171,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/cha.h b/runtime/vm/compiler/cha.h
index c132f10..dd1d5b3 100644
--- a/runtime/vm/compiler/cha.h
+++ b/runtime/vm/compiler/cha.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_CHA_H_
#define RUNTIME_VM_COMPILER_CHA_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
#include "vm/growable_array.h"
#include "vm/thread.h"
diff --git a/runtime/vm/compiler/compiler_pass.cc b/runtime/vm/compiler/compiler_pass.cc
index ed13b59..9bef093 100644
--- a/runtime/vm/compiler/compiler_pass.cc
+++ b/runtime/vm/compiler/compiler_pass.cc
@@ -4,8 +4,6 @@
#include "vm/compiler/compiler_pass.h"
-#ifndef DART_PRECOMPILED_RUNTIME
-
#include "vm/compiler/backend/block_scheduler.h"
#include "vm/compiler/backend/branch_optimizer.h"
#include "vm/compiler/backend/constant_propagator.h"
@@ -575,5 +573,3 @@
})
} // namespace dart
-
-#endif // DART_PRECOMPILED_RUNTIME
diff --git a/runtime/vm/compiler/compiler_pass.h b/runtime/vm/compiler/compiler_pass.h
index a5d4cdd..ffda7a6 100644
--- a/runtime/vm/compiler/compiler_pass.h
+++ b/runtime/vm/compiler/compiler_pass.h
@@ -5,7 +5,9 @@
#ifndef RUNTIME_VM_COMPILER_COMPILER_PASS_H_
#define RUNTIME_VM_COMPILER_COMPILER_PASS_H_
-#ifndef DART_PRECOMPILED_RUNTIME
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
#include <initializer_list>
@@ -201,6 +203,4 @@
} // namespace dart
-#endif
-
#endif // RUNTIME_VM_COMPILER_COMPILER_PASS_H_
diff --git a/runtime/vm/compiler/compiler_sources.gni b/runtime/vm/compiler/compiler_sources.gni
index 6b59f94..9445dfb 100644
--- a/runtime/vm/compiler/compiler_sources.gni
+++ b/runtime/vm/compiler/compiler_sources.gni
@@ -154,6 +154,9 @@
"stub_code_compiler_arm64.cc",
"stub_code_compiler_ia32.cc",
"stub_code_compiler_x64.cc",
+ "type_testing_stubs_arm.cc",
+ "type_testing_stubs_arm64.cc",
+ "type_testing_stubs_x64.cc",
"write_barrier_elimination.cc",
"write_barrier_elimination.h",
]
diff --git a/runtime/vm/compiler/compiler_state.h b/runtime/vm/compiler/compiler_state.h
index 619f25b..9baaceb 100644
--- a/runtime/vm/compiler/compiler_state.h
+++ b/runtime/vm/compiler/compiler_state.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_COMPILER_STATE_H_
#define RUNTIME_VM_COMPILER_COMPILER_STATE_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/api/deopt_id.h"
#include "vm/compiler/cha.h"
#include "vm/heap/safepoint.h"
diff --git a/runtime/vm/compiler/ffi/abi.h b/runtime/vm/compiler/ffi/abi.h
index 623374f..fb6f937 100644
--- a/runtime/vm/compiler/ffi/abi.h
+++ b/runtime/vm/compiler/ffi/abi.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_FFI_ABI_H_
#define RUNTIME_VM_COMPILER_FFI_ABI_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include <platform/globals.h>
namespace dart {
diff --git a/runtime/vm/compiler/ffi/call.cc b/runtime/vm/compiler/ffi/call.cc
index b13af64..40a4e6e 100644
--- a/runtime/vm/compiler/ffi/call.cc
+++ b/runtime/vm/compiler/ffi/call.cc
@@ -12,8 +12,6 @@
namespace ffi {
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
// TODO(dartbug.com/36607): Cache the trampolines.
RawFunction* TrampolineFunction(const Function& dart_signature,
const Function& c_signature) {
@@ -55,8 +53,6 @@
return function.raw();
}
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
-
} // namespace ffi
} // namespace compiler
diff --git a/runtime/vm/compiler/ffi/call.h b/runtime/vm/compiler/ffi/call.h
index 3680481..86a986b 100644
--- a/runtime/vm/compiler/ffi/call.h
+++ b/runtime/vm/compiler/ffi/call.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_FFI_CALL_H_
#define RUNTIME_VM_COMPILER_FFI_CALL_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include <platform/globals.h>
#include "vm/raw_object.h"
diff --git a/runtime/vm/compiler/ffi/callback.cc b/runtime/vm/compiler/ffi/callback.cc
index 94abfb8..6bd722a 100644
--- a/runtime/vm/compiler/ffi/callback.cc
+++ b/runtime/vm/compiler/ffi/callback.cc
@@ -12,8 +12,6 @@
namespace ffi {
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
RawFunction* NativeCallbackFunction(const Function& c_signature,
const Function& dart_target,
const Instance& exceptional_return) {
@@ -66,8 +64,6 @@
return function.raw();
}
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
-
} // namespace ffi
} // namespace compiler
diff --git a/runtime/vm/compiler/ffi/callback.h b/runtime/vm/compiler/ffi/callback.h
index ff432e6..4113ffa 100644
--- a/runtime/vm/compiler/ffi/callback.h
+++ b/runtime/vm/compiler/ffi/callback.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_FFI_CALLBACK_H_
#define RUNTIME_VM_COMPILER_FFI_CALLBACK_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include <platform/globals.h>
#include "vm/raw_object.h"
diff --git a/runtime/vm/compiler/ffi/frame_rebase.cc b/runtime/vm/compiler/ffi/frame_rebase.cc
index cc12a56..ee035ac 100644
--- a/runtime/vm/compiler/ffi/frame_rebase.cc
+++ b/runtime/vm/compiler/ffi/frame_rebase.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/ffi/frame_rebase.h"
namespace dart {
@@ -47,5 +45,3 @@
} // namespace compiler
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/ffi/frame_rebase.h b/runtime/vm/compiler/ffi/frame_rebase.h
index 33d8683..ba58a5c 100644
--- a/runtime/vm/compiler/ffi/frame_rebase.h
+++ b/runtime/vm/compiler/ffi/frame_rebase.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_FFI_FRAME_REBASE_H_
#define RUNTIME_VM_COMPILER_FFI_FRAME_REBASE_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/locations.h"
#include "vm/compiler/ffi/native_location.h"
#include "vm/compiler/ffi/native_type.h"
diff --git a/runtime/vm/compiler/ffi/marshaller.cc b/runtime/vm/compiler/ffi/marshaller.cc
index 53d1e21..009e031 100644
--- a/runtime/vm/compiler/ffi/marshaller.cc
+++ b/runtime/vm/compiler/ffi/marshaller.cc
@@ -17,8 +17,6 @@
namespace ffi {
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
Location CallMarshaller::LocInFfiCall(intptr_t arg_index) const {
if (arg_index == kResultIndex) {
return Location(arg_index).AsLocation();
@@ -154,8 +152,6 @@
CallbackArgumentTranslator::TranslateArgumentLocations(arg_locs_,
zone_)) {}
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
-
} // namespace ffi
} // namespace compiler
diff --git a/runtime/vm/compiler/ffi/marshaller.h b/runtime/vm/compiler/ffi/marshaller.h
index 19009bb..01704c7 100644
--- a/runtime/vm/compiler/ffi/marshaller.h
+++ b/runtime/vm/compiler/ffi/marshaller.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_FFI_MARSHALLER_H_
#define RUNTIME_VM_COMPILER_FFI_MARSHALLER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include <platform/globals.h>
#include "vm/compiler/backend/locations.h"
diff --git a/runtime/vm/compiler/ffi/native_calling_convention.cc b/runtime/vm/compiler/ffi/native_calling_convention.cc
index 13b01f3..032f583 100644
--- a/runtime/vm/compiler/ffi/native_calling_convention.cc
+++ b/runtime/vm/compiler/ffi/native_calling_convention.cc
@@ -16,8 +16,6 @@
namespace ffi {
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
// Argument #0 is the function pointer.
const intptr_t kNativeParamsStartAt = 1;
@@ -303,8 +301,6 @@
return Utils::RoundUp(max_height_in_bytes, compiler::target::kWordSize);
}
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
-
} // namespace ffi
} // namespace compiler
diff --git a/runtime/vm/compiler/ffi/native_calling_convention.h b/runtime/vm/compiler/ffi/native_calling_convention.h
index 459be7f..1524b6f 100644
--- a/runtime/vm/compiler/ffi/native_calling_convention.h
+++ b/runtime/vm/compiler/ffi/native_calling_convention.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_FFI_NATIVE_CALLING_CONVENTION_H_
#define RUNTIME_VM_COMPILER_FFI_NATIVE_CALLING_CONVENTION_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include <platform/globals.h>
#include "vm/compiler/backend/locations.h"
diff --git a/runtime/vm/compiler/ffi/native_location.cc b/runtime/vm/compiler/ffi/native_location.cc
index 918f341..27c0388 100644
--- a/runtime/vm/compiler/ffi/native_location.cc
+++ b/runtime/vm/compiler/ffi/native_location.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/ffi/native_location.h"
#include "vm/compiler/backend/il_printer.h"
@@ -340,5 +338,3 @@
} // namespace compiler
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/ffi/native_location.h b/runtime/vm/compiler/ffi/native_location.h
index a50872f..7db24e6 100644
--- a/runtime/vm/compiler/ffi/native_location.h
+++ b/runtime/vm/compiler/ffi/native_location.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_FFI_NATIVE_LOCATION_H_
#define RUNTIME_VM_COMPILER_FFI_NATIVE_LOCATION_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/locations.h"
#include "vm/compiler/ffi/native_type.h"
#include "vm/growable_array.h"
diff --git a/runtime/vm/compiler/ffi/recognized_method.h b/runtime/vm/compiler/ffi/recognized_method.h
index 0bd7dab..8cbfca8 100644
--- a/runtime/vm/compiler/ffi/recognized_method.h
+++ b/runtime/vm/compiler/ffi/recognized_method.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_FFI_RECOGNIZED_METHOD_H_
#define RUNTIME_VM_COMPILER_FFI_RECOGNIZED_METHOD_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include <platform/globals.h>
#include "vm/compiler/method_recognizer.h"
diff --git a/runtime/vm/compiler/frontend/base_flow_graph_builder.cc b/runtime/vm/compiler/frontend/base_flow_graph_builder.cc
index 53a60de..a60eb07 100644
--- a/runtime/vm/compiler/frontend/base_flow_graph_builder.cc
+++ b/runtime/vm/compiler/frontend/base_flow_graph_builder.cc
@@ -11,8 +11,6 @@
#include "vm/growable_array.h"
#include "vm/object_store.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -1146,5 +1144,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/base_flow_graph_builder.h b/runtime/vm/compiler/frontend/base_flow_graph_builder.h
index 8fed8b0..67448f0 100644
--- a/runtime/vm/compiler/frontend/base_flow_graph_builder.h
+++ b/runtime/vm/compiler/frontend/base_flow_graph_builder.h
@@ -5,14 +5,16 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_BASE_FLOW_GRAPH_BUILDER_H_
#define RUNTIME_VM_COMPILER_FRONTEND_BASE_FLOW_GRAPH_BUILDER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include <initializer_list>
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
#include "vm/object.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
class InlineExitCollector;
@@ -451,5 +453,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_BASE_FLOW_GRAPH_BUILDER_H_
diff --git a/runtime/vm/compiler/frontend/bytecode_fingerprints.cc b/runtime/vm/compiler/frontend/bytecode_fingerprints.cc
index 8a42a1e..78d621e 100644
--- a/runtime/vm/compiler/frontend/bytecode_fingerprints.cc
+++ b/runtime/vm/compiler/frontend/bytecode_fingerprints.cc
@@ -8,8 +8,6 @@
#include "vm/constants_kbc.h"
#include "vm/hash.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -207,5 +205,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/bytecode_fingerprints.h b/runtime/vm/compiler/frontend/bytecode_fingerprints.h
index ea79a92..78dbcff 100644
--- a/runtime/vm/compiler/frontend/bytecode_fingerprints.h
+++ b/runtime/vm/compiler/frontend/bytecode_fingerprints.h
@@ -5,11 +5,13 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FINGERPRINTS_H_
#define RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FINGERPRINTS_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "platform/allocation.h"
#include "vm/object.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -21,5 +23,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FINGERPRINTS_H_
diff --git a/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.cc b/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.cc
index 1d16d3b..5bcc3d8 100644
--- a/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.cc
+++ b/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.cc
@@ -13,8 +13,6 @@
#include "vm/stack_frame.h"
#include "vm/stack_frame_kbc.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#define B (flow_graph_builder_)
#define Z (zone_)
@@ -2348,5 +2346,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.h b/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.h
index 822a55e..c98d743 100644
--- a/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.h
+++ b/runtime/vm/compiler/frontend/bytecode_flow_graph_builder.h
@@ -5,13 +5,15 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FLOW_GRAPH_BUILDER_H_
#define RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FLOW_GRAPH_BUILDER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/il.h"
#include "vm/compiler/frontend/base_flow_graph_builder.h"
#include "vm/compiler/frontend/kernel_translation_helper.h" // For InferredTypeMetadata
#include "vm/constants_kbc.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -247,5 +249,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_FLOW_GRAPH_BUILDER_H_
diff --git a/runtime/vm/compiler/frontend/bytecode_reader.cc b/runtime/vm/compiler/frontend/bytecode_reader.cc
index fbc1a7e..d205058 100644
--- a/runtime/vm/compiler/frontend/bytecode_reader.cc
+++ b/runtime/vm/compiler/frontend/bytecode_reader.cc
@@ -24,8 +24,6 @@
#include "vm/stack_frame_kbc.h"
#include "vm/timeline.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#define Z (zone_)
#define H (translation_helper_)
#define I (translation_helper_.isolate())
@@ -2054,14 +2052,7 @@
field.set_is_extension_member(is_extension_member);
field.set_has_initializer(has_initializer);
- if (has_nontrivial_initializer) {
- if (field.is_late() && !is_static) {
- // Late fields are initialized to Object::sentinel, which is a flavor of
- // null. So we need to record that store so that the field guard doesn't
- // prematurely optimise out the late field's sentinel checking logic.
- field.RecordStore(Object::null_object());
- }
- } else {
+ if (!has_nontrivial_initializer) {
value ^= ReadObject();
if (is_static) {
if (field.is_late() && !has_initializer) {
@@ -3732,5 +3723,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/bytecode_reader.h b/runtime/vm/compiler/frontend/bytecode_reader.h
index 2afd9dd..81abc86 100644
--- a/runtime/vm/compiler/frontend/bytecode_reader.h
+++ b/runtime/vm/compiler/frontend/bytecode_reader.h
@@ -5,12 +5,14 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_READER_H_
#define RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_READER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/frontend/kernel_translation_helper.h"
#include "vm/constants_kbc.h"
#include "vm/object.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -582,5 +584,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_READER_H_
diff --git a/runtime/vm/compiler/frontend/bytecode_scope_builder.cc b/runtime/vm/compiler/frontend/bytecode_scope_builder.cc
index e7283f6..af47f51 100644
--- a/runtime/vm/compiler/frontend/bytecode_scope_builder.cc
+++ b/runtime/vm/compiler/frontend/bytecode_scope_builder.cc
@@ -6,8 +6,6 @@
#include "vm/compiler/frontend/bytecode_reader.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -189,5 +187,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/bytecode_scope_builder.h b/runtime/vm/compiler/frontend/bytecode_scope_builder.h
index 4436565..8f96b87 100644
--- a/runtime/vm/compiler/frontend/bytecode_scope_builder.h
+++ b/runtime/vm/compiler/frontend/bytecode_scope_builder.h
@@ -5,7 +5,9 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_SCOPE_BUILDER_H_
#define RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_SCOPE_BUILDER_H_
-#if !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
#include "vm/object.h"
#include "vm/parser.h" // For ParsedFunction.
@@ -36,5 +38,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_SCOPE_BUILDER_H_
diff --git a/runtime/vm/compiler/frontend/constant_reader.cc b/runtime/vm/compiler/frontend/constant_reader.cc
index 23a30d3..08fd420 100644
--- a/runtime/vm/compiler/frontend/constant_reader.cc
+++ b/runtime/vm/compiler/frontend/constant_reader.cc
@@ -4,8 +4,6 @@
#include "vm/compiler/frontend/constant_reader.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -328,5 +326,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/constant_reader.h b/runtime/vm/compiler/frontend/constant_reader.h
index c5a7574..8e7a519 100644
--- a/runtime/vm/compiler/frontend/constant_reader.h
+++ b/runtime/vm/compiler/frontend/constant_reader.h
@@ -5,7 +5,9 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_CONSTANT_READER_H_
#define RUNTIME_VM_COMPILER_FRONTEND_CONSTANT_READER_H_
-#if !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/frontend/kernel_translation_helper.h"
#include "vm/hash_table.h"
@@ -80,5 +82,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_CONSTANT_READER_H_
diff --git a/runtime/vm/compiler/frontend/flow_graph_builder.cc b/runtime/vm/compiler/frontend/flow_graph_builder.cc
index 9d8855f..4a13620 100644
--- a/runtime/vm/compiler/frontend/flow_graph_builder.cc
+++ b/runtime/vm/compiler/frontend/flow_graph_builder.cc
@@ -2,8 +2,6 @@
// 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.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/frontend/flow_graph_builder.h"
#include "vm/compiler/backend/branch_optimizer.h"
@@ -390,5 +388,3 @@
}
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/flow_graph_builder.h b/runtime/vm/compiler/frontend/flow_graph_builder.h
index 71e573c..f2d5364 100644
--- a/runtime/vm/compiler/frontend/flow_graph_builder.h
+++ b/runtime/vm/compiler/frontend/flow_graph_builder.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_FLOW_GRAPH_BUILDER_H_
#define RUNTIME_VM_COMPILER_FRONTEND_FLOW_GRAPH_BUILDER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "platform/assert.h"
#include "platform/globals.h"
#include "vm/allocation.h"
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
index b0dd414..61f3c73 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -13,8 +13,6 @@
#include "vm/object_store.h"
#include "vm/stack_frame.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
DECLARE_FLAG(bool, enable_interpreter);
@@ -5270,5 +5268,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
index d782e5d..4a383ad 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
@@ -5,7 +5,9 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_KERNEL_BINARY_FLOWGRAPH_H_
#define RUNTIME_VM_COMPILER_FRONTEND_KERNEL_BINARY_FLOWGRAPH_H_
-#if !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/frontend/bytecode_reader.h"
#include "vm/compiler/frontend/constant_reader.h"
@@ -382,5 +384,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_KERNEL_BINARY_FLOWGRAPH_H_
diff --git a/runtime/vm/compiler/frontend/kernel_fingerprints.cc b/runtime/vm/compiler/frontend/kernel_fingerprints.cc
index 4247dae..b20ba94 100644
--- a/runtime/vm/compiler/frontend/kernel_fingerprints.cc
+++ b/runtime/vm/compiler/frontend/kernel_fingerprints.cc
@@ -5,8 +5,6 @@
#include "vm/compiler/frontend/kernel_fingerprints.h"
#include "vm/compiler/frontend/kernel_translation_helper.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#define H (translation_helper_)
#define I Isolate::Current()
@@ -880,5 +878,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/kernel_fingerprints.h b/runtime/vm/compiler/frontend/kernel_fingerprints.h
index 601a488a..588d51f 100644
--- a/runtime/vm/compiler/frontend/kernel_fingerprints.h
+++ b/runtime/vm/compiler/frontend/kernel_fingerprints.h
@@ -5,11 +5,13 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_KERNEL_FINGERPRINTS_H_
#define RUNTIME_VM_COMPILER_FRONTEND_KERNEL_FINGERPRINTS_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "platform/allocation.h"
#include "vm/object.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -23,5 +25,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_KERNEL_FINGERPRINTS_H_
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.cc b/runtime/vm/compiler/frontend/kernel_to_il.cc
index 138d13d..7f0f7a1 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.cc
+++ b/runtime/vm/compiler/frontend/kernel_to_il.cc
@@ -24,8 +24,6 @@
#include "vm/resolver.h"
#include "vm/stack_frame.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -3023,5 +3021,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.h b/runtime/vm/compiler/frontend/kernel_to_il.h
index a61c5b1..9e798c8 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.h
+++ b/runtime/vm/compiler/frontend/kernel_to_il.h
@@ -5,7 +5,9 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TO_IL_H_
#define RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TO_IL_H_
-#if !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
#include "vm/growable_array.h"
#include "vm/hash_map.h"
@@ -669,5 +671,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TO_IL_H_
diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.cc b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
index c56e34a..c9aa6d8 100644
--- a/runtime/vm/compiler/frontend/kernel_translation_helper.cc
+++ b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
@@ -14,8 +14,6 @@
#include "vm/parser.h" // for ParsedFunction
#include "vm/symbols.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#define Z (zone_)
#define H (translation_helper_)
#define T (type_translator_)
@@ -3525,5 +3523,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.h b/runtime/vm/compiler/frontend/kernel_translation_helper.h
index 9fb8301..6192f88 100644
--- a/runtime/vm/compiler/frontend/kernel_translation_helper.h
+++ b/runtime/vm/compiler/frontend/kernel_translation_helper.h
@@ -5,13 +5,15 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_
#define RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/backend/il.h" // For CompileType.
#include "vm/kernel.h"
#include "vm/kernel_binary.h"
#include "vm/object.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -1505,5 +1507,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_
diff --git a/runtime/vm/compiler/frontend/prologue_builder.cc b/runtime/vm/compiler/frontend/prologue_builder.cc
index 71fff65..ea3375b 100644
--- a/runtime/vm/compiler/frontend/prologue_builder.cc
+++ b/runtime/vm/compiler/frontend/prologue_builder.cc
@@ -15,7 +15,6 @@
#include "vm/resolver.h"
#include "vm/stack_frame.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
namespace dart {
namespace kernel {
@@ -530,5 +529,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/prologue_builder.h b/runtime/vm/compiler/frontend/prologue_builder.h
index 3f58e13..2d2d502 100644
--- a/runtime/vm/compiler/frontend/prologue_builder.h
+++ b/runtime/vm/compiler/frontend/prologue_builder.h
@@ -5,7 +5,9 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_PROLOGUE_BUILDER_H_
#define RUNTIME_VM_COMPILER_FRONTEND_PROLOGUE_BUILDER_H_
-#if !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/frontend/base_flow_graph_builder.h"
@@ -90,5 +92,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_PROLOGUE_BUILDER_H_
diff --git a/runtime/vm/compiler/frontend/scope_builder.cc b/runtime/vm/compiler/frontend/scope_builder.cc
index 81157c7..ed32087 100644
--- a/runtime/vm/compiler/frontend/scope_builder.cc
+++ b/runtime/vm/compiler/frontend/scope_builder.cc
@@ -7,8 +7,6 @@
#include "vm/compiler/backend/il.h" // For CompileType.
#include "vm/compiler/frontend/kernel_translation_helper.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
namespace kernel {
@@ -1858,5 +1856,3 @@
} // namespace kernel
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/scope_builder.h b/runtime/vm/compiler/frontend/scope_builder.h
index 391f971..4f53fbd 100644
--- a/runtime/vm/compiler/frontend/scope_builder.h
+++ b/runtime/vm/compiler/frontend/scope_builder.h
@@ -5,7 +5,9 @@
#ifndef RUNTIME_VM_COMPILER_FRONTEND_SCOPE_BUILDER_H_
#define RUNTIME_VM_COMPILER_FRONTEND_SCOPE_BUILDER_H_
-#if !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/frontend/constant_reader.h"
#include "vm/compiler/frontend/kernel_translation_helper.h"
@@ -237,5 +239,4 @@
} // namespace kernel
} // namespace dart
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
#endif // RUNTIME_VM_COMPILER_FRONTEND_SCOPE_BUILDER_H_
diff --git a/runtime/vm/compiler/graph_intrinsifier.cc b/runtime/vm/compiler/graph_intrinsifier.cc
index af792ff..994b5c7 100644
--- a/runtime/vm/compiler/graph_intrinsifier.cc
+++ b/runtime/vm/compiler/graph_intrinsifier.cc
@@ -3,8 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
// Class for intrinsifying functions.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/graph_intrinsifier.h"
#include "vm/compiler/backend/block_builder.h"
#include "vm/compiler/backend/flow_graph.h"
@@ -1074,5 +1072,3 @@
} // namespace compiler
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/graph_intrinsifier.h b/runtime/vm/compiler/graph_intrinsifier.h
index 3e398f1..c122b5c 100644
--- a/runtime/vm/compiler/graph_intrinsifier.h
+++ b/runtime/vm/compiler/graph_intrinsifier.h
@@ -6,6 +6,10 @@
#ifndef RUNTIME_VM_COMPILER_GRAPH_INTRINSIFIER_H_
#define RUNTIME_VM_COMPILER_GRAPH_INTRINSIFIER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
#include "vm/compiler/recognized_methods_list.h"
diff --git a/runtime/vm/compiler/graph_intrinsifier_arm.cc b/runtime/vm/compiler/graph_intrinsifier_arm.cc
index 39b30c2..cc8dc4c 100644
--- a/runtime/vm/compiler/graph_intrinsifier_arm.cc
+++ b/runtime/vm/compiler/graph_intrinsifier_arm.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
-#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM)
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/graph_intrinsifier.h"
@@ -42,4 +42,4 @@
} // namespace compiler
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM)
diff --git a/runtime/vm/compiler/graph_intrinsifier_arm64.cc b/runtime/vm/compiler/graph_intrinsifier_arm64.cc
index 0dc98a7..9bd2ae5 100644
--- a/runtime/vm/compiler/graph_intrinsifier_arm64.cc
+++ b/runtime/vm/compiler/graph_intrinsifier_arm64.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
-#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM64)
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/graph_intrinsifier.h"
@@ -47,4 +47,4 @@
} // namespace compiler
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM64)
diff --git a/runtime/vm/compiler/graph_intrinsifier_ia32.cc b/runtime/vm/compiler/graph_intrinsifier_ia32.cc
index e89c176..6e29ff5 100644
--- a/runtime/vm/compiler/graph_intrinsifier_ia32.cc
+++ b/runtime/vm/compiler/graph_intrinsifier_ia32.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
-#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_IA32)
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/graph_intrinsifier.h"
@@ -34,4 +34,4 @@
} // namespace compiler
} // namespace dart
-#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_IA32)
diff --git a/runtime/vm/compiler/graph_intrinsifier_x64.cc b/runtime/vm/compiler/graph_intrinsifier_x64.cc
index 46a8004..58c02b2 100644
--- a/runtime/vm/compiler/graph_intrinsifier_x64.cc
+++ b/runtime/vm/compiler/graph_intrinsifier_x64.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
-#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_X64)
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/graph_intrinsifier.h"
@@ -42,4 +42,4 @@
} // namespace compiler
} // namespace dart
-#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_X64)
diff --git a/runtime/vm/compiler/intrinsifier.cc b/runtime/vm/compiler/intrinsifier.cc
index 73daa5b..7c6d764 100644
--- a/runtime/vm/compiler/intrinsifier.cc
+++ b/runtime/vm/compiler/intrinsifier.cc
@@ -3,8 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
// Class for intrinsifying functions.
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/intrinsifier.h"
#include "vm/compiler/assembler/assembler.h"
@@ -76,7 +74,6 @@
return true;
}
-#if !defined(DART_PRECOMPILED_RUNTIME)
struct IntrinsicDesc {
const char* class_name;
const char* function_name;
@@ -172,7 +169,6 @@
}
#undef SETUP_FUNCTION
}
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
// Returns true if fall-through code can be omitted.
bool Intrinsifier::Intrinsify(const ParsedFunction& parsed_function,
@@ -238,5 +234,3 @@
} // namespace compiler
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/intrinsifier.h b/runtime/vm/compiler/intrinsifier.h
index 3aa9148..f8895a4 100644
--- a/runtime/vm/compiler/intrinsifier.h
+++ b/runtime/vm/compiler/intrinsifier.h
@@ -6,6 +6,10 @@
#ifndef RUNTIME_VM_COMPILER_INTRINSIFIER_H_
#define RUNTIME_VM_COMPILER_INTRINSIFIER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
#include "vm/compiler/asm_intrinsifier.h"
#include "vm/compiler/graph_intrinsifier.h"
@@ -26,9 +30,8 @@
public:
static bool Intrinsify(const ParsedFunction& parsed_function,
FlowGraphCompiler* compiler);
-#if !defined(DART_PRECOMPILED_RUNTIME)
+
static void InitializeState();
-#endif
private:
static bool CanIntrinsify(const Function& function);
diff --git a/runtime/vm/compiler/jit/jit_call_specializer.cc b/runtime/vm/compiler/jit/jit_call_specializer.cc
index cfff542..688084b 100644
--- a/runtime/vm/compiler/jit/jit_call_specializer.cc
+++ b/runtime/vm/compiler/jit/jit_call_specializer.cc
@@ -1,7 +1,6 @@
// Copyright (c) 2013, 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.
-#ifndef DART_PRECOMPILED_RUNTIME
#include "vm/compiler/jit/jit_call_specializer.h"
#include "vm/bit_vector.h"
@@ -279,4 +278,3 @@
}
} // namespace dart
-#endif // DART_PRECOMPILED_RUNTIME
diff --git a/runtime/vm/compiler/jit/jit_call_specializer.h b/runtime/vm/compiler/jit/jit_call_specializer.h
index ea35fa9..8c743ed 100644
--- a/runtime/vm/compiler/jit/jit_call_specializer.h
+++ b/runtime/vm/compiler/jit/jit_call_specializer.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_JIT_JIT_CALL_SPECIALIZER_H_
#define RUNTIME_VM_COMPILER_JIT_JIT_CALL_SPECIALIZER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/compiler/call_specializer.h"
namespace dart {
diff --git a/runtime/vm/compiler/method_recognizer.cc b/runtime/vm/compiler/method_recognizer.cc
index 99d186f..9fb302e 100644
--- a/runtime/vm/compiler/method_recognizer.cc
+++ b/runtime/vm/compiler/method_recognizer.cc
@@ -194,7 +194,6 @@
return "?";
}
-#if !defined(DART_PRECOMPILED_RUNTIME)
void MethodRecognizer::InitializeState() {
GrowableArray<Library*> libs(3);
Libraries(&libs);
@@ -257,7 +256,6 @@
libs->Add(&Library::ZoneHandle(Library::AsyncLibrary()));
libs->Add(&Library::ZoneHandle(Library::FfiLibrary()));
}
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
Token::Kind MethodTokenRecognizer::RecognizeTokenKind(const String& name_) {
Thread* thread = Thread::Current();
diff --git a/runtime/vm/compiler/method_recognizer.h b/runtime/vm/compiler/method_recognizer.h
index 1cf5d5b..7a34c46 100644
--- a/runtime/vm/compiler/method_recognizer.h
+++ b/runtime/vm/compiler/method_recognizer.h
@@ -55,12 +55,10 @@
static intptr_t MethodKindToReceiverCid(Kind kind);
static const char* KindToCString(Kind kind);
-#if !defined(DART_PRECOMPILED_RUNTIME)
static void InitializeState();
private:
static void Libraries(GrowableArray<Library*>* libs);
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
};
// Recognizes token corresponding to a method name.
@@ -69,13 +67,11 @@
static Token::Kind RecognizeTokenKind(const String& name);
};
-#if !defined(DART_PRECOMPILED_RUNTIME)
#define CHECK_FINGERPRINT2(f, p0, p1, fp) \
ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp))
#define CHECK_FINGERPRINT3(f, p0, p1, p2, fp) \
ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp))
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
// Class that recognizes factories and returns corresponding result cid.
class FactoryRecognizer : public AllStatic {
diff --git a/runtime/vm/compiler/relocation.cc b/runtime/vm/compiler/relocation.cc
index 3835d55..e72a3b1 100644
--- a/runtime/vm/compiler/relocation.cc
+++ b/runtime/vm/compiler/relocation.cc
@@ -31,6 +31,7 @@
GrowableArray<RawCode*>* code_objects,
GrowableArray<ImageWriterCommand>* commands)
: StackResource(thread),
+ thread_(thread),
code_objects_(code_objects),
commands_(commands),
kind_type_and_offset_(Smi::Handle(thread->zone())),
@@ -103,7 +104,7 @@
}
void CodeRelocator::FindInstructionAndCallLimits() {
- Zone* zone = Thread::Current()->zone();
+ auto zone = thread_->zone();
auto& current_caller = Code::Handle(zone);
auto& call_targets = Array::Handle(zone);
@@ -131,19 +132,14 @@
if (kind == Code::kCallViaCode) {
continue;
}
- num_calls++;
- // The precompiler should have already replaced all function entries
- // with code entries.
- ASSERT(call.Get<Code::kSCallTableFunctionTarget>() == Function::null());
- target_ = call.Get<Code::kSCallTableCodeTarget>();
- ASSERT(target_.IsCode());
- destination_ = Code::Cast(target_).raw();
+ destination_ = GetTarget(call);
+ num_calls++;
// A call site can decide to jump not to the beginning of a function but
// rather jump into it at a certain (positive) offset.
int32_t offset_into_target = 0;
- if (kind == Code::kPcRelativeCall) {
+ if (kind == Code::kPcRelativeCall || kind == Code::kPcRelativeTTSCall) {
const intptr_t call_instruction_offset =
return_pc_offset - PcRelativeCallPattern::kLengthInBytes;
PcRelativeCallPattern call(current_caller.PayloadStart() +
@@ -251,19 +247,14 @@
continue;
}
- // The precompiler should have already replaced all function entries
- // with code entries.
- ASSERT(call.Get<Code::kSCallTableFunctionTarget>() == Function::null());
- target_ = call.Get<Code::kSCallTableCodeTarget>();
- ASSERT(target_.IsCode());
- destination_ = Code::Cast(target_).raw();
+ destination_ = GetTarget(call);
// A call site can decide to jump not to the beginning of a function but
// rather jump into it at a certain offset.
int32_t offset_into_target = 0;
bool is_tail_call;
intptr_t call_instruction_offset;
- if (kind == Code::kPcRelativeCall) {
+ if (kind == Code::kPcRelativeCall || kind == Code::kPcRelativeTTSCall) {
call_instruction_offset =
return_pc_offset - PcRelativeCallPattern::kLengthInBytes;
PcRelativeCallPattern call(code.PayloadStart() + call_instruction_offset);
@@ -431,6 +422,51 @@
}
}
+RawCode* CodeRelocator::GetTarget(const StaticCallsTableEntry& call) {
+ // The precompiler should have already replaced all function entries
+ // with code entries.
+ ASSERT(call.Get<Code::kSCallTableFunctionTarget>() == Function::null());
+
+ target_ = call.Get<Code::kSCallTableCodeOrTypeTarget>();
+ if (target_.IsAbstractType()) {
+ target_ = AbstractType::Cast(target_).type_test_stub();
+ destination_ = Code::Cast(target_).raw();
+
+ // The AssertAssignableInstr will emit pc-relative calls to the TTS iff
+ // dst_type is instantiated. If we happened to not install an optimized
+ // TTS but rather a default one, it will live in the vm-isolate (to
+ // which we cannot make pc-relative calls).
+ // Though we have "equivalent" isolate-specific stubs we can use as
+ // targets instead.
+ //
+ // (We could make the AOT compiler install isolate-specific stubs
+ // into the types directly, but that does not work for types which
+ // live in the "vm-isolate" - such as `Type::dynamic_type()`).
+ if (destination_.InVMIsolateHeap()) {
+ auto object_store = thread_->isolate()->object_store();
+ if (destination_.raw() == StubCode::DefaultTypeTest().raw()) {
+ destination_ = object_store->default_tts_stub();
+ } else if (destination_.raw() ==
+ StubCode::DefaultNullableTypeTest().raw()) {
+ destination_ = object_store->default_nullable_tts_stub();
+ } else if (destination_.raw() == StubCode::TopTypeTypeTest().raw()) {
+ destination_ = object_store->top_type_tts_stub();
+ } else if (destination_.raw() == StubCode::UnreachableTypeTest().raw()) {
+ destination_ = object_store->unreachable_tts_stub();
+ } else if (destination_.raw() == StubCode::SlowTypeTest().raw()) {
+ destination_ = object_store->slow_tts_stub();
+ } else {
+ UNREACHABLE();
+ }
+ }
+ } else {
+ ASSERT(target_.IsCode());
+ destination_ = Code::Cast(target_).raw();
+ }
+ ASSERT(!destination_.InVMIsolateHeap());
+ return destination_.raw();
+}
+
static void MarkAsFreeListElement(uint8_t* trampoline_bytes,
intptr_t trampoline_length) {
uint32_t tags = 0;
diff --git a/runtime/vm/compiler/relocation.h b/runtime/vm/compiler/relocation.h
index b373989..7094c94 100644
--- a/runtime/vm/compiler/relocation.h
+++ b/runtime/vm/compiler/relocation.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_RELOCATION_H_
#define RUNTIME_VM_COMPILER_RELOCATION_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
#include "vm/image_snapshot.h"
#include "vm/intrusive_dlist.h"
@@ -189,9 +193,12 @@
bool IsTargetInRangeFor(UnresolvedCall* unresolved_call,
intptr_t target_text_offset);
+ RawCode* GetTarget(const StaticCallsTableEntry& entry);
+
// The code relocation happens during AOT snapshot writing and operates on raw
// objects. No allocations can be done.
NoSafepointScope no_savepoint_scope_;
+ Thread* thread_;
const GrowableArray<RawCode*>* code_objects_;
GrowableArray<ImageWriterCommand>* commands_;
diff --git a/runtime/vm/compiler/runtime_api.h b/runtime/vm/compiler/runtime_api.h
index c7f3303..d3c21b9 100644
--- a/runtime/vm/compiler/runtime_api.h
+++ b/runtime/vm/compiler/runtime_api.h
@@ -973,6 +973,7 @@
static word allocate_object_entry_point_offset();
static word allocate_object_parameterized_entry_point_offset();
static word allocate_object_slow_entry_point_offset();
+ static word slow_type_test_entry_point_offset();
static word write_barrier_entry_point_offset();
static word vm_tag_offset();
static uword vm_tag_compiled_id();
diff --git a/runtime/vm/compiler/runtime_offsets_extracted.h b/runtime/vm/compiler/runtime_offsets_extracted.h
index b956285..7288034 100644
--- a/runtime/vm/compiler/runtime_offsets_extracted.h
+++ b/runtime/vm/compiler/runtime_offsets_extracted.h
@@ -191,11 +191,11 @@
static constexpr dart::compiler::target::word String_length_offset = 4;
static constexpr dart::compiler::target::word SubtypeTestCache_cache_offset = 4;
static constexpr dart::compiler::target::word
- Thread_AllocateArray_entry_point_offset = 364;
+ Thread_AllocateArray_entry_point_offset = 368;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 684;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
688;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 692;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -223,16 +223,16 @@
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
96;
static constexpr dart::compiler::target::word
- Thread_auto_scope_native_wrapper_entry_point_offset = 324;
+ Thread_auto_scope_native_wrapper_entry_point_offset = 328;
static constexpr dart::compiler::target::word Thread_bool_false_offset = 120;
static constexpr dart::compiler::target::word Thread_bool_true_offset = 116;
static constexpr dart::compiler::target::word
- Thread_bootstrap_native_wrapper_entry_point_offset = 316;
+ Thread_bootstrap_native_wrapper_entry_point_offset = 320;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_entry_point_offset = 264;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 148;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 720;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 724;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -243,14 +243,14 @@
static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset =
224;
static constexpr dart::compiler::target::word Thread_double_abs_address_offset =
- 344;
+ 348;
static constexpr dart::compiler::target::word
- Thread_double_negate_address_offset = 340;
+ Thread_double_negate_address_offset = 344;
static constexpr dart::compiler::target::word Thread_end_offset = 56;
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 244;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 704;
+ 708;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 248;
static constexpr dart::compiler::target::word
@@ -262,17 +262,17 @@
static constexpr dart::compiler::target::word
Thread_fix_callers_target_code_offset = 132;
static constexpr dart::compiler::target::word
- Thread_float_absolute_address_offset = 356;
+ Thread_float_absolute_address_offset = 360;
static constexpr dart::compiler::target::word
- Thread_float_negate_address_offset = 352;
+ Thread_float_negate_address_offset = 356;
static constexpr dart::compiler::target::word Thread_float_not_address_offset =
- 348;
+ 352;
static constexpr dart::compiler::target::word
- Thread_float_zerow_address_offset = 360;
+ Thread_float_zerow_address_offset = 364;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 692;
+ 696;
static constexpr dart::compiler::target::word
- Thread_interpret_call_entry_point_offset = 328;
+ Thread_interpret_call_entry_point_offset = 332;
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_from_bytecode_stub_offset = 144;
static constexpr dart::compiler::target::word
@@ -295,7 +295,7 @@
static constexpr dart::compiler::target::word
Thread_switchable_call_miss_stub_offset = 204;
static constexpr dart::compiler::target::word
- Thread_no_scope_native_wrapper_entry_point_offset = 320;
+ Thread_no_scope_native_wrapper_entry_point_offset = 324;
static constexpr dart::compiler::target::word
Thread_null_error_shared_with_fpu_regs_stub_offset = 156;
static constexpr dart::compiler::target::word
@@ -310,14 +310,16 @@
Thread_range_error_shared_without_fpu_regs_stub_offset = 168;
static constexpr dart::compiler::target::word Thread_object_null_offset = 112;
static constexpr dart::compiler::target::word
- Thread_predefined_symbols_address_offset = 332;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 696;
+ Thread_predefined_symbols_address_offset = 336;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 700;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 700;
+ Thread_saved_shadow_call_stack_offset = 704;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 708;
+ 712;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 236;
+static constexpr dart::compiler::target::word
+ Thread_slow_type_test_entry_point_offset = 316;
static constexpr dart::compiler::target::word Thread_stack_limit_offset = 36;
static constexpr dart::compiler::target::word Thread_saved_stack_limit_offset =
60;
@@ -346,7 +348,7 @@
Thread_write_barrier_entry_point_offset = 256;
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
40;
-static constexpr dart::compiler::target::word Thread_callback_code_offset = 712;
+static constexpr dart::compiler::target::word Thread_callback_code_offset = 716;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 12;
static constexpr dart::compiler::target::word Type_arguments_offset = 16;
@@ -384,7 +386,7 @@
4, 12, 8, 16};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 652, 656, 660, 664, 668, -1, 672, -1, 676, 680, -1, -1, -1, -1, -1, -1};
+ 656, 660, 664, 668, 672, -1, 676, -1, 680, 684, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 8;
static constexpr dart::compiler::target::word Array_InstanceSize = 12;
static constexpr dart::compiler::target::word Array_header_size = 12;
@@ -667,11 +669,11 @@
static constexpr dart::compiler::target::word String_length_offset = 8;
static constexpr dart::compiler::target::word SubtypeTestCache_cache_offset = 8;
static constexpr dart::compiler::target::word
- Thread_AllocateArray_entry_point_offset = 712;
+ Thread_AllocateArray_entry_point_offset = 720;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 1376;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
1384;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 1392;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -699,16 +701,16 @@
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
192;
static constexpr dart::compiler::target::word
- Thread_auto_scope_native_wrapper_entry_point_offset = 632;
+ Thread_auto_scope_native_wrapper_entry_point_offset = 640;
static constexpr dart::compiler::target::word Thread_bool_false_offset = 224;
static constexpr dart::compiler::target::word Thread_bool_true_offset = 216;
static constexpr dart::compiler::target::word
- Thread_bootstrap_native_wrapper_entry_point_offset = 616;
+ Thread_bootstrap_native_wrapper_entry_point_offset = 624;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_entry_point_offset = 512;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 280;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1448;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1456;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -719,14 +721,14 @@
static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset =
432;
static constexpr dart::compiler::target::word Thread_double_abs_address_offset =
- 672;
+ 680;
static constexpr dart::compiler::target::word
- Thread_double_negate_address_offset = 664;
+ Thread_double_negate_address_offset = 672;
static constexpr dart::compiler::target::word Thread_end_offset = 112;
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 472;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 1416;
+ 1424;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 480;
static constexpr dart::compiler::target::word
@@ -738,17 +740,17 @@
static constexpr dart::compiler::target::word
Thread_fix_callers_target_code_offset = 248;
static constexpr dart::compiler::target::word
- Thread_float_absolute_address_offset = 696;
+ Thread_float_absolute_address_offset = 704;
static constexpr dart::compiler::target::word
- Thread_float_negate_address_offset = 688;
+ Thread_float_negate_address_offset = 696;
static constexpr dart::compiler::target::word Thread_float_not_address_offset =
- 680;
+ 688;
static constexpr dart::compiler::target::word
- Thread_float_zerow_address_offset = 704;
+ Thread_float_zerow_address_offset = 712;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 1392;
+ 1400;
static constexpr dart::compiler::target::word
- Thread_interpret_call_entry_point_offset = 640;
+ Thread_interpret_call_entry_point_offset = 648;
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_from_bytecode_stub_offset = 272;
static constexpr dart::compiler::target::word
@@ -771,7 +773,7 @@
static constexpr dart::compiler::target::word
Thread_switchable_call_miss_stub_offset = 392;
static constexpr dart::compiler::target::word
- Thread_no_scope_native_wrapper_entry_point_offset = 624;
+ Thread_no_scope_native_wrapper_entry_point_offset = 632;
static constexpr dart::compiler::target::word
Thread_null_error_shared_with_fpu_regs_stub_offset = 296;
static constexpr dart::compiler::target::word
@@ -786,14 +788,16 @@
Thread_range_error_shared_without_fpu_regs_stub_offset = 320;
static constexpr dart::compiler::target::word Thread_object_null_offset = 208;
static constexpr dart::compiler::target::word
- Thread_predefined_symbols_address_offset = 648;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1400;
+ Thread_predefined_symbols_address_offset = 656;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1408;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 1408;
+ Thread_saved_shadow_call_stack_offset = 1416;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 1424;
+ 1432;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 456;
+static constexpr dart::compiler::target::word
+ Thread_slow_type_test_entry_point_offset = 616;
static constexpr dart::compiler::target::word Thread_stack_limit_offset = 72;
static constexpr dart::compiler::target::word Thread_saved_stack_limit_offset =
120;
@@ -823,7 +827,7 @@
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
80;
static constexpr dart::compiler::target::word Thread_callback_code_offset =
- 1432;
+ 1440;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset =
16;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 16;
@@ -862,8 +866,8 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 1288, 1296, 1304, 1312, -1, -1, 1320, 1328,
- 1336, 1344, 1352, -1, 1360, 1368, -1, -1};
+ 1296, 1304, 1312, 1320, -1, -1, 1328, 1336,
+ 1344, 1352, 1360, -1, 1368, 1376, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word Array_InstanceSize = 24;
static constexpr dart::compiler::target::word Array_header_size = 24;
@@ -1144,11 +1148,11 @@
static constexpr dart::compiler::target::word String_length_offset = 4;
static constexpr dart::compiler::target::word SubtypeTestCache_cache_offset = 4;
static constexpr dart::compiler::target::word
- Thread_AllocateArray_entry_point_offset = 364;
+ Thread_AllocateArray_entry_point_offset = 368;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 652;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
656;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 660;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -1176,16 +1180,16 @@
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
96;
static constexpr dart::compiler::target::word
- Thread_auto_scope_native_wrapper_entry_point_offset = 324;
+ Thread_auto_scope_native_wrapper_entry_point_offset = 328;
static constexpr dart::compiler::target::word Thread_bool_false_offset = 120;
static constexpr dart::compiler::target::word Thread_bool_true_offset = 116;
static constexpr dart::compiler::target::word
- Thread_bootstrap_native_wrapper_entry_point_offset = 316;
+ Thread_bootstrap_native_wrapper_entry_point_offset = 320;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_entry_point_offset = 264;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 148;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 688;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 692;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -1196,14 +1200,14 @@
static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset =
224;
static constexpr dart::compiler::target::word Thread_double_abs_address_offset =
- 344;
+ 348;
static constexpr dart::compiler::target::word
- Thread_double_negate_address_offset = 340;
+ Thread_double_negate_address_offset = 344;
static constexpr dart::compiler::target::word Thread_end_offset = 56;
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 244;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 672;
+ 676;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 248;
static constexpr dart::compiler::target::word
@@ -1215,17 +1219,17 @@
static constexpr dart::compiler::target::word
Thread_fix_callers_target_code_offset = 132;
static constexpr dart::compiler::target::word
- Thread_float_absolute_address_offset = 356;
+ Thread_float_absolute_address_offset = 360;
static constexpr dart::compiler::target::word
- Thread_float_negate_address_offset = 352;
+ Thread_float_negate_address_offset = 356;
static constexpr dart::compiler::target::word Thread_float_not_address_offset =
- 348;
+ 352;
static constexpr dart::compiler::target::word
- Thread_float_zerow_address_offset = 360;
+ Thread_float_zerow_address_offset = 364;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 660;
+ 664;
static constexpr dart::compiler::target::word
- Thread_interpret_call_entry_point_offset = 328;
+ Thread_interpret_call_entry_point_offset = 332;
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_from_bytecode_stub_offset = 144;
static constexpr dart::compiler::target::word
@@ -1248,7 +1252,7 @@
static constexpr dart::compiler::target::word
Thread_switchable_call_miss_stub_offset = 204;
static constexpr dart::compiler::target::word
- Thread_no_scope_native_wrapper_entry_point_offset = 320;
+ Thread_no_scope_native_wrapper_entry_point_offset = 324;
static constexpr dart::compiler::target::word
Thread_null_error_shared_with_fpu_regs_stub_offset = 156;
static constexpr dart::compiler::target::word
@@ -1263,14 +1267,16 @@
Thread_range_error_shared_without_fpu_regs_stub_offset = 168;
static constexpr dart::compiler::target::word Thread_object_null_offset = 112;
static constexpr dart::compiler::target::word
- Thread_predefined_symbols_address_offset = 332;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 664;
+ Thread_predefined_symbols_address_offset = 336;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 668;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 668;
+ Thread_saved_shadow_call_stack_offset = 672;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 676;
+ 680;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 236;
+static constexpr dart::compiler::target::word
+ Thread_slow_type_test_entry_point_offset = 316;
static constexpr dart::compiler::target::word Thread_stack_limit_offset = 36;
static constexpr dart::compiler::target::word Thread_saved_stack_limit_offset =
60;
@@ -1299,7 +1305,7 @@
Thread_write_barrier_entry_point_offset = 256;
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
40;
-static constexpr dart::compiler::target::word Thread_callback_code_offset = 680;
+static constexpr dart::compiler::target::word Thread_callback_code_offset = 684;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 12;
static constexpr dart::compiler::target::word Type_arguments_offset = 16;
@@ -1617,11 +1623,11 @@
static constexpr dart::compiler::target::word String_length_offset = 8;
static constexpr dart::compiler::target::word SubtypeTestCache_cache_offset = 8;
static constexpr dart::compiler::target::word
- Thread_AllocateArray_entry_point_offset = 712;
+ Thread_AllocateArray_entry_point_offset = 720;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 1448;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
1456;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 1464;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -1649,16 +1655,16 @@
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
192;
static constexpr dart::compiler::target::word
- Thread_auto_scope_native_wrapper_entry_point_offset = 632;
+ Thread_auto_scope_native_wrapper_entry_point_offset = 640;
static constexpr dart::compiler::target::word Thread_bool_false_offset = 224;
static constexpr dart::compiler::target::word Thread_bool_true_offset = 216;
static constexpr dart::compiler::target::word
- Thread_bootstrap_native_wrapper_entry_point_offset = 616;
+ Thread_bootstrap_native_wrapper_entry_point_offset = 624;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_entry_point_offset = 512;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 280;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1520;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1528;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -1669,14 +1675,14 @@
static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset =
432;
static constexpr dart::compiler::target::word Thread_double_abs_address_offset =
- 672;
+ 680;
static constexpr dart::compiler::target::word
- Thread_double_negate_address_offset = 664;
+ Thread_double_negate_address_offset = 672;
static constexpr dart::compiler::target::word Thread_end_offset = 112;
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 472;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 1488;
+ 1496;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 480;
static constexpr dart::compiler::target::word
@@ -1688,17 +1694,17 @@
static constexpr dart::compiler::target::word
Thread_fix_callers_target_code_offset = 248;
static constexpr dart::compiler::target::word
- Thread_float_absolute_address_offset = 696;
+ Thread_float_absolute_address_offset = 704;
static constexpr dart::compiler::target::word
- Thread_float_negate_address_offset = 688;
+ Thread_float_negate_address_offset = 696;
static constexpr dart::compiler::target::word Thread_float_not_address_offset =
- 680;
+ 688;
static constexpr dart::compiler::target::word
- Thread_float_zerow_address_offset = 704;
+ Thread_float_zerow_address_offset = 712;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 1464;
+ 1472;
static constexpr dart::compiler::target::word
- Thread_interpret_call_entry_point_offset = 640;
+ Thread_interpret_call_entry_point_offset = 648;
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_from_bytecode_stub_offset = 272;
static constexpr dart::compiler::target::word
@@ -1721,7 +1727,7 @@
static constexpr dart::compiler::target::word
Thread_switchable_call_miss_stub_offset = 392;
static constexpr dart::compiler::target::word
- Thread_no_scope_native_wrapper_entry_point_offset = 624;
+ Thread_no_scope_native_wrapper_entry_point_offset = 632;
static constexpr dart::compiler::target::word
Thread_null_error_shared_with_fpu_regs_stub_offset = 296;
static constexpr dart::compiler::target::word
@@ -1736,14 +1742,16 @@
Thread_range_error_shared_without_fpu_regs_stub_offset = 320;
static constexpr dart::compiler::target::word Thread_object_null_offset = 208;
static constexpr dart::compiler::target::word
- Thread_predefined_symbols_address_offset = 648;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1472;
+ Thread_predefined_symbols_address_offset = 656;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1480;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 1480;
+ Thread_saved_shadow_call_stack_offset = 1488;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 1496;
+ 1504;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 456;
+static constexpr dart::compiler::target::word
+ Thread_slow_type_test_entry_point_offset = 616;
static constexpr dart::compiler::target::word Thread_stack_limit_offset = 72;
static constexpr dart::compiler::target::word Thread_saved_stack_limit_offset =
120;
@@ -1773,7 +1781,7 @@
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
80;
static constexpr dart::compiler::target::word Thread_callback_code_offset =
- 1504;
+ 1512;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset =
16;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 16;
@@ -1812,9 +1820,9 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 1288, 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368,
- 1376, 1384, 1392, 1400, -1, -1, -1, -1, 1408, 1416, -1,
- -1, 1424, 1432, 1440, -1, -1, -1, -1, -1, -1};
+ 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376,
+ 1384, 1392, 1400, 1408, -1, -1, -1, -1, 1416, 1424, -1,
+ -1, 1432, 1440, 1448, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word Array_InstanceSize = 24;
static constexpr dart::compiler::target::word Array_header_size = 24;
@@ -2094,11 +2102,11 @@
static constexpr dart::compiler::target::word String_length_offset = 4;
static constexpr dart::compiler::target::word SubtypeTestCache_cache_offset = 4;
static constexpr dart::compiler::target::word
- Thread_AllocateArray_entry_point_offset = 364;
+ Thread_AllocateArray_entry_point_offset = 368;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 684;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
688;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 692;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -2126,16 +2134,16 @@
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
96;
static constexpr dart::compiler::target::word
- Thread_auto_scope_native_wrapper_entry_point_offset = 324;
+ Thread_auto_scope_native_wrapper_entry_point_offset = 328;
static constexpr dart::compiler::target::word Thread_bool_false_offset = 120;
static constexpr dart::compiler::target::word Thread_bool_true_offset = 116;
static constexpr dart::compiler::target::word
- Thread_bootstrap_native_wrapper_entry_point_offset = 316;
+ Thread_bootstrap_native_wrapper_entry_point_offset = 320;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_entry_point_offset = 264;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 148;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 720;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 724;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -2146,14 +2154,14 @@
static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset =
224;
static constexpr dart::compiler::target::word Thread_double_abs_address_offset =
- 344;
+ 348;
static constexpr dart::compiler::target::word
- Thread_double_negate_address_offset = 340;
+ Thread_double_negate_address_offset = 344;
static constexpr dart::compiler::target::word Thread_end_offset = 56;
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 244;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 704;
+ 708;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 248;
static constexpr dart::compiler::target::word
@@ -2165,17 +2173,17 @@
static constexpr dart::compiler::target::word
Thread_fix_callers_target_code_offset = 132;
static constexpr dart::compiler::target::word
- Thread_float_absolute_address_offset = 356;
+ Thread_float_absolute_address_offset = 360;
static constexpr dart::compiler::target::word
- Thread_float_negate_address_offset = 352;
+ Thread_float_negate_address_offset = 356;
static constexpr dart::compiler::target::word Thread_float_not_address_offset =
- 348;
+ 352;
static constexpr dart::compiler::target::word
- Thread_float_zerow_address_offset = 360;
+ Thread_float_zerow_address_offset = 364;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 692;
+ 696;
static constexpr dart::compiler::target::word
- Thread_interpret_call_entry_point_offset = 328;
+ Thread_interpret_call_entry_point_offset = 332;
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_from_bytecode_stub_offset = 144;
static constexpr dart::compiler::target::word
@@ -2198,7 +2206,7 @@
static constexpr dart::compiler::target::word
Thread_switchable_call_miss_stub_offset = 204;
static constexpr dart::compiler::target::word
- Thread_no_scope_native_wrapper_entry_point_offset = 320;
+ Thread_no_scope_native_wrapper_entry_point_offset = 324;
static constexpr dart::compiler::target::word
Thread_null_error_shared_with_fpu_regs_stub_offset = 156;
static constexpr dart::compiler::target::word
@@ -2213,14 +2221,16 @@
Thread_range_error_shared_without_fpu_regs_stub_offset = 168;
static constexpr dart::compiler::target::word Thread_object_null_offset = 112;
static constexpr dart::compiler::target::word
- Thread_predefined_symbols_address_offset = 332;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 696;
+ Thread_predefined_symbols_address_offset = 336;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 700;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 700;
+ Thread_saved_shadow_call_stack_offset = 704;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 708;
+ 712;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 236;
+static constexpr dart::compiler::target::word
+ Thread_slow_type_test_entry_point_offset = 316;
static constexpr dart::compiler::target::word Thread_stack_limit_offset = 36;
static constexpr dart::compiler::target::word Thread_saved_stack_limit_offset =
60;
@@ -2249,7 +2259,7 @@
Thread_write_barrier_entry_point_offset = 256;
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
40;
-static constexpr dart::compiler::target::word Thread_callback_code_offset = 712;
+static constexpr dart::compiler::target::word Thread_callback_code_offset = 716;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 12;
static constexpr dart::compiler::target::word Type_arguments_offset = 16;
@@ -2284,7 +2294,7 @@
4, 12, 8, 16};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 652, 656, 660, 664, 668, -1, 672, -1, 676, 680, -1, -1, -1, -1, -1, -1};
+ 656, 660, 664, 668, 672, -1, 676, -1, 680, 684, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 8;
static constexpr dart::compiler::target::word Array_InstanceSize = 12;
static constexpr dart::compiler::target::word Array_header_size = 12;
@@ -2564,11 +2574,11 @@
static constexpr dart::compiler::target::word String_length_offset = 8;
static constexpr dart::compiler::target::word SubtypeTestCache_cache_offset = 8;
static constexpr dart::compiler::target::word
- Thread_AllocateArray_entry_point_offset = 712;
+ Thread_AllocateArray_entry_point_offset = 720;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 1376;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
1384;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 1392;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -2596,16 +2606,16 @@
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
192;
static constexpr dart::compiler::target::word
- Thread_auto_scope_native_wrapper_entry_point_offset = 632;
+ Thread_auto_scope_native_wrapper_entry_point_offset = 640;
static constexpr dart::compiler::target::word Thread_bool_false_offset = 224;
static constexpr dart::compiler::target::word Thread_bool_true_offset = 216;
static constexpr dart::compiler::target::word
- Thread_bootstrap_native_wrapper_entry_point_offset = 616;
+ Thread_bootstrap_native_wrapper_entry_point_offset = 624;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_entry_point_offset = 512;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 280;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1448;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1456;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -2616,14 +2626,14 @@
static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset =
432;
static constexpr dart::compiler::target::word Thread_double_abs_address_offset =
- 672;
+ 680;
static constexpr dart::compiler::target::word
- Thread_double_negate_address_offset = 664;
+ Thread_double_negate_address_offset = 672;
static constexpr dart::compiler::target::word Thread_end_offset = 112;
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 472;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 1416;
+ 1424;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 480;
static constexpr dart::compiler::target::word
@@ -2635,17 +2645,17 @@
static constexpr dart::compiler::target::word
Thread_fix_callers_target_code_offset = 248;
static constexpr dart::compiler::target::word
- Thread_float_absolute_address_offset = 696;
+ Thread_float_absolute_address_offset = 704;
static constexpr dart::compiler::target::word
- Thread_float_negate_address_offset = 688;
+ Thread_float_negate_address_offset = 696;
static constexpr dart::compiler::target::word Thread_float_not_address_offset =
- 680;
+ 688;
static constexpr dart::compiler::target::word
- Thread_float_zerow_address_offset = 704;
+ Thread_float_zerow_address_offset = 712;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 1392;
+ 1400;
static constexpr dart::compiler::target::word
- Thread_interpret_call_entry_point_offset = 640;
+ Thread_interpret_call_entry_point_offset = 648;
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_from_bytecode_stub_offset = 272;
static constexpr dart::compiler::target::word
@@ -2668,7 +2678,7 @@
static constexpr dart::compiler::target::word
Thread_switchable_call_miss_stub_offset = 392;
static constexpr dart::compiler::target::word
- Thread_no_scope_native_wrapper_entry_point_offset = 624;
+ Thread_no_scope_native_wrapper_entry_point_offset = 632;
static constexpr dart::compiler::target::word
Thread_null_error_shared_with_fpu_regs_stub_offset = 296;
static constexpr dart::compiler::target::word
@@ -2683,14 +2693,16 @@
Thread_range_error_shared_without_fpu_regs_stub_offset = 320;
static constexpr dart::compiler::target::word Thread_object_null_offset = 208;
static constexpr dart::compiler::target::word
- Thread_predefined_symbols_address_offset = 648;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1400;
+ Thread_predefined_symbols_address_offset = 656;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1408;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 1408;
+ Thread_saved_shadow_call_stack_offset = 1416;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 1424;
+ 1432;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 456;
+static constexpr dart::compiler::target::word
+ Thread_slow_type_test_entry_point_offset = 616;
static constexpr dart::compiler::target::word Thread_stack_limit_offset = 72;
static constexpr dart::compiler::target::word Thread_saved_stack_limit_offset =
120;
@@ -2720,7 +2732,7 @@
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
80;
static constexpr dart::compiler::target::word Thread_callback_code_offset =
- 1432;
+ 1440;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset =
16;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 16;
@@ -2756,8 +2768,8 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 1288, 1296, 1304, 1312, -1, -1, 1320, 1328,
- 1336, 1344, 1352, -1, 1360, 1368, -1, -1};
+ 1296, 1304, 1312, 1320, -1, -1, 1328, 1336,
+ 1344, 1352, 1360, -1, 1368, 1376, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word Array_InstanceSize = 24;
static constexpr dart::compiler::target::word Array_header_size = 24;
@@ -3035,11 +3047,11 @@
static constexpr dart::compiler::target::word String_length_offset = 4;
static constexpr dart::compiler::target::word SubtypeTestCache_cache_offset = 4;
static constexpr dart::compiler::target::word
- Thread_AllocateArray_entry_point_offset = 364;
+ Thread_AllocateArray_entry_point_offset = 368;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 652;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
656;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 660;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -3067,16 +3079,16 @@
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
96;
static constexpr dart::compiler::target::word
- Thread_auto_scope_native_wrapper_entry_point_offset = 324;
+ Thread_auto_scope_native_wrapper_entry_point_offset = 328;
static constexpr dart::compiler::target::word Thread_bool_false_offset = 120;
static constexpr dart::compiler::target::word Thread_bool_true_offset = 116;
static constexpr dart::compiler::target::word
- Thread_bootstrap_native_wrapper_entry_point_offset = 316;
+ Thread_bootstrap_native_wrapper_entry_point_offset = 320;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_entry_point_offset = 264;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 148;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 688;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 692;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -3087,14 +3099,14 @@
static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset =
224;
static constexpr dart::compiler::target::word Thread_double_abs_address_offset =
- 344;
+ 348;
static constexpr dart::compiler::target::word
- Thread_double_negate_address_offset = 340;
+ Thread_double_negate_address_offset = 344;
static constexpr dart::compiler::target::word Thread_end_offset = 56;
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 244;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 672;
+ 676;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 248;
static constexpr dart::compiler::target::word
@@ -3106,17 +3118,17 @@
static constexpr dart::compiler::target::word
Thread_fix_callers_target_code_offset = 132;
static constexpr dart::compiler::target::word
- Thread_float_absolute_address_offset = 356;
+ Thread_float_absolute_address_offset = 360;
static constexpr dart::compiler::target::word
- Thread_float_negate_address_offset = 352;
+ Thread_float_negate_address_offset = 356;
static constexpr dart::compiler::target::word Thread_float_not_address_offset =
- 348;
+ 352;
static constexpr dart::compiler::target::word
- Thread_float_zerow_address_offset = 360;
+ Thread_float_zerow_address_offset = 364;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 660;
+ 664;
static constexpr dart::compiler::target::word
- Thread_interpret_call_entry_point_offset = 328;
+ Thread_interpret_call_entry_point_offset = 332;
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_from_bytecode_stub_offset = 144;
static constexpr dart::compiler::target::word
@@ -3139,7 +3151,7 @@
static constexpr dart::compiler::target::word
Thread_switchable_call_miss_stub_offset = 204;
static constexpr dart::compiler::target::word
- Thread_no_scope_native_wrapper_entry_point_offset = 320;
+ Thread_no_scope_native_wrapper_entry_point_offset = 324;
static constexpr dart::compiler::target::word
Thread_null_error_shared_with_fpu_regs_stub_offset = 156;
static constexpr dart::compiler::target::word
@@ -3154,14 +3166,16 @@
Thread_range_error_shared_without_fpu_regs_stub_offset = 168;
static constexpr dart::compiler::target::word Thread_object_null_offset = 112;
static constexpr dart::compiler::target::word
- Thread_predefined_symbols_address_offset = 332;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 664;
+ Thread_predefined_symbols_address_offset = 336;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 668;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 668;
+ Thread_saved_shadow_call_stack_offset = 672;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 676;
+ 680;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 236;
+static constexpr dart::compiler::target::word
+ Thread_slow_type_test_entry_point_offset = 316;
static constexpr dart::compiler::target::word Thread_stack_limit_offset = 36;
static constexpr dart::compiler::target::word Thread_saved_stack_limit_offset =
60;
@@ -3190,7 +3204,7 @@
Thread_write_barrier_entry_point_offset = 256;
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
40;
-static constexpr dart::compiler::target::word Thread_callback_code_offset = 680;
+static constexpr dart::compiler::target::word Thread_callback_code_offset = 684;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 12;
static constexpr dart::compiler::target::word Type_arguments_offset = 16;
@@ -3502,11 +3516,11 @@
static constexpr dart::compiler::target::word String_length_offset = 8;
static constexpr dart::compiler::target::word SubtypeTestCache_cache_offset = 8;
static constexpr dart::compiler::target::word
- Thread_AllocateArray_entry_point_offset = 712;
+ Thread_AllocateArray_entry_point_offset = 720;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
- 1448;
-static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
1456;
+static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
+ 1464;
static constexpr dart::compiler::target::word
Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -3534,16 +3548,16 @@
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
192;
static constexpr dart::compiler::target::word
- Thread_auto_scope_native_wrapper_entry_point_offset = 632;
+ Thread_auto_scope_native_wrapper_entry_point_offset = 640;
static constexpr dart::compiler::target::word Thread_bool_false_offset = 224;
static constexpr dart::compiler::target::word Thread_bool_true_offset = 216;
static constexpr dart::compiler::target::word
- Thread_bootstrap_native_wrapper_entry_point_offset = 616;
+ Thread_bootstrap_native_wrapper_entry_point_offset = 624;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_entry_point_offset = 512;
static constexpr dart::compiler::target::word
Thread_call_to_runtime_stub_offset = 280;
-static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1520;
+static constexpr dart::compiler::target::word Thread_dart_stream_offset = 1528;
static constexpr dart::compiler::target::word
Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word Thread_optimize_entry_offset =
@@ -3554,14 +3568,14 @@
static constexpr dart::compiler::target::word Thread_deoptimize_stub_offset =
432;
static constexpr dart::compiler::target::word Thread_double_abs_address_offset =
- 672;
+ 680;
static constexpr dart::compiler::target::word
- Thread_double_negate_address_offset = 664;
+ Thread_double_negate_address_offset = 672;
static constexpr dart::compiler::target::word Thread_end_offset = 112;
static constexpr dart::compiler::target::word
Thread_enter_safepoint_stub_offset = 472;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
- 1488;
+ 1496;
static constexpr dart::compiler::target::word
Thread_exit_safepoint_stub_offset = 480;
static constexpr dart::compiler::target::word
@@ -3573,17 +3587,17 @@
static constexpr dart::compiler::target::word
Thread_fix_callers_target_code_offset = 248;
static constexpr dart::compiler::target::word
- Thread_float_absolute_address_offset = 696;
+ Thread_float_absolute_address_offset = 704;
static constexpr dart::compiler::target::word
- Thread_float_negate_address_offset = 688;
+ Thread_float_negate_address_offset = 696;
static constexpr dart::compiler::target::word Thread_float_not_address_offset =
- 680;
+ 688;
static constexpr dart::compiler::target::word
- Thread_float_zerow_address_offset = 704;
+ Thread_float_zerow_address_offset = 712;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
- 1464;
+ 1472;
static constexpr dart::compiler::target::word
- Thread_interpret_call_entry_point_offset = 640;
+ Thread_interpret_call_entry_point_offset = 648;
static constexpr dart::compiler::target::word
Thread_invoke_dart_code_from_bytecode_stub_offset = 272;
static constexpr dart::compiler::target::word
@@ -3606,7 +3620,7 @@
static constexpr dart::compiler::target::word
Thread_switchable_call_miss_stub_offset = 392;
static constexpr dart::compiler::target::word
- Thread_no_scope_native_wrapper_entry_point_offset = 624;
+ Thread_no_scope_native_wrapper_entry_point_offset = 632;
static constexpr dart::compiler::target::word
Thread_null_error_shared_with_fpu_regs_stub_offset = 296;
static constexpr dart::compiler::target::word
@@ -3621,14 +3635,16 @@
Thread_range_error_shared_without_fpu_regs_stub_offset = 320;
static constexpr dart::compiler::target::word Thread_object_null_offset = 208;
static constexpr dart::compiler::target::word
- Thread_predefined_symbols_address_offset = 648;
-static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1472;
+ Thread_predefined_symbols_address_offset = 656;
+static constexpr dart::compiler::target::word Thread_resume_pc_offset = 1480;
static constexpr dart::compiler::target::word
- Thread_saved_shadow_call_stack_offset = 1480;
+ Thread_saved_shadow_call_stack_offset = 1488;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
- 1496;
+ 1504;
static constexpr dart::compiler::target::word
Thread_slow_type_test_stub_offset = 456;
+static constexpr dart::compiler::target::word
+ Thread_slow_type_test_entry_point_offset = 616;
static constexpr dart::compiler::target::word Thread_stack_limit_offset = 72;
static constexpr dart::compiler::target::word Thread_saved_stack_limit_offset =
120;
@@ -3658,7 +3674,7 @@
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
80;
static constexpr dart::compiler::target::word Thread_callback_code_offset =
- 1504;
+ 1512;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset =
16;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 16;
@@ -3694,9 +3710,9 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
Thread_write_barrier_wrappers_thread_offset[] = {
- 1288, 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368,
- 1376, 1384, 1392, 1400, -1, -1, -1, -1, 1408, 1416, -1,
- -1, 1424, 1432, 1440, -1, -1, -1, -1, -1, -1};
+ 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376,
+ 1384, 1392, 1400, 1408, -1, -1, -1, -1, 1416, 1424, -1,
+ -1, 1432, 1440, 1448, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word Array_InstanceSize = 24;
static constexpr dart::compiler::target::word Array_header_size = 24;
@@ -3991,11 +4007,11 @@
static constexpr dart::compiler::target::word
AOT_SubtypeTestCache_cache_offset = 4;
static constexpr dart::compiler::target::word
- AOT_Thread_AllocateArray_entry_point_offset = 364;
+ AOT_Thread_AllocateArray_entry_point_offset = 368;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 684;
+ AOT_Thread_active_exception_offset = 688;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 688;
+ AOT_Thread_active_stacktrace_offset = 692;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -4023,18 +4039,18 @@
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 96;
static constexpr dart::compiler::target::word
- AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 324;
+ AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 328;
static constexpr dart::compiler::target::word AOT_Thread_bool_false_offset =
120;
static constexpr dart::compiler::target::word AOT_Thread_bool_true_offset = 116;
static constexpr dart::compiler::target::word
- AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 316;
+ AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 320;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_entry_point_offset = 264;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 148;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 720;
+ 724;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -4046,14 +4062,14 @@
static constexpr dart::compiler::target::word
AOT_Thread_deoptimize_stub_offset = 224;
static constexpr dart::compiler::target::word
- AOT_Thread_double_abs_address_offset = 344;
+ AOT_Thread_double_abs_address_offset = 348;
static constexpr dart::compiler::target::word
- AOT_Thread_double_negate_address_offset = 340;
+ AOT_Thread_double_negate_address_offset = 344;
static constexpr dart::compiler::target::word AOT_Thread_end_offset = 56;
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 244;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 704;
+ AOT_Thread_execution_state_offset = 708;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 248;
static constexpr dart::compiler::target::word
@@ -4065,17 +4081,17 @@
static constexpr dart::compiler::target::word
AOT_Thread_fix_callers_target_code_offset = 132;
static constexpr dart::compiler::target::word
- AOT_Thread_float_absolute_address_offset = 356;
+ AOT_Thread_float_absolute_address_offset = 360;
static constexpr dart::compiler::target::word
- AOT_Thread_float_negate_address_offset = 352;
+ AOT_Thread_float_negate_address_offset = 356;
static constexpr dart::compiler::target::word
- AOT_Thread_float_not_address_offset = 348;
+ AOT_Thread_float_not_address_offset = 352;
static constexpr dart::compiler::target::word
- AOT_Thread_float_zerow_address_offset = 360;
+ AOT_Thread_float_zerow_address_offset = 364;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 692;
+ AOT_Thread_global_object_pool_offset = 696;
static constexpr dart::compiler::target::word
- AOT_Thread_interpret_call_entry_point_offset = 328;
+ AOT_Thread_interpret_call_entry_point_offset = 332;
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_from_bytecode_stub_offset = 144;
static constexpr dart::compiler::target::word
@@ -4098,7 +4114,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_switchable_call_miss_stub_offset = 204;
static constexpr dart::compiler::target::word
- AOT_Thread_no_scope_native_wrapper_entry_point_offset = 320;
+ AOT_Thread_no_scope_native_wrapper_entry_point_offset = 324;
static constexpr dart::compiler::target::word
AOT_Thread_null_error_shared_with_fpu_regs_stub_offset = 156;
static constexpr dart::compiler::target::word
@@ -4114,14 +4130,16 @@
static constexpr dart::compiler::target::word AOT_Thread_object_null_offset =
112;
static constexpr dart::compiler::target::word
- AOT_Thread_predefined_symbols_address_offset = 332;
-static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset = 696;
+ AOT_Thread_predefined_symbols_address_offset = 336;
+static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset = 700;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 700;
+ AOT_Thread_saved_shadow_call_stack_offset = 704;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 708;
+ AOT_Thread_safepoint_state_offset = 712;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 236;
+static constexpr dart::compiler::target::word
+ AOT_Thread_slow_type_test_entry_point_offset = 316;
static constexpr dart::compiler::target::word AOT_Thread_stack_limit_offset =
36;
static constexpr dart::compiler::target::word
@@ -4153,7 +4171,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 40;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 712;
+ 716;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -4198,7 +4216,7 @@
4, 12, 8, 16};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 652, 656, 660, 664, 668, -1, 672, -1, 676, 680, -1, -1, -1, -1, -1, -1};
+ 656, 660, 664, 668, 672, -1, 676, -1, 680, 684, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 8;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 12;
static constexpr dart::compiler::target::word AOT_Array_header_size = 12;
@@ -4508,11 +4526,11 @@
static constexpr dart::compiler::target::word
AOT_SubtypeTestCache_cache_offset = 8;
static constexpr dart::compiler::target::word
- AOT_Thread_AllocateArray_entry_point_offset = 712;
+ AOT_Thread_AllocateArray_entry_point_offset = 720;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 1376;
+ AOT_Thread_active_exception_offset = 1384;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 1384;
+ AOT_Thread_active_stacktrace_offset = 1392;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -4540,18 +4558,18 @@
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 192;
static constexpr dart::compiler::target::word
- AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 632;
+ AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 640;
static constexpr dart::compiler::target::word AOT_Thread_bool_false_offset =
224;
static constexpr dart::compiler::target::word AOT_Thread_bool_true_offset = 216;
static constexpr dart::compiler::target::word
- AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 616;
+ AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 624;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_entry_point_offset = 512;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 280;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 1448;
+ 1456;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -4563,14 +4581,14 @@
static constexpr dart::compiler::target::word
AOT_Thread_deoptimize_stub_offset = 432;
static constexpr dart::compiler::target::word
- AOT_Thread_double_abs_address_offset = 672;
+ AOT_Thread_double_abs_address_offset = 680;
static constexpr dart::compiler::target::word
- AOT_Thread_double_negate_address_offset = 664;
+ AOT_Thread_double_negate_address_offset = 672;
static constexpr dart::compiler::target::word AOT_Thread_end_offset = 112;
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 472;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 1416;
+ AOT_Thread_execution_state_offset = 1424;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 480;
static constexpr dart::compiler::target::word
@@ -4582,17 +4600,17 @@
static constexpr dart::compiler::target::word
AOT_Thread_fix_callers_target_code_offset = 248;
static constexpr dart::compiler::target::word
- AOT_Thread_float_absolute_address_offset = 696;
+ AOT_Thread_float_absolute_address_offset = 704;
static constexpr dart::compiler::target::word
- AOT_Thread_float_negate_address_offset = 688;
+ AOT_Thread_float_negate_address_offset = 696;
static constexpr dart::compiler::target::word
- AOT_Thread_float_not_address_offset = 680;
+ AOT_Thread_float_not_address_offset = 688;
static constexpr dart::compiler::target::word
- AOT_Thread_float_zerow_address_offset = 704;
+ AOT_Thread_float_zerow_address_offset = 712;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 1392;
+ AOT_Thread_global_object_pool_offset = 1400;
static constexpr dart::compiler::target::word
- AOT_Thread_interpret_call_entry_point_offset = 640;
+ AOT_Thread_interpret_call_entry_point_offset = 648;
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_from_bytecode_stub_offset = 272;
static constexpr dart::compiler::target::word
@@ -4615,7 +4633,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_switchable_call_miss_stub_offset = 392;
static constexpr dart::compiler::target::word
- AOT_Thread_no_scope_native_wrapper_entry_point_offset = 624;
+ AOT_Thread_no_scope_native_wrapper_entry_point_offset = 632;
static constexpr dart::compiler::target::word
AOT_Thread_null_error_shared_with_fpu_regs_stub_offset = 296;
static constexpr dart::compiler::target::word
@@ -4631,15 +4649,17 @@
static constexpr dart::compiler::target::word AOT_Thread_object_null_offset =
208;
static constexpr dart::compiler::target::word
- AOT_Thread_predefined_symbols_address_offset = 648;
+ AOT_Thread_predefined_symbols_address_offset = 656;
static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset =
- 1400;
+ 1408;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 1408;
+ AOT_Thread_saved_shadow_call_stack_offset = 1416;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 1424;
+ AOT_Thread_safepoint_state_offset = 1432;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 456;
+static constexpr dart::compiler::target::word
+ AOT_Thread_slow_type_test_entry_point_offset = 616;
static constexpr dart::compiler::target::word AOT_Thread_stack_limit_offset =
72;
static constexpr dart::compiler::target::word
@@ -4671,7 +4691,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 80;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 1432;
+ 1440;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 16;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -4716,8 +4736,8 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 1288, 1296, 1304, 1312, -1, -1, 1320, 1328,
- 1336, 1344, 1352, -1, 1360, 1368, -1, -1};
+ 1296, 1304, 1312, 1320, -1, -1, 1328, 1336,
+ 1344, 1352, 1360, -1, 1368, 1376, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Array_header_size = 24;
@@ -5031,11 +5051,11 @@
static constexpr dart::compiler::target::word
AOT_SubtypeTestCache_cache_offset = 8;
static constexpr dart::compiler::target::word
- AOT_Thread_AllocateArray_entry_point_offset = 712;
+ AOT_Thread_AllocateArray_entry_point_offset = 720;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 1448;
+ AOT_Thread_active_exception_offset = 1456;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 1456;
+ AOT_Thread_active_stacktrace_offset = 1464;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -5063,18 +5083,18 @@
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 192;
static constexpr dart::compiler::target::word
- AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 632;
+ AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 640;
static constexpr dart::compiler::target::word AOT_Thread_bool_false_offset =
224;
static constexpr dart::compiler::target::word AOT_Thread_bool_true_offset = 216;
static constexpr dart::compiler::target::word
- AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 616;
+ AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 624;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_entry_point_offset = 512;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 280;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 1520;
+ 1528;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -5086,14 +5106,14 @@
static constexpr dart::compiler::target::word
AOT_Thread_deoptimize_stub_offset = 432;
static constexpr dart::compiler::target::word
- AOT_Thread_double_abs_address_offset = 672;
+ AOT_Thread_double_abs_address_offset = 680;
static constexpr dart::compiler::target::word
- AOT_Thread_double_negate_address_offset = 664;
+ AOT_Thread_double_negate_address_offset = 672;
static constexpr dart::compiler::target::word AOT_Thread_end_offset = 112;
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 472;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 1488;
+ AOT_Thread_execution_state_offset = 1496;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 480;
static constexpr dart::compiler::target::word
@@ -5105,17 +5125,17 @@
static constexpr dart::compiler::target::word
AOT_Thread_fix_callers_target_code_offset = 248;
static constexpr dart::compiler::target::word
- AOT_Thread_float_absolute_address_offset = 696;
+ AOT_Thread_float_absolute_address_offset = 704;
static constexpr dart::compiler::target::word
- AOT_Thread_float_negate_address_offset = 688;
+ AOT_Thread_float_negate_address_offset = 696;
static constexpr dart::compiler::target::word
- AOT_Thread_float_not_address_offset = 680;
+ AOT_Thread_float_not_address_offset = 688;
static constexpr dart::compiler::target::word
- AOT_Thread_float_zerow_address_offset = 704;
+ AOT_Thread_float_zerow_address_offset = 712;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 1464;
+ AOT_Thread_global_object_pool_offset = 1472;
static constexpr dart::compiler::target::word
- AOT_Thread_interpret_call_entry_point_offset = 640;
+ AOT_Thread_interpret_call_entry_point_offset = 648;
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_from_bytecode_stub_offset = 272;
static constexpr dart::compiler::target::word
@@ -5138,7 +5158,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_switchable_call_miss_stub_offset = 392;
static constexpr dart::compiler::target::word
- AOT_Thread_no_scope_native_wrapper_entry_point_offset = 624;
+ AOT_Thread_no_scope_native_wrapper_entry_point_offset = 632;
static constexpr dart::compiler::target::word
AOT_Thread_null_error_shared_with_fpu_regs_stub_offset = 296;
static constexpr dart::compiler::target::word
@@ -5154,15 +5174,17 @@
static constexpr dart::compiler::target::word AOT_Thread_object_null_offset =
208;
static constexpr dart::compiler::target::word
- AOT_Thread_predefined_symbols_address_offset = 648;
+ AOT_Thread_predefined_symbols_address_offset = 656;
static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset =
- 1472;
+ 1480;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 1480;
+ AOT_Thread_saved_shadow_call_stack_offset = 1488;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 1496;
+ AOT_Thread_safepoint_state_offset = 1504;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 456;
+static constexpr dart::compiler::target::word
+ AOT_Thread_slow_type_test_entry_point_offset = 616;
static constexpr dart::compiler::target::word AOT_Thread_stack_limit_offset =
72;
static constexpr dart::compiler::target::word
@@ -5194,7 +5216,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 80;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 1504;
+ 1512;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 16;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -5239,9 +5261,9 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 1288, 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368,
- 1376, 1384, 1392, 1400, -1, -1, -1, -1, 1408, 1416, -1,
- -1, 1424, 1432, 1440, -1, -1, -1, -1, -1, -1};
+ 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376,
+ 1384, 1392, 1400, 1408, -1, -1, -1, -1, 1416, 1424, -1,
+ -1, 1432, 1440, 1448, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Array_header_size = 24;
@@ -5550,11 +5572,11 @@
static constexpr dart::compiler::target::word
AOT_SubtypeTestCache_cache_offset = 4;
static constexpr dart::compiler::target::word
- AOT_Thread_AllocateArray_entry_point_offset = 364;
+ AOT_Thread_AllocateArray_entry_point_offset = 368;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 684;
+ AOT_Thread_active_exception_offset = 688;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 688;
+ AOT_Thread_active_stacktrace_offset = 692;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 128;
static constexpr dart::compiler::target::word
@@ -5582,18 +5604,18 @@
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 96;
static constexpr dart::compiler::target::word
- AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 324;
+ AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 328;
static constexpr dart::compiler::target::word AOT_Thread_bool_false_offset =
120;
static constexpr dart::compiler::target::word AOT_Thread_bool_true_offset = 116;
static constexpr dart::compiler::target::word
- AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 316;
+ AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 320;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_entry_point_offset = 264;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 148;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 720;
+ 724;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 48;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -5605,14 +5627,14 @@
static constexpr dart::compiler::target::word
AOT_Thread_deoptimize_stub_offset = 224;
static constexpr dart::compiler::target::word
- AOT_Thread_double_abs_address_offset = 344;
+ AOT_Thread_double_abs_address_offset = 348;
static constexpr dart::compiler::target::word
- AOT_Thread_double_negate_address_offset = 340;
+ AOT_Thread_double_negate_address_offset = 344;
static constexpr dart::compiler::target::word AOT_Thread_end_offset = 56;
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 244;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 704;
+ AOT_Thread_execution_state_offset = 708;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 248;
static constexpr dart::compiler::target::word
@@ -5624,17 +5646,17 @@
static constexpr dart::compiler::target::word
AOT_Thread_fix_callers_target_code_offset = 132;
static constexpr dart::compiler::target::word
- AOT_Thread_float_absolute_address_offset = 356;
+ AOT_Thread_float_absolute_address_offset = 360;
static constexpr dart::compiler::target::word
- AOT_Thread_float_negate_address_offset = 352;
+ AOT_Thread_float_negate_address_offset = 356;
static constexpr dart::compiler::target::word
- AOT_Thread_float_not_address_offset = 348;
+ AOT_Thread_float_not_address_offset = 352;
static constexpr dart::compiler::target::word
- AOT_Thread_float_zerow_address_offset = 360;
+ AOT_Thread_float_zerow_address_offset = 364;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 692;
+ AOT_Thread_global_object_pool_offset = 696;
static constexpr dart::compiler::target::word
- AOT_Thread_interpret_call_entry_point_offset = 328;
+ AOT_Thread_interpret_call_entry_point_offset = 332;
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_from_bytecode_stub_offset = 144;
static constexpr dart::compiler::target::word
@@ -5657,7 +5679,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_switchable_call_miss_stub_offset = 204;
static constexpr dart::compiler::target::word
- AOT_Thread_no_scope_native_wrapper_entry_point_offset = 320;
+ AOT_Thread_no_scope_native_wrapper_entry_point_offset = 324;
static constexpr dart::compiler::target::word
AOT_Thread_null_error_shared_with_fpu_regs_stub_offset = 156;
static constexpr dart::compiler::target::word
@@ -5673,14 +5695,16 @@
static constexpr dart::compiler::target::word AOT_Thread_object_null_offset =
112;
static constexpr dart::compiler::target::word
- AOT_Thread_predefined_symbols_address_offset = 332;
-static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset = 696;
+ AOT_Thread_predefined_symbols_address_offset = 336;
+static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset = 700;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 700;
+ AOT_Thread_saved_shadow_call_stack_offset = 704;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 708;
+ AOT_Thread_safepoint_state_offset = 712;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 236;
+static constexpr dart::compiler::target::word
+ AOT_Thread_slow_type_test_entry_point_offset = 316;
static constexpr dart::compiler::target::word AOT_Thread_stack_limit_offset =
36;
static constexpr dart::compiler::target::word
@@ -5712,7 +5736,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 40;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 712;
+ 716;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -5754,7 +5778,7 @@
4, 12, 8, 16};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 652, 656, 660, 664, 668, -1, 672, -1, 676, 680, -1, -1, -1, -1, -1, -1};
+ 656, 660, 664, 668, 672, -1, 676, -1, 680, 684, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 8;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 12;
static constexpr dart::compiler::target::word AOT_Array_header_size = 12;
@@ -6060,11 +6084,11 @@
static constexpr dart::compiler::target::word
AOT_SubtypeTestCache_cache_offset = 8;
static constexpr dart::compiler::target::word
- AOT_Thread_AllocateArray_entry_point_offset = 712;
+ AOT_Thread_AllocateArray_entry_point_offset = 720;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 1376;
+ AOT_Thread_active_exception_offset = 1384;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 1384;
+ AOT_Thread_active_stacktrace_offset = 1392;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -6092,18 +6116,18 @@
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 192;
static constexpr dart::compiler::target::word
- AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 632;
+ AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 640;
static constexpr dart::compiler::target::word AOT_Thread_bool_false_offset =
224;
static constexpr dart::compiler::target::word AOT_Thread_bool_true_offset = 216;
static constexpr dart::compiler::target::word
- AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 616;
+ AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 624;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_entry_point_offset = 512;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 280;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 1448;
+ 1456;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -6115,14 +6139,14 @@
static constexpr dart::compiler::target::word
AOT_Thread_deoptimize_stub_offset = 432;
static constexpr dart::compiler::target::word
- AOT_Thread_double_abs_address_offset = 672;
+ AOT_Thread_double_abs_address_offset = 680;
static constexpr dart::compiler::target::word
- AOT_Thread_double_negate_address_offset = 664;
+ AOT_Thread_double_negate_address_offset = 672;
static constexpr dart::compiler::target::word AOT_Thread_end_offset = 112;
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 472;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 1416;
+ AOT_Thread_execution_state_offset = 1424;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 480;
static constexpr dart::compiler::target::word
@@ -6134,17 +6158,17 @@
static constexpr dart::compiler::target::word
AOT_Thread_fix_callers_target_code_offset = 248;
static constexpr dart::compiler::target::word
- AOT_Thread_float_absolute_address_offset = 696;
+ AOT_Thread_float_absolute_address_offset = 704;
static constexpr dart::compiler::target::word
- AOT_Thread_float_negate_address_offset = 688;
+ AOT_Thread_float_negate_address_offset = 696;
static constexpr dart::compiler::target::word
- AOT_Thread_float_not_address_offset = 680;
+ AOT_Thread_float_not_address_offset = 688;
static constexpr dart::compiler::target::word
- AOT_Thread_float_zerow_address_offset = 704;
+ AOT_Thread_float_zerow_address_offset = 712;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 1392;
+ AOT_Thread_global_object_pool_offset = 1400;
static constexpr dart::compiler::target::word
- AOT_Thread_interpret_call_entry_point_offset = 640;
+ AOT_Thread_interpret_call_entry_point_offset = 648;
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_from_bytecode_stub_offset = 272;
static constexpr dart::compiler::target::word
@@ -6167,7 +6191,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_switchable_call_miss_stub_offset = 392;
static constexpr dart::compiler::target::word
- AOT_Thread_no_scope_native_wrapper_entry_point_offset = 624;
+ AOT_Thread_no_scope_native_wrapper_entry_point_offset = 632;
static constexpr dart::compiler::target::word
AOT_Thread_null_error_shared_with_fpu_regs_stub_offset = 296;
static constexpr dart::compiler::target::word
@@ -6183,15 +6207,17 @@
static constexpr dart::compiler::target::word AOT_Thread_object_null_offset =
208;
static constexpr dart::compiler::target::word
- AOT_Thread_predefined_symbols_address_offset = 648;
+ AOT_Thread_predefined_symbols_address_offset = 656;
static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset =
- 1400;
+ 1408;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 1408;
+ AOT_Thread_saved_shadow_call_stack_offset = 1416;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 1424;
+ AOT_Thread_safepoint_state_offset = 1432;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 456;
+static constexpr dart::compiler::target::word
+ AOT_Thread_slow_type_test_entry_point_offset = 616;
static constexpr dart::compiler::target::word AOT_Thread_stack_limit_offset =
72;
static constexpr dart::compiler::target::word
@@ -6223,7 +6249,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 80;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 1432;
+ 1440;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 16;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -6265,8 +6291,8 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 1288, 1296, 1304, 1312, -1, -1, 1320, 1328,
- 1336, 1344, 1352, -1, 1360, 1368, -1, -1};
+ 1296, 1304, 1312, 1320, -1, -1, 1328, 1336,
+ 1344, 1352, 1360, -1, 1368, 1376, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Array_header_size = 24;
@@ -6576,11 +6602,11 @@
static constexpr dart::compiler::target::word
AOT_SubtypeTestCache_cache_offset = 8;
static constexpr dart::compiler::target::word
- AOT_Thread_AllocateArray_entry_point_offset = 712;
+ AOT_Thread_AllocateArray_entry_point_offset = 720;
static constexpr dart::compiler::target::word
- AOT_Thread_active_exception_offset = 1448;
+ AOT_Thread_active_exception_offset = 1456;
static constexpr dart::compiler::target::word
- AOT_Thread_active_stacktrace_offset = 1456;
+ AOT_Thread_active_stacktrace_offset = 1464;
static constexpr dart::compiler::target::word
AOT_Thread_array_write_barrier_code_offset = 240;
static constexpr dart::compiler::target::word
@@ -6608,18 +6634,18 @@
static constexpr dart::compiler::target::word
AOT_Thread_async_stack_trace_offset = 192;
static constexpr dart::compiler::target::word
- AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 632;
+ AOT_Thread_auto_scope_native_wrapper_entry_point_offset = 640;
static constexpr dart::compiler::target::word AOT_Thread_bool_false_offset =
224;
static constexpr dart::compiler::target::word AOT_Thread_bool_true_offset = 216;
static constexpr dart::compiler::target::word
- AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 616;
+ AOT_Thread_bootstrap_native_wrapper_entry_point_offset = 624;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_entry_point_offset = 512;
static constexpr dart::compiler::target::word
AOT_Thread_call_to_runtime_stub_offset = 280;
static constexpr dart::compiler::target::word AOT_Thread_dart_stream_offset =
- 1520;
+ 1528;
static constexpr dart::compiler::target::word
AOT_Thread_dispatch_table_array_offset = 96;
static constexpr dart::compiler::target::word AOT_Thread_optimize_entry_offset =
@@ -6631,14 +6657,14 @@
static constexpr dart::compiler::target::word
AOT_Thread_deoptimize_stub_offset = 432;
static constexpr dart::compiler::target::word
- AOT_Thread_double_abs_address_offset = 672;
+ AOT_Thread_double_abs_address_offset = 680;
static constexpr dart::compiler::target::word
- AOT_Thread_double_negate_address_offset = 664;
+ AOT_Thread_double_negate_address_offset = 672;
static constexpr dart::compiler::target::word AOT_Thread_end_offset = 112;
static constexpr dart::compiler::target::word
AOT_Thread_enter_safepoint_stub_offset = 472;
static constexpr dart::compiler::target::word
- AOT_Thread_execution_state_offset = 1488;
+ AOT_Thread_execution_state_offset = 1496;
static constexpr dart::compiler::target::word
AOT_Thread_exit_safepoint_stub_offset = 480;
static constexpr dart::compiler::target::word
@@ -6650,17 +6676,17 @@
static constexpr dart::compiler::target::word
AOT_Thread_fix_callers_target_code_offset = 248;
static constexpr dart::compiler::target::word
- AOT_Thread_float_absolute_address_offset = 696;
+ AOT_Thread_float_absolute_address_offset = 704;
static constexpr dart::compiler::target::word
- AOT_Thread_float_negate_address_offset = 688;
+ AOT_Thread_float_negate_address_offset = 696;
static constexpr dart::compiler::target::word
- AOT_Thread_float_not_address_offset = 680;
+ AOT_Thread_float_not_address_offset = 688;
static constexpr dart::compiler::target::word
- AOT_Thread_float_zerow_address_offset = 704;
+ AOT_Thread_float_zerow_address_offset = 712;
static constexpr dart::compiler::target::word
- AOT_Thread_global_object_pool_offset = 1464;
+ AOT_Thread_global_object_pool_offset = 1472;
static constexpr dart::compiler::target::word
- AOT_Thread_interpret_call_entry_point_offset = 640;
+ AOT_Thread_interpret_call_entry_point_offset = 648;
static constexpr dart::compiler::target::word
AOT_Thread_invoke_dart_code_from_bytecode_stub_offset = 272;
static constexpr dart::compiler::target::word
@@ -6683,7 +6709,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_switchable_call_miss_stub_offset = 392;
static constexpr dart::compiler::target::word
- AOT_Thread_no_scope_native_wrapper_entry_point_offset = 624;
+ AOT_Thread_no_scope_native_wrapper_entry_point_offset = 632;
static constexpr dart::compiler::target::word
AOT_Thread_null_error_shared_with_fpu_regs_stub_offset = 296;
static constexpr dart::compiler::target::word
@@ -6699,15 +6725,17 @@
static constexpr dart::compiler::target::word AOT_Thread_object_null_offset =
208;
static constexpr dart::compiler::target::word
- AOT_Thread_predefined_symbols_address_offset = 648;
+ AOT_Thread_predefined_symbols_address_offset = 656;
static constexpr dart::compiler::target::word AOT_Thread_resume_pc_offset =
- 1472;
+ 1480;
static constexpr dart::compiler::target::word
- AOT_Thread_saved_shadow_call_stack_offset = 1480;
+ AOT_Thread_saved_shadow_call_stack_offset = 1488;
static constexpr dart::compiler::target::word
- AOT_Thread_safepoint_state_offset = 1496;
+ AOT_Thread_safepoint_state_offset = 1504;
static constexpr dart::compiler::target::word
AOT_Thread_slow_type_test_stub_offset = 456;
+static constexpr dart::compiler::target::word
+ AOT_Thread_slow_type_test_entry_point_offset = 616;
static constexpr dart::compiler::target::word AOT_Thread_stack_limit_offset =
72;
static constexpr dart::compiler::target::word
@@ -6739,7 +6767,7 @@
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_mask_offset = 80;
static constexpr dart::compiler::target::word AOT_Thread_callback_code_offset =
- 1504;
+ 1512;
static constexpr dart::compiler::target::word
AOT_TimelineStream_enabled_offset = 16;
static constexpr dart::compiler::target::word AOT_TwoByteString_data_offset =
@@ -6781,9 +6809,9 @@
8, 24, 16, 32};
static constexpr dart::compiler::target::word
AOT_Thread_write_barrier_wrappers_thread_offset[] = {
- 1288, 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368,
- 1376, 1384, 1392, 1400, -1, -1, -1, -1, 1408, 1416, -1,
- -1, 1424, 1432, 1440, -1, -1, -1, -1, -1, -1};
+ 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376,
+ 1384, 1392, 1400, 1408, -1, -1, -1, -1, 1416, 1424, -1,
+ -1, 1432, 1440, 1448, -1, -1, -1, -1, -1, -1};
static constexpr dart::compiler::target::word AOT_ApiError_InstanceSize = 16;
static constexpr dart::compiler::target::word AOT_Array_InstanceSize = 24;
static constexpr dart::compiler::target::word AOT_Array_header_size = 24;
diff --git a/runtime/vm/compiler/runtime_offsets_list.h b/runtime/vm/compiler/runtime_offsets_list.h
index 6294726..007a84a 100644
--- a/runtime/vm/compiler/runtime_offsets_list.h
+++ b/runtime/vm/compiler/runtime_offsets_list.h
@@ -211,6 +211,7 @@
FIELD(Thread, saved_shadow_call_stack_offset) \
FIELD(Thread, safepoint_state_offset) \
FIELD(Thread, slow_type_test_stub_offset) \
+ FIELD(Thread, slow_type_test_entry_point_offset) \
FIELD(Thread, stack_limit_offset) \
FIELD(Thread, saved_stack_limit_offset) \
FIELD(Thread, stack_overflow_flags_offset) \
diff --git a/runtime/vm/compiler/stub_code_compiler.cc b/runtime/vm/compiler/stub_code_compiler.cc
index bd3fdc4..7d91690 100644
--- a/runtime/vm/compiler/stub_code_compiler.cc
+++ b/runtime/vm/compiler/stub_code_compiler.cc
@@ -9,8 +9,6 @@
#include "vm/compiler/stub_code_compiler.h"
-#if !defined(DART_PRECOMPILED_RUNTIME)
-
#include "vm/compiler/assembler/assembler.h"
#define __ assembler->
@@ -83,5 +81,3 @@
} // namespace compiler
} // namespace dart
-
-#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/stub_code_compiler.h b/runtime/vm/compiler/stub_code_compiler.h
index 35f23fd..9eb4098 100644
--- a/runtime/vm/compiler/stub_code_compiler.h
+++ b/runtime/vm/compiler/stub_code_compiler.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_STUB_CODE_COMPILER_H_
#define RUNTIME_VM_COMPILER_STUB_CODE_COMPILER_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#include "vm/allocation.h"
#include "vm/compiler/runtime_api.h"
#include "vm/constants.h"
diff --git a/runtime/vm/compiler/stub_code_compiler_arm.cc b/runtime/vm/compiler/stub_code_compiler_arm.cc
index 8a6858b..4967874 100644
--- a/runtime/vm/compiler/stub_code_compiler_arm.cc
+++ b/runtime/vm/compiler/stub_code_compiler_arm.cc
@@ -12,7 +12,7 @@
#include "vm/compiler/stub_code_compiler.h"
-#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM)
#include "vm/class_id.h"
#include "vm/code_entry_kind.h"
@@ -1349,9 +1349,11 @@
// R3 : current thread.
void StubCodeCompiler::GenerateInvokeDartCodeFromBytecodeStub(
Assembler* assembler) {
-#if defined(DART_PRECOMPILED_RUNTIME)
- __ Stop("Not using interpreter");
-#else
+ if (FLAG_precompiled_mode) {
+ __ Stop("Not using interpreter");
+ return;
+ }
+
__ Push(LR); // Marker for the profiler.
__ EnterFrame((1 << FP) | (1 << LR), 0);
@@ -1482,7 +1484,6 @@
__ LeaveFrame((1 << FP) | (1 << LR));
__ Drop(1);
__ Ret();
-#endif // defined(DART_PRECOMPILED_RUNTIME)
}
// Helper to generate space allocation of context stub.
@@ -2712,9 +2713,10 @@
// R4: Arguments descriptor.
// R0: Function.
void StubCodeCompiler::GenerateInterpretCallStub(Assembler* assembler) {
-#if defined(DART_PRECOMPILED_RUNTIME)
- __ Stop("Not using interpreter")
-#else
+ if (FLAG_precompiled_mode) {
+ __ Stop("Not using interpreter");
+ return;
+ }
__ EnterStubFrame();
#if defined(DEBUG)
@@ -2780,7 +2782,6 @@
__ LeaveStubFrame();
__ Ret();
-#endif // defined(DART_PRECOMPILED_RUNTIME)
}
// R9: Contains an ICData.
@@ -3154,6 +3155,10 @@
void StubCodeCompiler::GenerateSlowTypeTestStub(Assembler* assembler) {
Label done, call_runtime;
+ if (!(FLAG_precompiled_mode && FLAG_use_bare_instructions)) {
+ __ ldr(CODE_REG,
+ Address(THR, target::Thread::slow_type_test_stub_offset()));
+ }
__ EnterStubFrame();
// If the subtype-cache is null, it needs to be lazily-created by the runtime.
@@ -3772,4 +3777,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM)
diff --git a/runtime/vm/compiler/stub_code_compiler_arm64.cc b/runtime/vm/compiler/stub_code_compiler_arm64.cc
index ced8835..49004b6 100644
--- a/runtime/vm/compiler/stub_code_compiler_arm64.cc
+++ b/runtime/vm/compiler/stub_code_compiler_arm64.cc
@@ -11,7 +11,7 @@
#include "vm/compiler/stub_code_compiler.h"
-#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_ARM64)
#include "vm/class_id.h"
#include "vm/code_entry_kind.h"
@@ -1446,9 +1446,11 @@
// R3 : current thread.
void StubCodeCompiler::GenerateInvokeDartCodeFromBytecodeStub(
Assembler* assembler) {
-#if defined(DART_PRECOMPILED_RUNTIME)
- __ Stop("Not using interpreter");
-#else
+ if (FLAG_precompiled_mode) {
+ __ Stop("Not using interpreter");
+ return;
+ }
+
// Copy the C stack pointer (CSP/R31) into the stack pointer we'll actually
// use to access the stack (SP/R15) and set the C stack pointer to near the
// stack limit, loaded from the Thread held in R3, to prevent signal handlers
@@ -1576,7 +1578,6 @@
__ Drop(1);
__ RestoreCSP();
__ ret();
-#endif // defined(DART_PRECOMPILED_RUNTIME)
}
// Helper to generate space allocation of context stub.
@@ -2841,9 +2842,11 @@
// R4: Arguments descriptor.
// R0: Function.
void StubCodeCompiler::GenerateInterpretCallStub(Assembler* assembler) {
-#if defined(DART_PRECOMPILED_RUNTIME)
- __ Stop("Not using interpreter")
-#else
+ if (FLAG_precompiled_mode) {
+ __ Stop("Not using interpreter");
+ return;
+ }
+
__ SetPrologueOffset();
__ EnterStubFrame();
@@ -2919,7 +2922,6 @@
__ LeaveStubFrame();
__ ret();
-#endif // defined(DART_PRECOMPILED_RUNTIME)
}
// R5: Contains an ICData.
@@ -3276,6 +3278,10 @@
void StubCodeCompiler::GenerateSlowTypeTestStub(Assembler* assembler) {
Label done, call_runtime;
+ if (!(FLAG_precompiled_mode && FLAG_use_bare_instructions)) {
+ __ ldr(CODE_REG,
+ Address(THR, target::Thread::slow_type_test_stub_offset()));
+ }
__ EnterStubFrame();
// If the subtype-cache is null, it needs to be lazily-created by the runtime.
@@ -3909,4 +3915,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_ARM64)
diff --git a/runtime/vm/compiler/stub_code_compiler_ia32.cc b/runtime/vm/compiler/stub_code_compiler_ia32.cc
index 15a5c89..1bfc1d5 100644
--- a/runtime/vm/compiler/stub_code_compiler_ia32.cc
+++ b/runtime/vm/compiler/stub_code_compiler_ia32.cc
@@ -11,7 +11,7 @@
#include "vm/compiler/stub_code_compiler.h"
-#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_IA32)
#include "vm/class_id.h"
#include "vm/code_entry_kind.h"
@@ -3029,4 +3029,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_IA32)
diff --git a/runtime/vm/compiler/stub_code_compiler_x64.cc b/runtime/vm/compiler/stub_code_compiler_x64.cc
index 9a2b2c7..2f662a4 100644
--- a/runtime/vm/compiler/stub_code_compiler_x64.cc
+++ b/runtime/vm/compiler/stub_code_compiler_x64.cc
@@ -13,7 +13,7 @@
#include "vm/compiler/backend/locations.h"
#include "vm/compiler/stub_code_compiler.h"
-#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+#if defined(TARGET_ARCH_X64)
#include "vm/class_id.h"
#include "vm/code_entry_kind.h"
@@ -1338,9 +1338,11 @@
// RCX : current thread.
void StubCodeCompiler::GenerateInvokeDartCodeFromBytecodeStub(
Assembler* assembler) {
-#if defined(DART_PRECOMPILED_RUNTIME)
- __ Stop("Not using interpreter");
-#else
+ if (FLAG_precompiled_mode) {
+ __ Stop("Not using interpreter");
+ return;
+ }
+
__ pushq(Address(RSP, 0)); // Marker for the profiler.
__ EnterFrame(0);
@@ -1484,7 +1486,6 @@
__ popq(RCX);
__ ret();
-#endif // defined(DART_PRECOMPILED_RUNTIME)
}
// Helper to generate space allocation of context stub.
@@ -2761,9 +2762,11 @@
// R10: Arguments descriptor.
// RAX: Function.
void StubCodeCompiler::GenerateInterpretCallStub(Assembler* assembler) {
-#if defined(DART_PRECOMPILED_RUNTIME)
- __ Stop("Not using interpreter");
-#else
+ if (FLAG_precompiled_mode) {
+ __ Stop("Not using interpreter");
+ return;
+ }
+
__ EnterStubFrame();
#if defined(DEBUG)
@@ -2833,7 +2836,6 @@
__ LeaveStubFrame();
__ ret();
-#endif // defined(DART_PRECOMPILED_RUNTIME)
}
// RBX: Contains an ICData.
@@ -3205,6 +3207,10 @@
void StubCodeCompiler::GenerateSlowTypeTestStub(Assembler* assembler) {
Label done, call_runtime;
+ if (!(FLAG_precompiled_mode && FLAG_use_bare_instructions)) {
+ __ movq(CODE_REG,
+ Address(THR, target::Thread::slow_type_test_stub_offset()));
+ }
__ EnterStubFrame();
// If the subtype-cache is null, it needs to be lazily-created by the runtime.
@@ -3798,4 +3804,4 @@
} // namespace dart
-#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+#endif // defined(TARGET_ARCH_X64)
diff --git a/runtime/vm/compiler/type_testing_stubs_arm.cc b/runtime/vm/compiler/type_testing_stubs_arm.cc
new file mode 100644
index 0000000..ed1ace2
--- /dev/null
+++ b/runtime/vm/compiler/type_testing_stubs_arm.cc
@@ -0,0 +1,37 @@
+// Copyright (c) 2019, 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.
+
+#include "vm/globals.h"
+
+#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
+
+#include "vm/type_testing_stubs.h"
+
+#define __ assembler->
+
+namespace dart {
+
+void TypeTestingStubGenerator::BuildOptimizedTypeTestStub(
+ compiler::Assembler* assembler,
+ compiler::UnresolvedPcRelativeCalls* unresolved_calls,
+ const Code& slow_type_test_stub,
+ HierarchyInfo* hi,
+ const Type& type,
+ const Class& type_class) {
+ BuildOptimizedTypeTestStubFastCases(assembler, hi, type, type_class);
+ if (!compiler::IsSameObject(
+ compiler::NullObject(),
+ compiler::CastHandle<Object>(slow_type_test_stub))) {
+ __ GenerateUnRelocatedPcRelativeTailCall();
+ unresolved_calls->Add(new compiler::UnresolvedPcRelativeCall(
+ __ CodeSize(), slow_type_test_stub, /*is_tail_call=*/true));
+ } else {
+ __ Branch(compiler::Address(
+ THR, compiler::target::Thread::slow_type_test_entry_point_offset()));
+ }
+}
+
+} // namespace dart
+
+#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/type_testing_stubs_arm64.cc b/runtime/vm/compiler/type_testing_stubs_arm64.cc
new file mode 100644
index 0000000..0540b01
--- /dev/null
+++ b/runtime/vm/compiler/type_testing_stubs_arm64.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2019, 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.
+
+#include "vm/globals.h"
+
+#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
+
+#include "vm/type_testing_stubs.h"
+
+#define __ assembler->
+
+namespace dart {
+
+void TypeTestingStubGenerator::BuildOptimizedTypeTestStub(
+ compiler::Assembler* assembler,
+ compiler::UnresolvedPcRelativeCalls* unresolved_calls,
+ const Code& slow_type_test_stub,
+ HierarchyInfo* hi,
+ const Type& type,
+ const Class& type_class) {
+ BuildOptimizedTypeTestStubFastCases(assembler, hi, type, type_class);
+ if (!compiler::IsSameObject(
+ compiler::NullObject(),
+ compiler::CastHandle<Object>(slow_type_test_stub))) {
+ __ GenerateUnRelocatedPcRelativeTailCall();
+ unresolved_calls->Add(new compiler::UnresolvedPcRelativeCall(
+ __ CodeSize(), slow_type_test_stub, /*is_tail_call=*/true));
+ } else {
+ __ ldr(TMP,
+ compiler::Address(
+ THR,
+ compiler::target::Thread::slow_type_test_entry_point_offset()));
+ __ br(TMP);
+ }
+}
+
+} // namespace dart
+
+#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/type_testing_stubs_x64.cc b/runtime/vm/compiler/type_testing_stubs_x64.cc
new file mode 100644
index 0000000..f7a974c
--- /dev/null
+++ b/runtime/vm/compiler/type_testing_stubs_x64.cc
@@ -0,0 +1,37 @@
+// Copyright (c) 2019, 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.
+
+#include "vm/globals.h"
+
+#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
+
+#include "vm/type_testing_stubs.h"
+
+#define __ assembler->
+
+namespace dart {
+
+void TypeTestingStubGenerator::BuildOptimizedTypeTestStub(
+ compiler::Assembler* assembler,
+ compiler::UnresolvedPcRelativeCalls* unresolved_calls,
+ const Code& slow_type_test_stub,
+ HierarchyInfo* hi,
+ const Type& type,
+ const Class& type_class) {
+ BuildOptimizedTypeTestStubFastCases(assembler, hi, type, type_class);
+ if (!compiler::IsSameObject(
+ compiler::NullObject(),
+ compiler::CastHandle<Object>(slow_type_test_stub))) {
+ __ GenerateUnRelocatedPcRelativeTailCall();
+ unresolved_calls->Add(new compiler::UnresolvedPcRelativeCall(
+ __ CodeSize(), slow_type_test_stub, /*is_tail_call=*/true));
+ } else {
+ __ jmp(compiler::Address(
+ THR, compiler::target::Thread::slow_type_test_entry_point_offset()));
+ }
+}
+
+} // namespace dart
+
+#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/write_barrier_elimination.h b/runtime/vm/compiler/write_barrier_elimination.h
index 88109e7..b4d200f 100644
--- a/runtime/vm/compiler/write_barrier_elimination.h
+++ b/runtime/vm/compiler/write_barrier_elimination.h
@@ -5,6 +5,10 @@
#ifndef RUNTIME_VM_COMPILER_WRITE_BARRIER_ELIMINATION_H_
#define RUNTIME_VM_COMPILER_WRITE_BARRIER_ELIMINATION_H_
+#if defined(DART_PRECOMPILED_RUNTIME)
+#error "AOT runtime should not use compiler sources (including header files)"
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
namespace dart {
class FlowGraph;
diff --git a/runtime/vm/cpu_arm.cc b/runtime/vm/cpu_arm.cc
index 6ab6eee..c9dcdc5 100644
--- a/runtime/vm/cpu_arm.cc
+++ b/runtime/vm/cpu_arm.cc
@@ -8,7 +8,6 @@
#include "vm/cpu.h"
#include "vm/cpu_arm.h"
-#include "vm/compiler/assembler/assembler.h"
#include "vm/cpuinfo.h"
#include "vm/heap/heap.h"
#include "vm/isolate.h"
diff --git a/runtime/vm/instructions_arm.cc b/runtime/vm/instructions_arm.cc
index 545d5eb..37f4113 100644
--- a/runtime/vm/instructions_arm.cc
+++ b/runtime/vm/instructions_arm.cc
@@ -8,7 +8,6 @@
#include "vm/instructions.h"
#include "vm/instructions_arm.h"
-#include "vm/compiler/assembler/assembler.h"
#include "vm/constants.h"
#include "vm/cpu.h"
#include "vm/object.h"
@@ -452,13 +451,23 @@
intptr_t TypeTestingStubCallPattern::GetSubtypeTestCachePoolIndex() {
// Calls to the type testing stubs look like:
+ // ldr R9, ...
// ldr R3, [PP+idx]
// blx R9
+ // or
+ // ldr R3, [PP+idx]
+ // blx pc+<offset>
// Ensure the caller of the type testing stub (whose return address is [pc_])
- // branched via the `blx R9` instruction.
- ASSERT(*reinterpret_cast<uint32_t*>(pc_ - Instr::kInstrSize) == 0xe12fff39);
- const uword load_instr_end = pc_ - Instr::kInstrSize;
+ // branched via `blx R9` or a pc-relative call.
+ uword pc = pc_ - Instr::kInstrSize;
+ const uword blx_r9 = 0xe12fff39;
+ if (*reinterpret_cast<uint32_t*>(pc) != blx_r9) {
+ PcRelativeCallPattern pattern(pc);
+ RELEASE_ASSERT(pattern.IsValid());
+ }
+
+ const uword load_instr_end = pc;
Register reg;
intptr_t pool_index = -1;
diff --git a/runtime/vm/instructions_arm.h b/runtime/vm/instructions_arm.h
index 92f8acf..6933278 100644
--- a/runtime/vm/instructions_arm.h
+++ b/runtime/vm/instructions_arm.h
@@ -11,10 +11,13 @@
#endif
#include "vm/allocation.h"
-#include "vm/compiler/assembler/assembler.h"
#include "vm/constants.h"
#include "vm/native_function.h"
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#include "vm/compiler/assembler/assembler.h"
+#endif // !defined(DART_PRECOMPILED_RUNTIME)
+
namespace dart {
class ICData;
diff --git a/runtime/vm/instructions_arm64.cc b/runtime/vm/instructions_arm64.cc
index f308138..c83b9e2 100644
--- a/runtime/vm/instructions_arm64.cc
+++ b/runtime/vm/instructions_arm64.cc
@@ -8,7 +8,6 @@
#include "vm/instructions.h"
#include "vm/instructions_arm64.h"
-#include "vm/compiler/assembler/assembler.h"
#include "vm/constants.h"
#include "vm/cpu.h"
#include "vm/object.h"
@@ -558,13 +557,23 @@
intptr_t TypeTestingStubCallPattern::GetSubtypeTestCachePoolIndex() {
// Calls to the type testing stubs look like:
+ // ldr R9, ...
// ldr R3, [PP+idx]
// blr R9
+ // or
+ // ldr R3, [PP+idx]
+ // blr pc+<offset>
// Ensure the caller of the type testing stub (whose return address is [pc_])
- // branched via the `blr R9` instruction.
- ASSERT(*reinterpret_cast<uint32_t*>(pc_ - Instr::kInstrSize) == 0xd63f0120);
- const uword load_instr_end = pc_ - Instr::kInstrSize;
+ // branched via `blr R9` or a pc-relative call.
+ uword pc = pc_ - Instr::kInstrSize;
+ const uword blr_r9 = 0xd63f0120;
+ if (*reinterpret_cast<uint32_t*>(pc) != blr_r9) {
+ PcRelativeCallPattern pattern(pc);
+ RELEASE_ASSERT(pattern.IsValid());
+ }
+
+ const uword load_instr_end = pc;
Register reg;
intptr_t pool_index = -1;
diff --git a/runtime/vm/instructions_arm64.h b/runtime/vm/instructions_arm64.h
index ab8bff9..2c1b62b 100644
--- a/runtime/vm/instructions_arm64.h
+++ b/runtime/vm/instructions_arm64.h
@@ -11,14 +11,18 @@
#endif
#include "vm/allocation.h"
-#include "vm/compiler/assembler/assembler.h"
#include "vm/constants.h"
#include "vm/native_function.h"
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#include "vm/compiler/assembler/assembler.h"
+#endif // !defined(DART_PRECOMPILED_RUNTIME)
+
namespace dart {
class Code;
class ICData;
+class Object;
class ObjectPool;
class RawCode;
class RawICData;
diff --git a/runtime/vm/instructions_x64.cc b/runtime/vm/instructions_x64.cc
index 2225a3e..cbeba5f 100644
--- a/runtime/vm/instructions_x64.cc
+++ b/runtime/vm/instructions_x64.cc
@@ -86,21 +86,37 @@
}
intptr_t TypeTestingStubCallPattern::GetSubtypeTestCachePoolIndex() {
+ static int16_t indirect_call_pattern[] = {
+ 0xff, -1 /* 0x53 or 0x56 */, 0x07, // callq [RBX/RSI + 0x7]
+ };
+ static int16_t direct_call_pattern[] = {
+ 0xe8, -1, -1, -1, -1, // callq [PC + <offset>]
+ };
static int16_t pattern_disp8[] = {
0x4d, 0x8b, 0x4f, -1, // movq R9, [PP + offset]
- 0xff, -1 /* 0x53 or 0x56 */, 0x07, // callq [RBX/RSI + 0x7]
};
static int16_t pattern_disp32[] = {
0x4d, 0x8b, 0x8f, -1, -1, -1, -1, // movq R9, [PP + offset]
- 0xff, -1 /* 0x53 or 0x56 */, 0x07, // callq [RBX/RSI + 0x7]
};
- if (MatchesPattern(pc_, pattern_disp8, ARRAY_SIZE(pattern_disp8))) {
- return IndexFromPPLoadDisp8(pc_ - 4);
- } else if (MatchesPattern(pc_, pattern_disp32, ARRAY_SIZE(pattern_disp32))) {
- return IndexFromPPLoadDisp32(pc_ - 7);
+
+ uword pc = pc_;
+ if (MatchesPattern(pc, direct_call_pattern,
+ ARRAY_SIZE(direct_call_pattern))) {
+ pc -= ARRAY_SIZE(direct_call_pattern);
+ } else if (MatchesPattern(pc, indirect_call_pattern,
+ ARRAY_SIZE(indirect_call_pattern))) {
+ pc -= ARRAY_SIZE(indirect_call_pattern);
} else {
FATAL1("Failed to decode at %" Px, pc_);
}
+
+ if (MatchesPattern(pc, pattern_disp8, ARRAY_SIZE(pattern_disp8))) {
+ return IndexFromPPLoadDisp8(pc - 1);
+ } else if (MatchesPattern(pc, pattern_disp32, ARRAY_SIZE(pattern_disp32))) {
+ return IndexFromPPLoadDisp32(pc - 4);
+ } else {
+ FATAL1("Failed to decode at %" Px, pc);
+ }
}
} // namespace dart
diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc
index 754d2e5..b4fea2c 100644
--- a/runtime/vm/kernel_loader.cc
+++ b/runtime/vm/kernel_loader.cc
@@ -2182,14 +2182,6 @@
}
ASSERT(field.NeedsGetter());
- if (field.is_late() && !field.is_static() &&
- field.has_nontrivial_initializer()) {
- // Late fields are initialized to Object::sentinel, which is a flavor of
- // null. So we need to record that store so that the field guard doesn't
- // prematurely optimise out the late field's sentinel checking logic.
- field.RecordStore(Object::null_object());
- }
-
const String& getter_name = H.DartGetterName(field_helper->canonical_name_);
const Object& script_class =
ClassForScriptAt(klass, field_helper->source_uri_index_);
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index aac5f8b..db8ab2a 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -780,21 +780,21 @@
cls.set_is_declaration_loaded();
cls.set_is_type_finalized();
- // Allocate and initialize the sentinel values of Null class.
+ // Allocate and initialize the sentinel values.
{
*sentinel_ ^=
- Object::Allocate(kNullCid, Instance::InstanceSize(), Heap::kOld);
+ Object::Allocate(kNeverCid, Instance::InstanceSize(), Heap::kOld);
*transition_sentinel_ ^=
- Object::Allocate(kNullCid, Instance::InstanceSize(), Heap::kOld);
+ Object::Allocate(kNeverCid, Instance::InstanceSize(), Heap::kOld);
}
// Allocate and initialize optimizing compiler constants.
{
*unknown_constant_ ^=
- Object::Allocate(kNullCid, Instance::InstanceSize(), Heap::kOld);
+ Object::Allocate(kNeverCid, Instance::InstanceSize(), Heap::kOld);
*non_constant_ ^=
- Object::Allocate(kNullCid, Instance::InstanceSize(), Heap::kOld);
+ Object::Allocate(kNeverCid, Instance::InstanceSize(), Heap::kOld);
}
// Allocate the remaining VM internal classes.
@@ -15717,7 +15717,7 @@
StaticCallsTable entries(array);
ASSERT(code.IsNull() ||
(code.function() == entries[i].Get<kSCallTableFunctionTarget>()));
- return entries[i].Set<kSCallTableCodeTarget>(code);
+ return entries[i].Set<kSCallTableCodeOrTypeTarget>(code);
#endif
}
@@ -15737,7 +15737,7 @@
(code.function() == entries[i].Get<kSCallTableFunctionTarget>()));
}
#endif
- return entries[i].Set<kSCallTableCodeTarget>(code);
+ return entries[i].Set<kSCallTableCodeOrTypeTarget>(code);
#endif
}
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 8c2c21b..fad2bef 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -6043,8 +6043,9 @@
enum CallKind {
kPcRelativeCall = 1,
- kPcRelativeTailCall = 2,
- kCallViaCode = 3,
+ kPcRelativeTTSCall = 2,
+ kPcRelativeTailCall = 3,
+ kCallViaCode = 4,
};
enum CallEntryPoint {
@@ -6054,7 +6055,7 @@
enum SCallTableEntry {
kSCallTableKindAndOffset = 0,
- kSCallTableCodeTarget = 1,
+ kSCallTableCodeOrTypeTarget = 1,
kSCallTableFunctionTarget = 2,
kSCallTableEntryLength = 3,
};
@@ -6064,11 +6065,11 @@
kNotAttachPool,
};
- class KindField : public BitField<intptr_t, CallKind, 0, 2> {};
+ class KindField : public BitField<intptr_t, CallKind, 0, 3> {};
class EntryPointField
: public BitField<intptr_t, CallEntryPoint, KindField::kNextBit, 1> {};
class OffsetField
- : public BitField<intptr_t, intptr_t, EntryPointField::kNextBit, 27> {};
+ : public BitField<intptr_t, intptr_t, EntryPointField::kNextBit, 26> {};
void set_static_calls_target_table(const Array& value) const;
RawArray* static_calls_target_table() const {
@@ -11189,7 +11190,9 @@
std::tuple<String, Array, Function>>;
using StaticCallsTable =
- ArrayOfTuplesView<Code::SCallTableEntry, std::tuple<Smi, Code, Function>>;
+ ArrayOfTuplesView<Code::SCallTableEntry, std::tuple<Smi, Object, Function>>;
+
+using StaticCallsTableEntry = StaticCallsTable::TupleView;
using SubtypeTestCacheTable = ArrayOfTuplesView<SubtypeTestCache::Entries,
std::tuple<Object,
diff --git a/runtime/vm/object_store.h b/runtime/vm/object_store.h
index ecffe42..e2381e9 100644
--- a/runtime/vm/object_store.h
+++ b/runtime/vm/object_store.h
@@ -196,6 +196,11 @@
RW(Code, instance_of_stub) \
RW(Code, init_static_field_stub) \
RW(Code, call_closure_no_such_method_stub) \
+ RW(Code, default_tts_stub) \
+ RW(Code, default_nullable_tts_stub) \
+ RW(Code, top_type_tts_stub) \
+ RW(Code, unreachable_tts_stub) \
+ RW(Code, slow_tts_stub) \
R_(Code, megamorphic_call_miss_code) \
R_(Function, megamorphic_call_miss_function) \
RW(Array, dispatch_table_code_entries) \
@@ -228,6 +233,11 @@
DO(allocate_object_parametrized_stub, AllocateObjectParameterized) \
DO(clone_context_stub, CloneContext) \
DO(call_closure_no_such_method_stub, CallClosureNoSuchMethod) \
+ DO(default_tts_stub, DefaultTypeTest) \
+ DO(default_nullable_tts_stub, DefaultNullableTypeTest) \
+ DO(top_type_tts_stub, TopTypeTypeTest) \
+ DO(unreachable_tts_stub, UnreachableTypeTest) \
+ DO(slow_tts_stub, SlowTypeTest) \
DO(write_barrier_wrappers_stub, WriteBarrierWrappers) \
DO(array_write_barrier_stub, ArrayWriteBarrier) \
DO(throw_stub, Throw) \
diff --git a/runtime/vm/program_visitor.cc b/runtime/vm/program_visitor.cc
index b6f364f..087c701 100644
--- a/runtime/vm/program_visitor.cc
+++ b/runtime/vm/program_visitor.cc
@@ -87,7 +87,7 @@
class_code_(Code::Handle(zone)),
function_code_(Code::Handle(zone)),
static_calls_array_(Array::Handle(zone)),
- static_call_code_(Code::Handle(zone)),
+ static_calls_table_entry_(Object::Handle(zone)),
worklist_entry_(Object::Handle(zone)) {}
~ProgramWalker() { heap_->ResetObjectIdTable(); }
@@ -180,8 +180,10 @@
if (static_calls_array_.IsNull()) return;
StaticCallsTable static_calls(static_calls_array_);
for (auto& view : static_calls) {
- static_call_code_ = view.Get<Code::kSCallTableCodeTarget>();
- AddToWorklist(static_call_code_);
+ static_calls_table_entry_ = view.Get<Code::kSCallTableCodeOrTypeTarget>();
+ if (static_calls_table_entry_.IsCode()) {
+ AddToWorklist(Code::Cast(static_calls_table_entry_));
+ }
}
}
@@ -196,7 +198,7 @@
Code& class_code_;
Code& function_code_;
Array& static_calls_array_;
- Code& static_call_code_;
+ Object& static_calls_table_entry_;
Object& worklist_entry_;
};
@@ -349,15 +351,17 @@
kind_and_offset_ = view.Get<Code::kSCallTableKindAndOffset>();
auto const kind = Code::KindField::decode(kind_and_offset_.Value());
if (kind != Code::kCallViaCode) {
- ASSERT(!FLAG_precompiled_mode || kind == Code::kPcRelativeCall ||
- kind == Code::kPcRelativeTailCall);
+ ASSERT(kind == Code::kPcRelativeCall ||
+ kind == Code::kPcRelativeTailCall ||
+ kind == Code::kPcRelativeTTSCall);
only_call_via_code = false;
continue;
}
target_ = view.Get<Code::kSCallTableFunctionTarget>();
if (target_.IsNull()) {
- target_ = view.Get<Code::kSCallTableCodeTarget>();
+ target_ =
+ Code::RawCast(view.Get<Code::kSCallTableCodeOrTypeTarget>());
ASSERT(!Code::Cast(target_).IsFunctionCode());
// Allocation stub or AllocateContext or AllocateArray or ...
continue;
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index 871aa0b1..c2270e0 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -358,6 +358,7 @@
break;
}
case kNullCid:
+ case kNeverCid:
size = HeapSize();
break;
default:
diff --git a/runtime/vm/runtime_entry_arm.cc b/runtime/vm/runtime_entry_arm.cc
index 8a38f5d..9502b49 100644
--- a/runtime/vm/runtime_entry_arm.cc
+++ b/runtime/vm/runtime_entry_arm.cc
@@ -7,10 +7,13 @@
#include "vm/runtime_entry.h"
-#include "vm/compiler/assembler/assembler.h"
#include "vm/simulator.h"
#include "vm/stub_code.h"
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#include "vm/compiler/assembler/assembler.h"
+#endif // !defined(DART_PRECOMPILED_RUNTIME)
+
namespace dart {
#define __ assembler->
diff --git a/runtime/vm/runtime_entry_arm64.cc b/runtime/vm/runtime_entry_arm64.cc
index 83ba08d..129dae3 100644
--- a/runtime/vm/runtime_entry_arm64.cc
+++ b/runtime/vm/runtime_entry_arm64.cc
@@ -7,10 +7,13 @@
#include "vm/runtime_entry.h"
-#include "vm/compiler/assembler/assembler.h"
#include "vm/simulator.h"
#include "vm/stub_code.h"
+#if !defined(DART_PRECOMPILED_RUNTIME)
+#include "vm/compiler/assembler/assembler.h"
+#endif // !defined(DART_PRECOMPILED_RUNTIME)
+
namespace dart {
#define __ assembler->
diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc
index 64ba0ee..4410cfb 100644
--- a/runtime/vm/simulator_arm.cc
+++ b/runtime/vm/simulator_arm.cc
@@ -13,7 +13,6 @@
#include "vm/simulator.h"
-#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/assembler/disassembler.h"
#include "vm/constants.h"
#include "vm/cpu.h"
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index b1fef2f..3ab2750 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -13,7 +13,6 @@
#include "vm/simulator.h"
-#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/assembler/disassembler.h"
#include "vm/constants.h"
#include "vm/native_arguments.h"
diff --git a/runtime/vm/stub_code.cc b/runtime/vm/stub_code.cc
index 21b71d5..8f84851 100644
--- a/runtime/vm/stub_code.cc
+++ b/runtime/vm/stub_code.cc
@@ -128,7 +128,7 @@
}
#if !defined(DART_PRECOMPILED_RUNTIME)
-static RawArray* BuildStaticCallsTable(
+RawArray* compiler::StubCodeCompiler::BuildStaticCallsTable(
Zone* zone,
compiler::UnresolvedPcRelativeCalls* unresolved_calls) {
if (unresolved_calls->length() == 0) {
@@ -150,7 +150,7 @@
Code::OffsetField::encode(unresolved_call->offset()));
auto view = entries[i];
view.Set<Code::kSCallTableKindAndOffset>(kind_type_and_offset);
- view.Set<Code::kSCallTableCodeTarget>(unresolved_call->target());
+ view.Set<Code::kSCallTableCodeOrTypeTarget>(unresolved_call->target());
}
return static_calls_table.raw();
}
@@ -201,7 +201,8 @@
allocate_object_parametrized_stub);
const auto& static_calls_table =
- Array::Handle(zone, BuildStaticCallsTable(zone, &unresolved_calls));
+ Array::Handle(zone, compiler::StubCodeCompiler::BuildStaticCallsTable(
+ zone, &unresolved_calls));
auto mutator_fun = [&]() {
stub = Code::FinalizeCode(nullptr, &assembler, pool_attachment,
@@ -318,6 +319,14 @@
return entries_[i].name;
}
}
+
+ auto object_store = Isolate::Current()->object_store();
+#define DO(member, name) \
+ if (entry_point == Code::EntryPointOf(object_store->member())) { \
+ return "_iso_stub_" #name "Stub"; \
+ }
+ OBJECT_STORE_STUB_CODE_LIST(DO)
+#undef DO
return nullptr;
}
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 077fa83..bee44edb 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -198,7 +198,9 @@
V(uword, optimize_entry_, StubCode::OptimizeFunction().EntryPoint(), 0) \
V(uword, deoptimize_entry_, StubCode::Deoptimize().EntryPoint(), 0) \
V(uword, call_native_through_safepoint_entry_point_, \
- StubCode::CallNativeThroughSafepoint().EntryPoint(), 0)
+ StubCode::CallNativeThroughSafepoint().EntryPoint(), 0) \
+ V(uword, slow_type_test_entry_point_, StubCode::SlowTypeTest().EntryPoint(), \
+ 0)
#define CACHED_ADDRESSES_LIST(V) \
CACHED_VM_STUBS_ADDRESSES_LIST(V) \
diff --git a/runtime/vm/type_testing_stubs.cc b/runtime/vm/type_testing_stubs.cc
index b55430a..ca27574 100644
--- a/runtime/vm/type_testing_stubs.cc
+++ b/runtime/vm/type_testing_stubs.cc
@@ -180,6 +180,7 @@
RawCode* TypeTestingStubGenerator::BuildCodeForType(const Type& type) {
auto thread = Thread::Current();
+ auto zone = thread->zone();
HierarchyInfo* hi = thread->hierarchy_info();
ASSERT(hi != NULL);
@@ -191,9 +192,20 @@
const Class& type_class = Class::Handle(type.type_class());
ASSERT(!type_class.IsNull());
+ auto& slow_tts_stub = Code::ZoneHandle(zone);
+ if (FLAG_precompiled_mode && FLAG_use_bare_instructions) {
+ slow_tts_stub = thread->isolate()->object_store()->slow_tts_stub();
+ }
+
// To use the already-defined __ Macro !
compiler::Assembler assembler(nullptr);
- BuildOptimizedTypeTestStub(&assembler, hi, type, type_class);
+ compiler::UnresolvedPcRelativeCalls unresolved_calls;
+ BuildOptimizedTypeTestStub(&assembler, &unresolved_calls, slow_tts_stub, hi,
+ type, type_class);
+
+ const auto& static_calls_table =
+ Array::Handle(zone, compiler::StubCodeCompiler::BuildStaticCallsTable(
+ zone, &unresolved_calls));
const char* name = namer_.StubNameForType(type);
const auto pool_attachment = FLAG_use_bare_instructions
@@ -204,6 +216,9 @@
auto install_code_fun = [&]() {
code = Code::FinalizeCode(nullptr, &assembler, pool_attachment,
/*optimized=*/false, /*stats=*/nullptr);
+ if (!static_calls_table.IsNull()) {
+ code.set_static_calls_target_table(static_calls_table);
+ }
};
// We have to ensure no mutators are running, because:
diff --git a/runtime/vm/type_testing_stubs.h b/runtime/vm/type_testing_stubs.h
index 2b1279c..345ef31 100644
--- a/runtime/vm/type_testing_stubs.h
+++ b/runtime/vm/type_testing_stubs.h
@@ -10,11 +10,11 @@
#if !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/backend/il.h"
+#include "vm/compiler/stub_code_compiler.h"
#endif // !defined(DART_PRECOMPILED_RUNTIME)
namespace dart {
-
class TypeTestingStubNamer {
public:
TypeTestingStubNamer();
@@ -58,10 +58,13 @@
#if !defined(TARGET_ARCH_IA32)
#if !defined(DART_PRECOMPILED_RUNTIME)
RawCode* BuildCodeForType(const Type& type);
- static void BuildOptimizedTypeTestStub(compiler::Assembler* assembler,
- HierarchyInfo* hi,
- const Type& type,
- const Class& type_class);
+ static void BuildOptimizedTypeTestStub(
+ compiler::Assembler* assembler,
+ compiler::UnresolvedPcRelativeCalls* unresolved_calls,
+ const Code& slow_type_test_stub,
+ HierarchyInfo* hi,
+ const Type& type,
+ const Class& type_class);
static void BuildOptimizedTypeTestStubFastCases(
compiler::Assembler* assembler,
diff --git a/runtime/vm/type_testing_stubs_arm.cc b/runtime/vm/type_testing_stubs_arm.cc
deleted file mode 100644
index 6b176ce..0000000
--- a/runtime/vm/type_testing_stubs_arm.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2019, 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.
-
-#include "vm/globals.h"
-
-#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
-
-#include "vm/type_testing_stubs.h"
-
-#define __ assembler->
-
-namespace dart {
-
-void TypeTestingStubGenerator::BuildOptimizedTypeTestStub(
- compiler::Assembler* assembler,
- HierarchyInfo* hi,
- const Type& type,
- const Class& type_class) {
- BuildOptimizedTypeTestStubFastCases(assembler, hi, type, type_class);
-
- __ ldr(CODE_REG,
- compiler::Address(
- THR, compiler::target::Thread::slow_type_test_stub_offset()));
- __ Branch(compiler::FieldAddress(
- CODE_REG, compiler::target::Code::entry_point_offset()));
-}
-
-} // namespace dart
-
-#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/type_testing_stubs_arm64.cc b/runtime/vm/type_testing_stubs_arm64.cc
deleted file mode 100644
index bc2df7f..0000000
--- a/runtime/vm/type_testing_stubs_arm64.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2019, 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.
-
-#include "vm/globals.h"
-
-#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
-
-#include "vm/type_testing_stubs.h"
-
-#define __ assembler->
-
-namespace dart {
-
-void TypeTestingStubGenerator::BuildOptimizedTypeTestStub(
- compiler::Assembler* assembler,
- HierarchyInfo* hi,
- const Type& type,
- const Class& type_class) {
- BuildOptimizedTypeTestStubFastCases(assembler, hi, type, type_class);
-
- __ ldr(CODE_REG,
- compiler::Address(THR, Thread::slow_type_test_stub_offset()));
- __ ldr(R9, compiler::FieldAddress(CODE_REG, Code::entry_point_offset()));
- __ br(R9);
-}
-
-} // namespace dart
-
-#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/type_testing_stubs_x64.cc b/runtime/vm/type_testing_stubs_x64.cc
deleted file mode 100644
index a942eb0..0000000
--- a/runtime/vm/type_testing_stubs_x64.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2019, 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.
-
-#include "vm/globals.h"
-
-#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
-
-#include "vm/type_testing_stubs.h"
-
-#define __ assembler->
-
-namespace dart {
-
-void TypeTestingStubGenerator::BuildOptimizedTypeTestStub(
- compiler::Assembler* assembler,
- HierarchyInfo* hi,
- const Type& type,
- const Class& type_class) {
- BuildOptimizedTypeTestStubFastCases(assembler, hi, type, type_class);
-
- __ movq(CODE_REG,
- compiler::Address(THR, Thread::slow_type_test_stub_offset()));
- __ jmp(compiler::FieldAddress(CODE_REG, Code::entry_point_offset()));
-}
-
-} // namespace dart
-
-#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/vm_sources.gni b/runtime/vm/vm_sources.gni
index a02d69b..d3560f0 100644
--- a/runtime/vm/vm_sources.gni
+++ b/runtime/vm/vm_sources.gni
@@ -343,9 +343,6 @@
"type_table.h",
"type_testing_stubs.cc",
"type_testing_stubs.h",
- "type_testing_stubs_arm.cc",
- "type_testing_stubs_arm64.cc",
- "type_testing_stubs_x64.cc",
"unibrow-inl.h",
"unibrow.cc",
"unibrow.h",
diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
index ef5fcd6..22d9d3d 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
@@ -900,17 +900,18 @@
JS('', '#[2]', parts), JS('', '#[3]', parts));
}
- List instantiateTypeBounds(List typeArgs) {
+ List<Object> instantiateTypeBounds(List typeArgs) {
if (!hasTypeBounds) {
- // We ommit the a bound to represent Object*. Other bounds are explicitly
+ // We omit the a bound to represent Object*. Other bounds are explicitly
// represented, including Object, Object? and dynamic.
// TODO(nshahan) Revisit this representation when more libraries have
// migrated to null safety.
- return List.filled(formalCount, legacy(unwrapType(Object)));
+ return List<Object>.filled(formalCount, legacy(unwrapType(Object)));
}
// Bounds can be recursive or depend on other type parameters, so we need to
// apply type arguments and return the resulting bounds.
- return JS('List', '#.apply(null, #)', _instantiateTypeBounds, typeArgs);
+ return JS<List<Object>>(
+ '!', '#.apply(null, #)', _instantiateTypeBounds, typeArgs);
}
toString() {
@@ -936,10 +937,30 @@
/// See the issue for the algorithm description:
/// <https://github.com/dart-lang/sdk/issues/27526#issuecomment-260021397>
List instantiateDefaultBounds() {
+ /// Returns `true` if the default value for the type bound should be
+ /// `dynamic`.
+ ///
+ /// Dart 2 with null safety uses dynamic as the default value for types
+ /// without explicit bounds.
+ ///
+ /// This is similar to [_isTop] but removes the check for `void` (it can't
+ /// be written as a bound) and adds a check of `Object*` in weak mode.
+ bool defaultsToDynamic(type) {
+ // Technically this is wrong, only implicit bounds of `Object?` and
+ // `Object*` should default to dynamic but code that observes the
+ // difference is rare.
+ if (_equalType(type, dynamic)) return true;
+ if (_jsInstanceOf(type, NullableType) ||
+ (!_strictSubtypeChecks && _jsInstanceOf(type, LegacyType))) {
+ return _equalType(JS('!', '#.type', type), Object);
+ }
+ return false;
+ }
+
var typeFormals = this.typeFormals;
// All type formals
- var all = HashMap<Object, int>.identity();
+ var all = HashMap<TypeVariable, int>.identity();
// ground types, by index.
//
// For each index, this will be a ground type for the corresponding type
@@ -955,8 +976,11 @@
var typeFormal = typeFormals[i];
var bound = typeBounds[i];
all[typeFormal] = i;
- if (identical(bound, _dynamic)) {
- defaults[i] = bound;
+ if (defaultsToDynamic(bound)) {
+ // TODO(nshahan) Persist the actual default values into the runtime so
+ // they can be used here instead of using dynamic for all top types
+ // implicit or explicit.
+ defaults[i] = _dynamic;
} else {
defaults[i] = typeFormal;
partials[typeFormal] = bound;
@@ -964,11 +988,12 @@
}
bool hasFreeFormal(t) {
+ if (partials.containsKey(t)) return true;
+
// Ignore nullability wrappers.
if (_jsInstanceOf(t, LegacyType) || _jsInstanceOf(t, NullableType)) {
return hasFreeFormal(JS<Object>('!', '#.type', t));
}
- if (partials.containsKey(t)) return true;
// Generic classes and typedefs.
var typeArgs = getGenericArgs(t);
if (typeArgs != null) return typeArgs.any(hasFreeFormal);
diff --git a/sdk/lib/_internal/js_runtime/lib/rti.dart b/sdk/lib/_internal/js_runtime/lib/rti.dart
index 22af777..ae12f72 100644
--- a/sdk/lib/_internal/js_runtime/lib/rti.dart
+++ b/sdk/lib/_internal/js_runtime/lib/rti.dart
@@ -991,20 +991,50 @@
/// Specialization for 'as bool?'.
/// Called from generated code.
-bool /*?*/ _asBoolNullable(object) {
+bool _asBool(object) {
+ if (_isBool(object)) return _Utils.asBool(object);
+ throw _TypeError.forType(object, 'bool');
+}
+
+/// Specialization for 'as bool*'.
+/// Called from generated code.
+bool /*?*/ _asBoolS(object) {
if (_isBool(object)) return _Utils.asBool(object);
if (object == null) return object;
throw _TypeError.forType(object, 'bool');
}
-/// Specialization for 'as double?'.
+/// Specialization for 'as bool?'.
/// Called from generated code.
-double /*?*/ _asDoubleNullable(object) {
+bool /*?*/ _asBoolQ(object) {
+ if (_isBool(object)) return _Utils.asBool(object);
+ if (object == null) return object;
+ throw _TypeError.forType(object, 'bool?');
+}
+
+/// Specialization for 'as double'.
+/// Called from generated code.
+double /*?*/ _asDouble(object) {
+ if (_isNum(object)) return _Utils.asDouble(object);
+ throw _TypeError.forType(object, 'double');
+}
+
+/// Specialization for 'as double*'.
+/// Called from generated code.
+double /*?*/ _asDoubleS(object) {
if (_isNum(object)) return _Utils.asDouble(object);
if (object == null) return object;
throw _TypeError.forType(object, 'double');
}
+/// Specialization for 'as double?'.
+/// Called from generated code.
+double /*?*/ _asDoubleQ(object) {
+ if (_isNum(object)) return _Utils.asDouble(object);
+ if (object == null) return object;
+ throw _TypeError.forType(object, 'double?');
+}
+
/// Specialization for 'is int'.
/// Called from generated code.
bool _isInt(object) {
@@ -1012,14 +1042,29 @@
JS('bool', 'Math.floor(#) === #', object, object);
}
-/// Specialization for 'as int?'.
+/// Specialization for 'as int'.
/// Called from generated code.
-int /*?*/ _asIntNullable(object) {
+int _asInt(object) {
+ if (_isInt(object)) return _Utils.asInt(object);
+ throw _TypeError.forType(object, 'int');
+}
+
+/// Specialization for 'as int*'.
+/// Called from generated code.
+int /*?*/ _asIntS(object) {
if (_isInt(object)) return _Utils.asInt(object);
if (object == null) return object;
throw _TypeError.forType(object, 'int');
}
+/// Specialization for 'as int?'.
+/// Called from generated code.
+int /*?*/ _asIntQ(object) {
+ if (_isInt(object)) return _Utils.asInt(object);
+ if (object == null) return object;
+ throw _TypeError.forType(object, 'int?');
+}
+
/// Specialization for 'is num' and 'is double'.
/// Called from generated code.
bool _isNum(object) {
@@ -1028,26 +1073,56 @@
/// Specialization for 'as num?'.
/// Called from generated code.
-num /*?*/ _asNumNullable(object) {
+num _asNum(object) {
+ if (_isNum(object)) return _Utils.asNum(object);
+ throw _TypeError.forType(object, 'num');
+}
+
+/// Specialization for 'as num*'.
+/// Called from generated code.
+num /*?*/ _asNumS(object) {
if (_isNum(object)) return _Utils.asNum(object);
if (object == null) return object;
throw _TypeError.forType(object, 'num');
}
+/// Specialization for 'as num?'.
+/// Called from generated code.
+num /*?*/ _asNumQ(object) {
+ if (_isNum(object)) return _Utils.asNum(object);
+ if (object == null) return object;
+ throw _TypeError.forType(object, 'num?');
+}
+
/// Specialization for 'is String'.
/// Called from generated code.
bool _isString(object) {
return JS('bool', 'typeof # == "string"', object);
}
-/// Specialization for 'as String?'.
+/// Specialization for 'as String'.
/// Called from generated code.
-String /*?*/ _asStringNullable(object) {
+String _asString(object) {
+ if (_isString(object)) return _Utils.asString(object);
+ throw _TypeError.forType(object, 'String');
+}
+
+/// Specialization for 'as String*'.
+/// Called from generated code.
+String /*?*/ _asStringS(object) {
if (_isString(object)) return _Utils.asString(object);
if (object == null) return object;
throw _TypeError.forType(object, 'String');
}
+/// Specialization for 'as String?'.
+/// Called from generated code.
+String /*?*/ _asStringQ(object) {
+ if (_isString(object)) return _Utils.asString(object);
+ if (object == null) return object;
+ throw _TypeError.forType(object, 'String?');
+}
+
String _rtiArrayToString(Object array, List<String> genericContext) {
String s = '', sep = '';
for (int i = 0; i < _Utils.arrayLength(array); i++) {
diff --git a/sdk/lib/_internal/vm/bin/process_patch.dart b/sdk/lib/_internal/vm/bin/process_patch.dart
index 2c5ae51..89e7c14 100644
--- a/sdk/lib/_internal/vm/bin/process_patch.dart
+++ b/sdk/lib/_internal/vm/bin/process_patch.dart
@@ -357,6 +357,9 @@
}
String _windowsArgumentEscape(String argument) {
+ if (argument.isEmpty) {
+ return '""';
+ }
var result = argument;
if (argument.contains('\t') ||
argument.contains(' ') ||
diff --git a/sdk/lib/io/network_profiling.dart b/sdk/lib/io/network_profiling.dart
index 8edaeac..f23ed37 100644
--- a/sdk/lib/io/network_profiling.dart
+++ b/sdk/lib/io/network_profiling.dart
@@ -228,8 +228,8 @@
final map = <String, dynamic>{
'id': id,
};
- _setIfNotNull(map, 'startTime', startTime.toString());
- _setIfNotNull(map, 'endTime', endTime.toString());
+ _setIfNotNull(map, 'startTime', startTime);
+ _setIfNotNull(map, 'endTime', endTime);
_setIfNotNull(map, 'address', address);
_setIfNotNull(map, 'port', port);
_setIfNotNull(map, 'socketType', socketType);
diff --git a/sdk/lib/vmservice/vmservice.dart b/sdk/lib/vmservice/vmservice.dart
index 6943f13..81a2ac7 100644
--- a/sdk/lib/vmservice/vmservice.dart
+++ b/sdk/lib/vmservice/vmservice.dart
@@ -49,7 +49,8 @@
final Map<int, IsolateEmbedderData> isolateEmbedderData =
new Map<int, IsolateEmbedderData>();
-// These must be kept in sync with the declarations in vm/json_stream.h.
+// These must be kept in sync with the declarations in vm/json_stream.h and
+// pkg/dds/lib/src/stream_manager.dart.
const kParseError = -32700;
const kInvalidRequest = -32600;
const kMethodNotFound = -32601;
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
index 8f4647c..e0c6c15 100644
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
+++ b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
@@ -898,17 +898,18 @@
JS('', '#[2]', parts), JS('', '#[3]', parts));
}
- List instantiateTypeBounds(List typeArgs) {
+ List<Object> instantiateTypeBounds(List typeArgs) {
if (!hasTypeBounds) {
- // We ommit the a bound to represent Object*. Other bounds are explicitly
+ // We omit the a bound to represent Object*. Other bounds are explicitly
// represented, including Object, Object? and dynamic.
// TODO(nshahan) Revisit this representation when more libraries have
// migrated to null safety.
- return List.filled(formalCount, legacy(unwrapType(Object)));
+ return List<Object>.filled(formalCount, legacy(unwrapType(Object)));
}
// Bounds can be recursive or depend on other type parameters, so we need to
// apply type arguments and return the resulting bounds.
- return JS('List', '#.apply(null, #)', _instantiateTypeBounds, typeArgs);
+ return JS<List<Object>>(
+ '!', '#.apply(null, #)', _instantiateTypeBounds, typeArgs);
}
toString() {
@@ -934,10 +935,30 @@
/// See the issue for the algorithm description:
/// <https://github.com/dart-lang/sdk/issues/27526#issuecomment-260021397>
List instantiateDefaultBounds() {
+ /// Returns `true` if the default value for the type bound should be
+ /// `dynamic`.
+ ///
+ /// Dart 2 with null safety uses dynamic as the default value for types
+ /// without explicit bounds.
+ ///
+ /// This is similar to [_isTop] but removes the check for `void` (it can't
+ /// be written as a bound) and adds a check of `Object*` in weak mode.
+ bool defaultsToDynamic(type) {
+ // Technically this is wrong, only implicit bounds of `Object?` and
+ // `Object*` should default to dynamic but code that observes the
+ // difference is rare.
+ if (_equalType(type, dynamic)) return true;
+ if (_jsInstanceOf(type, NullableType) ||
+ (!_strictSubtypeChecks && _jsInstanceOf(type, LegacyType))) {
+ return _equalType(JS('!', '#.type', type), Object);
+ }
+ return false;
+ }
+
var typeFormals = this.typeFormals;
// All type formals
- var all = HashMap<Object, int>.identity();
+ var all = HashMap<TypeVariable, int>.identity();
// ground types, by index.
//
// For each index, this will be a ground type for the corresponding type
@@ -953,8 +974,11 @@
var typeFormal = typeFormals[i];
var bound = typeBounds[i];
all[typeFormal] = i;
- if (identical(bound, _dynamic)) {
- defaults[i] = bound;
+ if (defaultsToDynamic(bound)) {
+ // TODO(nshahan) Persist the actual default values into the runtime so
+ // they can be used here instead of using dynamic for all top types
+ // implicit or explicit.
+ defaults[i] = _dynamic;
} else {
defaults[i] = typeFormal;
partials[typeFormal] = bound;
@@ -962,11 +986,12 @@
}
bool hasFreeFormal(t) {
+ if (partials.containsKey(t)) return true;
+
// Ignore nullability wrappers.
if (_jsInstanceOf(t, LegacyType) || _jsInstanceOf(t, NullableType)) {
return hasFreeFormal(JS<Object>('!', '#.type', t));
}
- if (partials.containsKey(t)) return true;
// Generic classes and typedefs.
var typeArgs = getGenericArgs(t);
if (typeArgs != null) return typeArgs.any(hasFreeFormal);
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_array.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_array.dart
index c92b73d..4538120 100644
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_array.dart
+++ b/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_array.dart
@@ -294,7 +294,7 @@
throw ConcurrentModificationError(this);
}
}
- if (matchFound) return match!;
+ if (matchFound) return match as E;
if (orElse != null) return orElse();
throw IterableElementError.noElement();
}
@@ -488,15 +488,15 @@
return -1;
}
- int lastIndexOf(Object? element, [int? _startIndex]) {
+ int lastIndexOf(Object? element, [int? startIndex]) {
@notNull
- int startIndex = _startIndex ?? this.length - 1;
- if (startIndex >= this.length) {
- startIndex = this.length - 1;
- } else if (startIndex < 0) {
+ int start = startIndex ?? this.length - 1;
+ if (start >= this.length) {
+ start = this.length - 1;
+ } else if (start < 0) {
return -1;
}
- for (int i = startIndex; i >= 0; i--) {
+ for (int i = start; i >= 0; i--) {
if (this[i] == element) {
return i;
}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/js_array.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/js_array.dart
index e7e4332..d131658 100644
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/js_array.dart
+++ b/sdk_nnbd/lib/_internal/js_runtime/lib/js_array.dart
@@ -361,7 +361,7 @@
throw new ConcurrentModificationError(this);
}
}
- if (matchFound) return match!;
+ if (matchFound) return match as E;
if (orElse != null) return orElse();
throw IterableElementError.noElement();
}
@@ -428,8 +428,8 @@
List<E> otherList;
int otherStart;
// TODO(floitsch): Make this accept more.
- if (iterable is List<E>) {
- otherList = iterable;
+ if (iterable is List) {
+ otherList = JS<List<E>>('', '#', iterable);
otherStart = skipCount;
} else {
otherList = iterable.skip(skipCount).toList(growable: false);
@@ -527,7 +527,7 @@
}
static int _compareAny(a, b) {
- return Comparable.compare(a as Comparable, b as Comparable);
+ return Comparable.compare(a, b);
}
void shuffle([Random? random]) {
@@ -559,15 +559,15 @@
return -1;
}
- int lastIndexOf(Object? element, [int? _startIndex]) {
- int startIndex = _startIndex ?? this.length - 1;
- if (startIndex < 0) {
+ int lastIndexOf(Object? element, [int? startIndex]) {
+ int start = startIndex ?? this.length - 1;
+ if (start < 0) {
return -1;
}
- if (startIndex >= this.length) {
- startIndex = this.length - 1;
+ if (start >= this.length) {
+ start = this.length - 1;
}
- for (int i = startIndex; i >= 0; i--) {
+ for (int i = start; i >= 0; i--) {
if (this[i] == element) {
return i;
}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/native_helper.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/native_helper.dart
index 4cbeed7..f5f40b7 100644
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/native_helper.dart
+++ b/sdk_nnbd/lib/_internal/js_runtime/lib/native_helper.dart
@@ -159,8 +159,9 @@
// [initNativeDispatch].
var interceptorClass = lookupInterceptor(tag);
if (interceptorClass == null) {
- tag = alternateTagFunction!(obj, tag);
- if (tag != null) {
+ String? altTag = alternateTagFunction!(obj, tag);
+ if (altTag != null) {
+ tag = altTag;
// Fast path for instance and uncached tags again.
record = propertyGet(dispatchRecordsForInstanceTags, tag);
if (record != null) return patchInstance(obj, record);
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/rti.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/rti.dart
index cb06c90..eb34fca 100644
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/rti.dart
+++ b/sdk_nnbd/lib/_internal/js_runtime/lib/rti.dart
@@ -1086,22 +1086,52 @@
// TODO(fishythefish): Change `dynamic` to `Object?` below once promotion works.
-/// Specialization for 'as bool?'.
+/// Specialization for 'as bool'.
/// Called from generated code.
-bool? _asBoolNullable(dynamic object) {
+bool _asBool(Object? object) {
+ if (_isBool(object)) return _Utils.asBool(object);
+ throw _TypeError.forType(object, 'bool');
+}
+
+/// Specialization for 'as bool*'.
+/// Called from generated code.
+bool? _asBoolS(dynamic object) {
if (_isBool(object)) return _Utils.asBool(object);
if (object == null) return object;
throw _TypeError.forType(object, 'bool');
}
-/// Specialization for 'as double?'.
+/// Specialization for 'as bool?'.
/// Called from generated code.
-double? _asDoubleNullable(dynamic object) {
+bool? _asBoolQ(dynamic object) {
+ if (_isBool(object)) return _Utils.asBool(object);
+ if (object == null) return object;
+ throw _TypeError.forType(object, 'bool?');
+}
+
+/// Specialization for 'as double'.
+/// Called from generated code.
+double _asDouble(Object? object) {
+ if (_isNum(object)) return _Utils.asDouble(object);
+ throw _TypeError.forType(object, 'double');
+}
+
+/// Specialization for 'as double*'.
+/// Called from generated code.
+double? _asDoubleS(dynamic object) {
if (_isNum(object)) return _Utils.asDouble(object);
if (object == null) return object;
throw _TypeError.forType(object, 'double');
}
+/// Specialization for 'as double?'.
+/// Called from generated code.
+double? _asDoubleQ(dynamic object) {
+ if (_isNum(object)) return _Utils.asDouble(object);
+ if (object == null) return object;
+ throw _TypeError.forType(object, 'double?');
+}
+
/// Specialization for 'is int'.
/// Called from generated code.
bool _isInt(Object? object) {
@@ -1109,42 +1139,87 @@
JS('bool', 'Math.floor(#) === #', object, object);
}
-/// Specialization for 'as int?'.
+/// Specialization for 'as int'.
/// Called from generated code.
-int? _asIntNullable(dynamic object) {
+int _asInt(Object? object) {
+ if (_isInt(object)) return _Utils.asInt(object);
+ throw _TypeError.forType(object, 'int');
+}
+
+/// Specialization for 'as int*'.
+/// Called from generated code.
+int? _asIntS(dynamic object) {
if (_isInt(object)) return _Utils.asInt(object);
if (object == null) return object;
throw _TypeError.forType(object, 'int');
}
+/// Specialization for 'as int?'.
+/// Called from generated code.
+int? _asIntQ(dynamic object) {
+ if (_isInt(object)) return _Utils.asInt(object);
+ if (object == null) return object;
+ throw _TypeError.forType(object, 'int?');
+}
+
/// Specialization for 'is num' and 'is double'.
/// Called from generated code.
bool _isNum(Object? object) {
return JS('bool', 'typeof # == "number"', object);
}
-/// Specialization for 'as num?'.
+/// Specialization for 'as num'.
/// Called from generated code.
-num? _asNumNullable(dynamic object) {
+num _asNum(Object? object) {
+ if (_isNum(object)) return _Utils.asNum(object);
+ throw _TypeError.forType(object, 'num');
+}
+
+/// Specialization for 'as num*'.
+/// Called from generated code.
+num? _asNumS(dynamic object) {
if (_isNum(object)) return _Utils.asNum(object);
if (object == null) return object;
throw _TypeError.forType(object, 'num');
}
+/// Specialization for 'as num?'.
+/// Called from generated code.
+num? _asNumQ(dynamic object) {
+ if (_isNum(object)) return _Utils.asNum(object);
+ if (object == null) return object;
+ throw _TypeError.forType(object, 'num?');
+}
+
/// Specialization for 'is String'.
/// Called from generated code.
bool _isString(Object? object) {
return JS('bool', 'typeof # == "string"', object);
}
-/// Specialization for 'as String?'.
+/// Specialization for 'as String'.
/// Called from generated code.
-String? _asStringNullable(dynamic object) {
+String _asString(Object? object) {
+ if (_isString(object)) return _Utils.asString(object);
+ throw _TypeError.forType(object, 'String');
+}
+
+/// Specialization for 'as String*'.
+/// Called from generated code.
+String? _asStringS(dynamic object) {
if (_isString(object)) return _Utils.asString(object);
if (object == null) return object;
throw _TypeError.forType(object, 'String');
}
+/// Specialization for 'as String?'.
+/// Called from generated code.
+String? _asStringQ(dynamic object) {
+ if (_isString(object)) return _Utils.asString(object);
+ if (object == null) return object;
+ throw _TypeError.forType(object, 'String?');
+}
+
String _rtiArrayToString(Object? array, List<String>? genericContext) {
String s = '', sep = '';
for (int i = 0; i < _Utils.arrayLength(array); i++) {
diff --git a/sdk_nnbd/lib/_internal/vm/bin/process_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/process_patch.dart
index 467bdc6..16e866c 100644
--- a/sdk_nnbd/lib/_internal/vm/bin/process_patch.dart
+++ b/sdk_nnbd/lib/_internal/vm/bin/process_patch.dart
@@ -328,6 +328,9 @@
}
String _windowsArgumentEscape(String argument) {
+ if (argument.isEmpty) {
+ return '""';
+ }
var result = argument;
if (argument.contains('\t') ||
argument.contains(' ') ||
diff --git a/sdk_nnbd/lib/io/network_profiling.dart b/sdk_nnbd/lib/io/network_profiling.dart
index 87d6527..59c47f4 100644
--- a/sdk_nnbd/lib/io/network_profiling.dart
+++ b/sdk_nnbd/lib/io/network_profiling.dart
@@ -221,8 +221,8 @@
final map = <String, dynamic>{
'id': id,
};
- _setIfNotNull(map, 'startTime', startTime.toString());
- _setIfNotNull(map, 'endTime', endTime.toString());
+ _setIfNotNull(map, 'startTime', startTime);
+ _setIfNotNull(map, 'endTime', endTime);
_setIfNotNull(map, 'address', address);
_setIfNotNull(map, 'port', port);
_setIfNotNull(map, 'socketType', socketType);
diff --git a/sdk_nnbd/lib/vmservice/vmservice.dart b/sdk_nnbd/lib/vmservice/vmservice.dart
index f5a176e..807fd00 100644
--- a/sdk_nnbd/lib/vmservice/vmservice.dart
+++ b/sdk_nnbd/lib/vmservice/vmservice.dart
@@ -46,7 +46,8 @@
// the cleanup method will be invoked after being removed from the map.
final isolateEmbedderData = <int, IsolateEmbedderData>{};
-// These must be kept in sync with the declarations in vm/json_stream.h.
+// These must be kept in sync with the declarations in vm/json_stream.h and
+// pkg/dds/lib/src/stream_manager.dart.
const kParseError = -32700;
const kInvalidRequest = -32600;
const kMethodNotFound = -32601;
diff --git a/tests/compiler/dart2js/generic_methods/function_type_variable_test.dart b/tests/compiler/dart2js/generic_methods/function_type_variable_test.dart
index b82a36d1..9daeca3 100644
--- a/tests/compiler/dart2js/generic_methods/function_type_variable_test.dart
+++ b/tests/compiler/dart2js/generic_methods/function_type_variable_test.dart
@@ -69,32 +69,45 @@
"""));
var types = env.types;
+ var options = env.compiler.options;
+
+ String printType(DartType type) => type.toStructuredText(
+ printLegacyStars: options.printLegacyStars,
+ useNullSafety: options.useNullSafety,
+ useLegacySubtyping: options.useLegacySubtyping);
+
+ List<String> printTypes(List<DartType> types) =>
+ types.map(printType).toList();
testToString(FunctionType type, String expectedToString) {
- Expect.equals(expectedToString, type.toString());
+ Expect.equals(expectedToString, printType(type));
}
testBounds(FunctionType type, List<DartType> expectedBounds) {
Expect.equals(expectedBounds.length, type.typeVariables.length,
- "Unexpected type variable count in $type.");
+ "Unexpected type variable count in ${printType(type)}.");
for (int i = 0; i < expectedBounds.length; i++) {
Expect.equals(expectedBounds[i], type.typeVariables[i].bound,
- "Unexpected ${i}th bound in $type.");
+ "Unexpected ${i}th bound in ${printType(type)}.");
}
}
testInstantiate(FunctionType type, List<DartType> instantiation,
String expectedToString) {
DartType result = types.instantiate(type, instantiation);
- Expect.equals(expectedToString, result.toString(),
- "Unexpected instantiation of $type with $instantiation: $result");
+ String resultString = printType(result);
+ Expect.equals(
+ expectedToString,
+ resultString,
+ "Unexpected instantiation of ${printType(type)} with $instantiation: "
+ "$resultString");
}
void testSubst(List<DartType> arguments, List<DartType> parameters,
DartType type1, String expectedToString) {
DartType subst = types.subst(arguments, parameters, type1);
- Expect.equals(expectedToString, subst.toString(),
- "$type1.subst($arguments,$parameters)");
+ Expect.equals(expectedToString, printType(subst),
+ "${printType(type1)}.subst(${printTypes(arguments)},${printTypes(parameters)})");
}
testRelations(DartType a, DartType b,
@@ -102,19 +115,21 @@
if (areEqual) {
isSubtype = true;
}
+ String aString = printType(a);
+ String bString = printType(b);
Expect.equals(
areEqual,
a == b,
- "Expected `$a` and `$b` to be ${areEqual ? 'equal' : 'non-equal'}, "
- "but they are not.");
+ "Expected `$aString` and `$bString` to be "
+ "${areEqual ? 'equal' : 'non-equal'}, but they are not.");
Expect.equals(
isSubtype,
env.isSubtype(a, b),
- "Expected `$a` ${isSubtype ? '' : 'not '}to be a subtype of `$b`, "
- "but it is${isSubtype ? ' not' : ''}.");
+ "Expected `$aString` ${isSubtype ? '' : 'not '}to be a subtype of "
+ "`$bString`, but it is${isSubtype ? ' not' : ''}.");
if (isSubtype) {
Expect.isTrue(env.isPotentialSubtype(a, b),
- '$a <: $b but not a potential subtype.');
+ '$aString <: $bString but not a potential subtype.');
}
}
@@ -289,7 +304,7 @@
Expect.isTrue(
functionTypeVariables.isEmpty,
"Function type variables found on constructor $constructor: "
- "$functionTypeVariables");
+ "${printTypes(functionTypeVariables)}");
});
});
}
diff --git a/tests/compiler/dart2js/impact/data/as.dart b/tests/compiler/dart2js/impact/data/as.dart
index efe5dd4..0efa63a 100644
--- a/tests/compiler/dart2js/impact/data/as.dart
+++ b/tests/compiler/dart2js/impact/data/as.dart
@@ -11,14 +11,92 @@
promoted(null);
}
-/*member: explicitAs:dynamic=[String.length],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:String]*/
+/*member: explicitAs:
+ dynamic=[String.length],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:String]
+*/
explicitAs(String i) {
i.length;
// ignore: unnecessary_cast
return i as String;
}
-/*member: implicitAs:dynamic=[String.length],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:String]*/
+/*member: implicitAs:
+ dynamic=[String.length],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:String]
+*/
String implicitAs(String i) {
dynamic j = i;
i.length;
@@ -26,7 +104,47 @@
return j;
}
-/*member: promoted:dynamic=[String.length],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,is:String]*/
+/*member: promoted:
+ dynamic=[String.length],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ is:String]
+*/
String promoted(dynamic i) {
if (i is! String) return null;
i.length;
diff --git a/tests/compiler/dart2js/impact/data/async.dart b/tests/compiler/dart2js/impact/data/async.dart
index c4f1a10..af7463f 100644
--- a/tests/compiler/dart2js/impact/data/async.dart
+++ b/tests/compiler/dart2js/impact/data/async.dart
@@ -219,13 +219,116 @@
return () async* {};
}
-/*member: testAsyncForIn:dynamic=[_StreamIterator.cancel(0),_StreamIterator.current,_StreamIterator.moveNext(0)],static=[Rti._bind(1),Rti._eval(1),StreamIterator.(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_asyncAwait(2),_asyncRethrow(2),_asyncReturn(2),_asyncStartSync(2),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),_makeAsyncAwaitCompleter<dynamic>(0),_wrapJsFunctionForAsync(1),findType(1),instanceType(1)],type=[impl:Stream<dynamic>,inst:Closure,inst:JSBool,inst:JSNull,inst:Null]*/
+/*member: testAsyncForIn:
+ dynamic=[
+ _StreamIterator.cancel(0),
+ _StreamIterator.current,
+ _StreamIterator.moveNext(0)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ StreamIterator.(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _asyncAwait(2),
+ _asyncRethrow(2),
+ _asyncReturn(2),
+ _asyncStartSync(2),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ _makeAsyncAwaitCompleter<dynamic>(0),
+ _wrapJsFunctionForAsync(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ impl:Stream<dynamic>,
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ inst:Null]
+*/
testAsyncForIn(o) async {
// ignore: UNUSED_LOCAL_VARIABLE
await for (var e in o) {}
}
-/*member: testAsyncForInTyped:dynamic=[_StreamIterator.cancel(0),_StreamIterator.current,_StreamIterator.moveNext(0)],static=[Rti._bind(1),Rti._eval(1),StreamIterator.(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_asyncAwait(2),_asyncRethrow(2),_asyncReturn(2),_asyncStartSync(2),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),_makeAsyncAwaitCompleter<dynamic>(0),_wrapJsFunctionForAsync(1),findType(1),instanceType(1)],type=[impl:Stream<dynamic>,impl:int,inst:Closure,inst:JSBool,inst:JSNull,inst:Null]*/
+/*member: testAsyncForInTyped:
+ dynamic=[
+ _StreamIterator.cancel(0),
+ _StreamIterator.current,
+ _StreamIterator.moveNext(0)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ StreamIterator.(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _asyncAwait(2),
+ _asyncRethrow(2),
+ _asyncReturn(2),
+ _asyncStartSync(2),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ _makeAsyncAwaitCompleter<dynamic>(0),
+ _wrapJsFunctionForAsync(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ impl:Stream<dynamic>,
+ impl:int,
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ inst:Null]
+*/
testAsyncForInTyped(o) async {
// ignore: UNUSED_LOCAL_VARIABLE
await for (int e in o) {}
diff --git a/tests/compiler/dart2js/impact/data/classes.dart b/tests/compiler/dart2js/impact/data/classes.dart
index 4ba507b..443975a 100644
--- a/tests/compiler/dart2js/impact/data/classes.dart
+++ b/tests/compiler/dart2js/impact/data/classes.dart
@@ -139,7 +139,46 @@
testForwardingConstructor() => new ForwardingConstructorClass(null);
class ForwardingConstructorTypedSuperClass {
- /*member: ForwardingConstructorTypedSuperClass.:static=[Object.(0),Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:int]*/
+ /*member: ForwardingConstructorTypedSuperClass.:
+ static=[
+ Object.(0),
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:int]
+ */
ForwardingConstructorTypedSuperClass(int arg);
}
@@ -153,7 +192,58 @@
testForwardingConstructorTyped() => new ForwardingConstructorTypedClass(null);
class ForwardingConstructorGenericSuperClass<T> {
- /*member: ForwardingConstructorGenericSuperClass.:static=[Object.(0),Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),checkSubtypeOfRuntimeType(2),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,param:ForwardingConstructorGenericSuperClass.T]*/
+ /*member: ForwardingConstructorGenericSuperClass.:
+ static=[
+ Object.(0),
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ checkSubtypeOfRuntimeType(2),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:ForwardingConstructorGenericSuperClass.T]
+ */
ForwardingConstructorGenericSuperClass(T arg);
}
@@ -183,7 +273,59 @@
*/
testEnum() => Enum.A;
-/*member: staticGenericMethod:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),checkSubtypeOfRuntimeType(2),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,inst:List<staticGenericMethod.T>,param:Object,param:staticGenericMethod.T]*/
+/*member: staticGenericMethod:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ checkSubtypeOfRuntimeType(2),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ inst:List<staticGenericMethod.T>,
+ param:Object,
+ param:staticGenericMethod.T]
+*/
List<T> staticGenericMethod<T>(T arg) => [arg];
/*member: testStaticGenericMethod:
@@ -230,7 +372,60 @@
class GenericClass<X, Y> {
const GenericClass.generative();
- /*member: GenericClass.genericMethod:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),checkSubtypeOfRuntimeType(2),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,inst:Map<GenericClass.X,genericMethod.T>,param:Object,param:genericMethod.T]*/
+ /*member: GenericClass.genericMethod:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ checkSubtypeOfRuntimeType(2),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ inst:Map<GenericClass.X,genericMethod.T>,
+ param:Object,
+ param:genericMethod.T]
+ */
Map<X, T> genericMethod<T>(T arg) => {null: arg};
}
diff --git a/tests/compiler/dart2js/impact/data/constants/lib.dart b/tests/compiler/dart2js/impact/data/constants/lib.dart
index 3f0a149..47c5760 100644
--- a/tests/compiler/dart2js/impact/data/constants/lib.dart
+++ b/tests/compiler/dart2js/impact/data/constants/lib.dart
@@ -44,7 +44,58 @@
const typeLiteralField = String;
-/*member: id:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),checkSubtypeOfRuntimeType(2),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,param:Object,param:id.T]*/
+/*member: id:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ checkSubtypeOfRuntimeType(2),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:Object,
+ param:id.T]
+*/
T id<T>(T t) => t;
const int Function(int) _instantiation = id;
diff --git a/tests/compiler/dart2js/impact/data/constructors.dart b/tests/compiler/dart2js/impact/data/constructors.dart
index 3ffff0b..fc06869 100644
--- a/tests/compiler/dart2js/impact/data/constructors.dart
+++ b/tests/compiler/dart2js/impact/data/constructors.dart
@@ -154,7 +154,46 @@
/*member: GenericClass.generative:static=[Object.(0)]*/
const GenericClass.generative();
- /*member: GenericClass.fact:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Object]*/
+ /*member: GenericClass.fact:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Object]
+ */
factory GenericClass.fact() => null;
const factory GenericClass.redirect() = GenericClass<X, Y>.generative;
diff --git a/tests/compiler/dart2js/impact/data/effectively_final.dart b/tests/compiler/dart2js/impact/data/effectively_final.dart
index d2677d7..71b9cc5 100644
--- a/tests/compiler/dart2js/impact/data/effectively_final.dart
+++ b/tests/compiler/dart2js/impact/data/effectively_final.dart
@@ -69,7 +69,55 @@
/*member: _method1:type=[inst:JSNull]*/
num _method1() => null;
-/*member: effectivelyFinalPromoted:dynamic=[int.+,num.+],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),_method1(0),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSDouble,inst:JSInt,inst:JSNumber,inst:JSPositiveInt,inst:JSUInt31,inst:JSUInt32,is:int]*/
+/*member: effectivelyFinalPromoted:
+ dynamic=[
+ int.+,
+ num.+],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ _method1(0),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSDouble,
+ inst:JSInt,
+ inst:JSNumber,
+ inst:JSPositiveInt,
+ inst:JSUInt31,
+ inst:JSUInt32,
+ is:int]
+*/
effectivelyFinalPromoted() {
dynamic c = _method1();
c + 0;
@@ -81,7 +129,56 @@
/*member: _method2:type=[inst:JSNull]*/
String _method2() => null;
-/*member: effectivelyFinalPromotedInvalid:dynamic=[String.+,int.+],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),_method2(0),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSDouble,inst:JSInt,inst:JSNumber,inst:JSPositiveInt,inst:JSString,inst:JSUInt31,inst:JSUInt32,is:int]*/
+/*member: effectivelyFinalPromotedInvalid:
+ dynamic=[
+ String.+,
+ int.+],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ _method2(0),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSDouble,
+ inst:JSInt,
+ inst:JSNumber,
+ inst:JSPositiveInt,
+ inst:JSString,
+ inst:JSUInt31,
+ inst:JSUInt32,
+ is:int]
+*/
effectivelyFinalPromotedInvalid() {
dynamic c = _method2();
c + '';
diff --git a/tests/compiler/dart2js/impact/data/expressions.dart b/tests/compiler/dart2js/impact/data/expressions.dart
index 3f2ef46..513f538 100644
--- a/tests/compiler/dart2js/impact/data/expressions.dart
+++ b/tests/compiler/dart2js/impact/data/expressions.dart
@@ -107,58 +107,809 @@
*/
testPreDec(o) => --o;
-/*member: testIs:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,is:Class]*/
+/*member: testIs:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ is:Class]
+*/
testIs() => null is Class;
-/*member: testIsGeneric:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,is:GenericClass<int,String>]*/
+/*member: testIsGeneric:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ is:GenericClass<int,String>]
+*/
testIsGeneric() => null is GenericClass<int, String>;
-/*member: testIsGenericRaw:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,is:GenericClass<dynamic,dynamic>]*/
+/*member: testIsGenericRaw:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ is:GenericClass<dynamic,dynamic>]
+*/
testIsGenericRaw() => null is GenericClass;
-/*member: testIsGenericDynamic:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,is:GenericClass<dynamic,dynamic>]*/
+/*member: testIsGenericDynamic:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ is:GenericClass<dynamic,dynamic>]
+*/
testIsGenericDynamic() => null is GenericClass<dynamic, dynamic>;
-/*member: testIsNot:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,is:Class]*/
+/*member: testIsNot:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ is:Class]
+*/
testIsNot() => null is! Class;
-/*member: testIsNotGeneric:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,is:GenericClass<int,String>]*/
+/*member: testIsNotGeneric:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ is:GenericClass<int,String>]
+*/
testIsNotGeneric() => null is! GenericClass<int, String>;
-/*member: testIsNotGenericRaw:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,is:GenericClass<dynamic,dynamic>]*/
+/*member: testIsNotGenericRaw:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ is:GenericClass<dynamic,dynamic>]
+*/
testIsNotGenericRaw() => null is! GenericClass;
-/*member: testIsNotGenericDynamic:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,is:GenericClass<dynamic,dynamic>]*/
+/*member: testIsNotGenericDynamic:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ is:GenericClass<dynamic,dynamic>]
+*/
testIsNotGenericDynamic() => null is! GenericClass<dynamic, dynamic>;
-/*member: testIsTypedef:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,is:dynamic Function()]*/
+/*member: testIsTypedef:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ is:dynamic Function()]
+*/
testIsTypedef() => null is Typedef;
-/*member: testIsTypedefGeneric:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,is:int Function(String)]*/
+/*member: testIsTypedefGeneric:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ is:int Function(String)]
+*/
testIsTypedefGeneric() => null is GenericTypedef<int, String>;
-/*member: testIsTypedefGenericRaw:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,is:dynamic Function(dynamic)]*/
+/*member: testIsTypedefGenericRaw:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ is:dynamic Function(dynamic)]
+*/
testIsTypedefGenericRaw() => null is GenericTypedef;
-/*member: testIsTypedefGenericDynamic:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,is:dynamic Function(dynamic)]*/
+/*member: testIsTypedefGenericDynamic:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ is:dynamic Function(dynamic)]
+*/
testIsTypedefGenericDynamic() => null is GenericTypedef<dynamic, dynamic>;
-/*member: testIsTypedefDeep:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,is:List<int Function(dynamic Function(dynamic))>]*/
+/*member: testIsTypedefDeep:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ is:List<int Function(dynamic Function(dynamic))>]
+*/
testIsTypedefDeep() => null is List<GenericTypedef<int, GenericTypedef>>;
-/*member: testAs:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1),throwRuntimeError(1)],type=[as:Class,inst:Closure,inst:JSBool]*/
+/*member: testAs:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1),
+ throwRuntimeError(1)],
+ type=[
+ as:Class,
+ inst:Closure,
+ inst:JSBool]
+*/
// ignore: UNNECESSARY_CAST
testAs(dynamic o) => o as Class;
-/*member: testAsGeneric:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2),throwRuntimeError(1)],type=[as:GenericClass<int,String>,inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>]*/
+/*member: testAsGeneric:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2),
+ throwRuntimeError(1)],
+ type=[
+ as:GenericClass<int,String>,
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>]
+*/
// ignore: UNNECESSARY_CAST
testAsGeneric(dynamic o) => o as GenericClass<int, String>;
-/*member: testAsGenericRaw:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1),throwRuntimeError(1)],type=[as:GenericClass<dynamic,dynamic>,inst:Closure,inst:JSBool]*/
+/*member: testAsGenericRaw:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1),
+ throwRuntimeError(1)],
+ type=[
+ as:GenericClass<dynamic,dynamic>,
+ inst:Closure,
+ inst:JSBool]
+*/
// ignore: UNNECESSARY_CAST
testAsGenericRaw(dynamic o) => o as GenericClass;
-/*member: testAsGenericDynamic:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1),throwRuntimeError(1)],type=[as:GenericClass<dynamic,dynamic>,inst:Closure,inst:JSBool]*/
+/*member: testAsGenericDynamic:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1),
+ throwRuntimeError(1)],
+ type=[
+ as:GenericClass<dynamic,dynamic>,
+ inst:Closure,
+ inst:JSBool]
+*/
// ignore: UNNECESSARY_CAST
testAsGenericDynamic(dynamic o) => o as GenericClass<dynamic, dynamic>;
@@ -170,7 +921,49 @@
/*member: testIfNotNull:dynamic=[Object.==,foo],type=[inst:JSNull]*/
testIfNotNull(o) => o?.foo;
-/*member: testTypedIfNotNull:dynamic=[Class.==,Class.field],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class]*/
+/*member: testTypedIfNotNull:
+ dynamic=[
+ Class.==,
+ Class.field],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class]
+*/
testTypedIfNotNull(Class o) => o?.field;
/*member: testIfNotNullSet:dynamic=[Object.==,foo=],type=[inst:JSBool,inst:JSNull]*/
diff --git a/tests/compiler/dart2js/impact/data/extract_type_arguments.dart b/tests/compiler/dart2js/impact/data/extract_type_arguments.dart
index dcdb613..78bcadf 100644
--- a/tests/compiler/dart2js/impact/data/extract_type_arguments.dart
+++ b/tests/compiler/dart2js/impact/data/extract_type_arguments.dart
@@ -14,10 +14,116 @@
/*member: C.:static=[Object.(0)]*/
class C implements A<int>, B<String, bool> {}
-/*member: testA:dynamic=[call<A.T>(0)],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),extractTypeArguments<A<dynamic>>(2),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[impl:A<dynamic>,impl:Function,inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,is:A<A.T>]*/
+/*member: testA:
+ dynamic=[call<A.T>(0)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ extractTypeArguments<A<dynamic>>(2),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ impl:A<dynamic>,
+ impl:Function,
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ is:A<A.T>]
+*/
testA(c, f) => extractTypeArguments<A>(c, f);
-/*member: testB:dynamic=[call<B.S,B.U>(0)],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),extractTypeArguments<B<dynamic,dynamic>>(2),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[impl:B<dynamic,dynamic>,impl:Function,inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,is:B<B.S,B.U>]*/
+/*member: testB:
+ dynamic=[call<B.S,B.U>(0)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ extractTypeArguments<B<dynamic,dynamic>>(2),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ impl:B<dynamic,dynamic>,
+ impl:Function,
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ is:B<B.S,B.U>]
+*/
testB(c, f) => extractTypeArguments<B>(c, f);
/*member: main:static=[C.(0),testA(2),testB(2)],type=[inst:JSNull]*/
diff --git a/tests/compiler/dart2js/impact/data/initializers.dart b/tests/compiler/dart2js/impact/data/initializers.dart
index 755036c..3a7c734 100644
--- a/tests/compiler/dart2js/impact/data/initializers.dart
+++ b/tests/compiler/dart2js/impact/data/initializers.dart
@@ -30,10 +30,86 @@
testGenericClass();
}
-/*member: testDefaultValuesPositional:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:bool]*/
+/*member: testDefaultValuesPositional:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:bool]
+*/
testDefaultValuesPositional([bool value = false]) {}
-/*member: testDefaultValuesNamed:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:bool]*/
+/*member: testDefaultValuesNamed:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:bool]
+*/
testDefaultValuesNamed({bool value: false}) {}
class ClassFieldInitializer1 {
@@ -86,7 +162,45 @@
/*member: ClassInstanceFieldWithInitializer.:static=[Object.(0)]*/
class ClassInstanceFieldWithInitializer {
- /*member: ClassInstanceFieldWithInitializer.field:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:bool]*/
+ /*member: ClassInstanceFieldWithInitializer.field:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:bool]
+ */
var field = false;
}
@@ -95,7 +209,46 @@
/*member: ClassInstanceFieldTyped.:static=[Object.(0)]*/
class ClassInstanceFieldTyped {
- /*member: ClassInstanceFieldTyped.field:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:int]*/
+ /*member: ClassInstanceFieldTyped.field:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:int]
+ */
int field;
}
@@ -122,7 +275,58 @@
testSuperInitializer() => new ClassSuperInitializer();
class ClassGeneric<T> {
- /*member: ClassGeneric.:static=[Object.(0),Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),checkSubtypeOfRuntimeType(2),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,param:ClassGeneric.T]*/
+ /*member: ClassGeneric.:
+ static=[
+ Object.(0),
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ checkSubtypeOfRuntimeType(2),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:ClassGeneric.T]
+ */
ClassGeneric(T arg);
}
diff --git a/tests/compiler/dart2js/impact/data/injected_cast.dart b/tests/compiler/dart2js/impact/data/injected_cast.dart
index 08fb66f..3ebf374 100644
--- a/tests/compiler/dart2js/impact/data/injected_cast.dart
+++ b/tests/compiler/dart2js/impact/data/injected_cast.dart
@@ -16,11 +16,90 @@
/*member: Class1.:static=[Object.(0)]*/
class Class1 {
- /*member: Class1.field1:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:A]*/
+ /*member: Class1.field1:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:A]
+ */
A field1;
}
-/*member: method1:dynamic=[Class1.field1=],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[impl:A,inst:Closure,inst:JSBool,is:Class1]*/
+/*member: method1:
+ dynamic=[Class1.field1=],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ impl:A,
+ inst:Closure,
+ inst:JSBool,
+ is:Class1]
+*/
method1(dynamic o, dynamic value) {
if (o is! Class1) return;
o.field1 = value;
@@ -50,11 +129,94 @@
/*member: Class3.:static=[Object.(0)]*/
class Class3 {
- /*member: Class3.method3:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:A,param:B,param:C]*/
+ /*member: Class3.method3:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:A,
+ param:B,
+ param:C]
+ */
method3(A a, [B b, C c]) {}
}
-/*member: method3:dynamic=[Class3.method3(3)],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[impl:A,impl:C,inst:Closure,inst:JSBool,is:Class3,param:B]*/
+/*member: method3:
+ dynamic=[Class3.method3(3)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ impl:A,
+ impl:C,
+ inst:Closure,
+ inst:JSBool,
+ is:Class3,
+ param:B]
+*/
method3(dynamic o, dynamic a, B b, dynamic c) {
if (o is! Class3) return;
o.method3(a, b, c);
@@ -62,11 +224,94 @@
/*member: Class4.:static=[Object.(0)]*/
class Class4 {
- /*member: Class4.method4:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:A,param:B,param:C]*/
+ /*member: Class4.method4:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:A,
+ param:B,
+ param:C]
+ */
method4(A a, {B b, C c}) {}
}
-/*member: method4:dynamic=[Class4.method4(1,b,c)],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[impl:A,impl:C,inst:Closure,inst:JSBool,is:Class4,param:B]*/
+/*member: method4:
+ dynamic=[Class4.method4(1,b,c)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ impl:A,
+ impl:C,
+ inst:Closure,
+ inst:JSBool,
+ is:Class4,
+ param:B]
+*/
method4(dynamic o, dynamic a, B b, dynamic c) {
if (o is! Class4) return;
o.method4(a, c: c, b: b);
@@ -144,7 +389,49 @@
A Function(A) get f => null;
}
-/*member: method7:dynamic=[Class7.f(1),call(1)],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[impl:A,inst:Closure,inst:JSBool,is:Class7]*/
+/*member: method7:
+ dynamic=[
+ Class7.f(1),
+ call(1)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ impl:A,
+ inst:Closure,
+ inst:JSBool,
+ is:Class7]
+*/
method7(dynamic o, dynamic a) {
if (o is! Class7) return;
o.f(a);
@@ -172,7 +459,49 @@
return g.method(iterable);
}
-/*member: method9:dynamic=[G.field=],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[impl:int,inst:Closure,inst:JSBool,inst:JSNull,is:G,param:num]*/
+/*member: method9:
+ dynamic=[G.field=],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ impl:int,
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ is:G,
+ param:num]
+*/
method9(dynamic g, num value) {
if (g is! G) return null;
return g.field = value;
diff --git a/tests/compiler/dart2js/impact/data/invokes.dart b/tests/compiler/dart2js/impact/data/invokes.dart
index 41ca532..045a41c 100644
--- a/tests/compiler/dart2js/impact/data/invokes.dart
+++ b/tests/compiler/dart2js/impact/data/invokes.dart
@@ -117,13 +117,144 @@
topLevelFunction3(15, c: 16, b: 17);
}
-/*member: topLevelFunction1Typed:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:int]*/
+/*member: topLevelFunction1Typed:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:int]
+*/
void topLevelFunction1Typed(int a) {}
-/*member: topLevelFunction2Typed:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:String,param:double,param:num]*/
+/*member: topLevelFunction2Typed:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:String,
+ param:double,
+ param:num]
+*/
int topLevelFunction2Typed(String a, [num b, double c]) => null;
-/*member: topLevelFunction3Typed:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,param:List<int>,param:Map<String,bool>,param:bool]*/
+/*member: topLevelFunction3Typed:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:List<int>,
+ param:Map<String,bool>,
+ param:bool]
+*/
double topLevelFunction3Typed(bool a, {List<int> b, Map<String, bool> c}) {
return null;
}
@@ -164,16 +295,212 @@
topLevelFunction3Typed(false, c: {'16': false}, b: [17]);
}
-/*member: topLevelFunctionTyped1:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,param:void Function(num)]*/
+/*member: topLevelFunctionTyped1:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:void Function(num)]
+*/
topLevelFunctionTyped1(void a(num b)) {}
-/*member: topLevelFunctionTyped2:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,param:void Function(num,[String])]*/
+/*member: topLevelFunctionTyped2:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:void Function(num,[String])]
+*/
topLevelFunctionTyped2(void a(num b, [String c])) {}
-/*member: topLevelFunctionTyped3:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,param:void Function(num,{String c,int d})]*/
+/*member: topLevelFunctionTyped3:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:void Function(num,{String c,int d})]
+*/
topLevelFunctionTyped3(void a(num b, {String c, int d})) {}
-/*member: topLevelFunctionTyped4:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,param:void Function(num,{int c,String d})]*/
+/*member: topLevelFunctionTyped4:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:void Function(num,{int c,String d})]
+*/
topLevelFunctionTyped4(void a(num b, {String d, int c})) {}
/*member: testTopLevelFunctionTyped:
@@ -212,7 +539,45 @@
/*member: testTopLevelSetterSet:static=[set:topLevelSetter],type=[inst:JSNull]*/
testTopLevelSetterSet() => topLevelSetter = null;
-/*member: topLevelSetterTyped=:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:int]*/
+/*member: topLevelSetterTyped=:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:int]
+*/
void set topLevelSetterTyped(int value) {}
/*member: testTopLevelSetterSetTyped:static=[set:topLevelSetterTyped],type=[inst:JSNull]*/
@@ -241,25 +606,192 @@
/*member: testTopLevelFieldFinal:static=[topLevelFieldFinal]*/
testTopLevelFieldFinal() => topLevelFieldFinal;
-/*member: topLevelFieldTyped:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:int]*/
+/*member: topLevelFieldTyped:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:int]
+*/
int topLevelFieldTyped;
/*member: testTopLevelFieldTyped:static=[topLevelFieldTyped]*/
testTopLevelFieldTyped() => topLevelFieldTyped;
-/*member: topLevelFieldGeneric1:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:GenericClass<dynamic,dynamic>]*/
+/*member: topLevelFieldGeneric1:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:GenericClass<dynamic,dynamic>]
+*/
GenericClass topLevelFieldGeneric1;
/*member: testTopLevelFieldGeneric1:static=[topLevelFieldGeneric1]*/
testTopLevelFieldGeneric1() => topLevelFieldGeneric1;
-/*member: topLevelFieldGeneric2:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:GenericClass<dynamic,dynamic>]*/
+/*member: topLevelFieldGeneric2:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:GenericClass<dynamic,dynamic>]
+*/
GenericClass<dynamic, dynamic> topLevelFieldGeneric2;
/*member: testTopLevelFieldGeneric2:static=[topLevelFieldGeneric2]*/
testTopLevelFieldGeneric2() => topLevelFieldGeneric2;
-/*member: topLevelFieldGeneric3:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,param:GenericClass<int,String>]*/
+/*member: topLevelFieldGeneric3:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:GenericClass<int,String>]
+*/
GenericClass<int, String> topLevelFieldGeneric3;
/*member: testTopLevelFieldGeneric3:static=[topLevelFieldGeneric3]*/
@@ -384,7 +916,57 @@
localFunction() {}
}
-/*member: testLocalFunctionTyped:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),computeSignature(3),def:localFunction,findType(1),getRuntimeTypeArguments(3),getRuntimeTypeInfo(1),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:Function,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,param:String]*/
+/*member: testLocalFunctionTyped:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ computeSignature(3),
+ def:localFunction,
+ findType(1),
+ getRuntimeTypeArguments(3),
+ getRuntimeTypeInfo(1),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:Function,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:String]
+*/
testLocalFunctionTyped() {
// ignore: UNUSED_ELEMENT
int localFunction(String a) => null;
diff --git a/tests/compiler/dart2js/impact/data/jsinterop.dart b/tests/compiler/dart2js/impact/data/jsinterop.dart
index 98f8cee..b997a3e 100644
--- a/tests/compiler/dart2js/impact/data/jsinterop.dart
+++ b/tests/compiler/dart2js/impact/data/jsinterop.dart
@@ -61,7 +61,57 @@
/*member: GenericClass.:static=[JavaScriptObject.(0)]*/
@JS()
class GenericClass<T> {
- /*member: GenericClass.method:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,param:void Function(GenericClass.T)]*/
+ /*member: GenericClass.method:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:void Function(GenericClass.T)]
+ */
external GenericClass method([Callback<T> callback]);
}
diff --git a/tests/compiler/dart2js/impact/data/jsinterop_setter1.dart b/tests/compiler/dart2js/impact/data/jsinterop_setter1.dart
index 18db4e3..3f78563 100644
--- a/tests/compiler/dart2js/impact/data/jsinterop_setter1.dart
+++ b/tests/compiler/dart2js/impact/data/jsinterop_setter1.dart
@@ -11,11 +11,106 @@
import 'package:js/js.dart';
-/*member: foo=:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,native:ApplicationCacheErrorEvent,native:DomError,native:DomException,native:ErrorEvent,native:MediaError,native:NavigatorUserMediaError,native:OverconstrainedError,native:PositionError,native:SensorErrorEvent,native:SpeechRecognitionError,native:SqlError,param:Function]*/
+/*member: foo=:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ native:ApplicationCacheErrorEvent,
+ native:DomError,
+ native:DomException,
+ native:ErrorEvent,
+ native:MediaError,
+ native:NavigatorUserMediaError,
+ native:OverconstrainedError,
+ native:PositionError,
+ native:SensorErrorEvent,
+ native:SpeechRecognitionError,
+ native:SqlError,
+ param:Function]
+*/
@JS()
external set foo(Function f);
-/*member: _doStuff:dynamic=[File.==,File.name],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),defineProperty(3),findType(1),instanceType(1),print(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,inst:JSString,param:File,param:String]*/
+/*member: _doStuff:
+ dynamic=[
+ File.==,
+ File.name],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ defineProperty(3),
+ findType(1),
+ instanceType(1),
+ print(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ inst:JSString,
+ param:File,
+ param:String]
+*/
void _doStuff(String name, File file) {
if (file == null) {
print('OK');
diff --git a/tests/compiler/dart2js/impact/data/jsinterop_setter2.dart b/tests/compiler/dart2js/impact/data/jsinterop_setter2.dart
index ebd83d7..8ece87e 100644
--- a/tests/compiler/dart2js/impact/data/jsinterop_setter2.dart
+++ b/tests/compiler/dart2js/impact/data/jsinterop_setter2.dart
@@ -11,11 +11,118 @@
import 'package:js/js.dart';
-/*member: foo=:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,native:ApplicationCacheErrorEvent,native:DomError,native:DomException,native:ErrorEvent,native:File,native:MediaError,native:NavigatorUserMediaError,native:OverconstrainedError,native:PositionError,native:SensorErrorEvent,native:SpeechRecognitionError,native:SqlError,param:void Function(String,File)]*/
+/*member: foo=:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ native:ApplicationCacheErrorEvent,
+ native:DomError,
+ native:DomException,
+ native:ErrorEvent,
+ native:File,
+ native:MediaError,
+ native:NavigatorUserMediaError,
+ native:OverconstrainedError,
+ native:PositionError,
+ native:SensorErrorEvent,
+ native:SpeechRecognitionError,
+ native:SqlError,
+ param:void Function(String,File)]
+*/
@JS()
external set foo(void Function(String, File) f);
-/*member: _doStuff:dynamic=[File.==,File.name],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),defineProperty(3),findType(1),instanceType(1),print(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,inst:JSString,param:File,param:String]*/
+/*member: _doStuff:
+ dynamic=[
+ File.==,
+ File.name],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ defineProperty(3),
+ findType(1),
+ instanceType(1),
+ print(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ inst:JSString,
+ param:File,
+ param:String]
+*/
void _doStuff(String name, File file) {
if (file == null) {
print('OK');
diff --git a/tests/compiler/dart2js/impact/data/native.dart b/tests/compiler/dart2js/impact/data/native.dart
index f700202..3909b77 100644
--- a/tests/compiler/dart2js/impact/data/native.dart
+++ b/tests/compiler/dart2js/impact/data/native.dart
@@ -58,7 +58,52 @@
@Native("NativeClass")
class NativeClass {
- /*member: NativeClass.field:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,native:JSExtendableArray<JSExtendableArray.E>,native:Object,native:String,native:bool,native:double,native:int,param:Object]*/
+ /*member: NativeClass.field:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ native:JSExtendableArray<JSExtendableArray.E>,
+ native:Object,
+ native:String,
+ native:bool,
+ native:double,
+ native:int,
+ param:Object]
+ */
@annotation_Creates_SerializedScriptValue
final Object field;
@@ -67,5 +112,45 @@
}
}
-/*member: testNativeField:dynamic=[NativeClass.field],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),defineProperty(3),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:NativeClass]*/
+/*member: testNativeField:
+ dynamic=[NativeClass.field],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ defineProperty(3),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:NativeClass]
+*/
testNativeField(NativeClass c) => c.field;
diff --git a/tests/compiler/dart2js/impact/data/promotion.dart b/tests/compiler/dart2js/impact/data/promotion.dart
index 04fec9f..9341be1 100644
--- a/tests/compiler/dart2js/impact/data/promotion.dart
+++ b/tests/compiler/dart2js/impact/data/promotion.dart
@@ -39,17 +39,135 @@
dynamicToNoSuchMethodTearOff(null);
}
-/*member: positiveTyped:dynamic=[SubClass.method(0)],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,is:SubClass,param:Class]*/
+/*member: positiveTyped:
+ dynamic=[SubClass.method(0)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ is:SubClass,
+ param:Class]
+*/
positiveTyped(Class cls) {
if (cls is SubClass) cls.method();
}
-/*member: positiveDynamic:dynamic=[SubClass.method(0)],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,is:SubClass]*/
+/*member: positiveDynamic:
+ dynamic=[SubClass.method(0)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ is:SubClass]
+*/
positiveDynamic(dynamic cls) {
if (cls is SubClass) cls.method();
}
-/*member: negativeDynamic:dynamic=[SubClass.method(0)],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,is:SubClass]*/
+/*member: negativeDynamic:
+ dynamic=[SubClass.method(0)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ is:SubClass]
+*/
negativeDynamic(dynamic cls) {
if (cls is! SubClass) return;
cls.method();
diff --git a/tests/compiler/dart2js/impact/data/runtime_type.dart b/tests/compiler/dart2js/impact/data/runtime_type.dart
index 9efa562..bb1703f 100644
--- a/tests/compiler/dart2js/impact/data/runtime_type.dart
+++ b/tests/compiler/dart2js/impact/data/runtime_type.dart
@@ -62,88 +62,1415 @@
/*member: Class4.:static=[Object.(0)]*/
class Class4 {}
-/*member: toString1:dynamic=[Class2.runtimeType,toString(0)],runtimeType=[string:Class2<int>],static=[Rti._bind(1),Rti._eval(1),S(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSString,inst:JSUnmodifiableArray<dynamic>,param:Class2<int>]*/
+/*member: toString1:
+ dynamic=[
+ Class2.runtimeType,
+ toString(0)],
+ runtimeType=[string:Class2<int>],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ S(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSString,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:Class2<int>]
+*/
toString1(Class2<int> c) => '${c.runtimeType}';
-/*member: toString2:dynamic=[Class2.==,Class2.runtimeType,toString(0)],runtimeType=[string:Class2<int>],static=[Rti._bind(1),Rti._eval(1),S(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSString,inst:JSUnmodifiableArray<dynamic>,param:Class2<int>]*/
+/*member: toString2:
+ dynamic=[
+ Class2.==,
+ Class2.runtimeType,
+ toString(0)],
+ runtimeType=[string:Class2<int>],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ S(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSString,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:Class2<int>]
+*/
toString2(Class2<int> c) => '${c?.runtimeType}';
-/*member: toString3:dynamic=[Class2.runtimeType,Type.toString(0)],runtimeType=[string:Class2<int>],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,param:Class2<int>]*/
+/*member: toString3:
+ dynamic=[
+ Class2.runtimeType,
+ Type.toString(0)],
+ runtimeType=[string:Class2<int>],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:Class2<int>]
+*/
toString3(Class2<int> c) => c.runtimeType.toString();
-/*member: toString4:dynamic=[Class2.runtimeType,Type.==,Type.toString(0)],runtimeType=[string:Class2<int>],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,param:Class2<int>]*/
+/*member: toString4:
+ dynamic=[
+ Class2.runtimeType,
+ Type.==,
+ Type.toString(0)],
+ runtimeType=[string:Class2<int>],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:Class2<int>]
+*/
toString4(Class2<int> c) => c.runtimeType?.toString();
-/*member: toString5:dynamic=[Class2.==,Class2.runtimeType,Type.==,Type.toString(0)],runtimeType=[string:Class2<int>],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,param:Class2<int>]*/
+/*member: toString5:
+ dynamic=[
+ Class2.==,
+ Class2.runtimeType,
+ Type.==,
+ Type.toString(0)],
+ runtimeType=[string:Class2<int>],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:Class2<int>]
+*/
toString5(Class2<int> c) => c?.runtimeType?.toString();
-/*member: toString6:dynamic=[Class2.==,Class2.runtimeType,Type.toString(0)],runtimeType=[string:Class2<int>],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,param:Class2<int>]*/
+/*member: toString6:
+ dynamic=[
+ Class2.==,
+ Class2.runtimeType,
+ Type.toString(0)],
+ runtimeType=[string:Class2<int>],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:Class2<int>]
+*/
toString6(Class2<int> c) => c?.runtimeType.toString();
-/*member: unknown:dynamic=[Class2.runtimeType],runtimeType=[unknown:Class2<int>],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSUnmodifiableArray<dynamic>,param:Class2<int>]*/
+/*member: unknown:
+ dynamic=[Class2.runtimeType],
+ runtimeType=[unknown:Class2<int>],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:Class2<int>]
+*/
unknown(Class2<int> c) => c.runtimeType;
-/*member: equals1:dynamic=[Class1a.==,Class1a.runtimeType,Class1d.==,Class1d.runtimeType,Type.==],runtimeType=[equals:Class1a<int>/Class1d<int>],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkSubtype(4),findType(1),getRuntimeTypeArgument(3),getRuntimeTypeArgumentIntercepted(4),getRuntimeTypeInfo(1),getTypeArgumentByIndex(2),instanceType(1),setRuntimeTypeInfo(2)],type=[inst:Closure,inst:JSArray<dynamic>,inst:JSBool,inst:JSExtendableArray<dynamic>,inst:JSFixedArray<dynamic>,inst:JSMutableArray<dynamic>,inst:JSNull,inst:JSUnmodifiableArray<dynamic>,param:Class1a<int>,param:Class1d<int>]*/
+/*member: equals1:
+ dynamic=[
+ Class1a.==,
+ Class1a.runtimeType,
+ Class1d.==,
+ Class1d.runtimeType,
+ Type.==],
+ runtimeType=[equals:Class1a<int>/Class1d<int>],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkSubtype(4),
+ findType(1),
+ getRuntimeTypeArgument(3),
+ getRuntimeTypeArgumentIntercepted(4),
+ getRuntimeTypeInfo(1),
+ getTypeArgumentByIndex(2),
+ instanceType(1),
+ setRuntimeTypeInfo(2)],
+ type=[
+ inst:Closure,
+ inst:JSArray<dynamic>,
+ inst:JSBool,
+ inst:JSExtendableArray<dynamic>,
+ inst:JSFixedArray<dynamic>,
+ inst:JSMutableArray<dynamic>,
+ inst:JSNull,
+ inst:JSUnmodifiableArray<dynamic>,
+ param:Class1a<int>,
+ param:Class1d<int>]
+*/
equals1(Class1a<int> a, Class1d<int> b) => a?.runtimeType == b?.runtimeType;
-/*member: almostEquals1:dynamic=[Class3.runtimeType,Type.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostEquals1:
+ dynamic=[
+ Class3.runtimeType,
+ Type.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostEquals1(Class3 a) => a.runtimeType == null;
-/*member: almostEquals2:dynamic=[Class3.==,Class3.runtimeType,Type.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostEquals2:
+ dynamic=[
+ Class3.==,
+ Class3.runtimeType,
+ Type.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostEquals2(Class3 a) => a?.runtimeType == null;
-/*member: almostEquals3:dynamic=[Class3.runtimeType,Null.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostEquals3:
+ dynamic=[
+ Class3.runtimeType,
+ Null.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostEquals3(Class3 a) => null == a.runtimeType;
-/*member: almostEquals4:dynamic=[Class3.==,Class3.runtimeType,Null.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostEquals4:
+ dynamic=[
+ Class3.==,
+ Class3.runtimeType,
+ Null.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostEquals4(Class3 a) => null == a?.runtimeType;
-/*member: almostEquals5:dynamic=[Class3.field,Class3.runtimeType,Type.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:Class3]*/
+/*member: almostEquals5:
+ dynamic=[
+ Class3.field,
+ Class3.runtimeType,
+ Type.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:Class3]
+*/
almostEquals5(Class3 a) => a.runtimeType == a.field;
-/*member: almostEquals6:dynamic=[Class3.==,Class3.field,Class3.runtimeType,Type.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostEquals6:
+ dynamic=[
+ Class3.==,
+ Class3.field,
+ Class3.runtimeType,
+ Type.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostEquals6(Class3 a) => a?.runtimeType == a.field;
-/*member: almostEquals7:dynamic=[Class3.==,Class3.field,Class3.runtimeType,Type.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostEquals7:
+ dynamic=[
+ Class3.==,
+ Class3.field,
+ Class3.runtimeType,
+ Type.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostEquals7(Class3 a) => a.runtimeType == a?.field;
-/*member: almostEquals8:dynamic=[Class3.==,Class3.field,Class3.runtimeType,Type.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostEquals8:
+ dynamic=[
+ Class3.==,
+ Class3.field,
+ Class3.runtimeType,
+ Type.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostEquals8(Class3 a) => a?.runtimeType == a?.field;
-/*member: almostEquals9:dynamic=[Class3.field,Class3.runtimeType,Object.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:Class3]*/
+/*member: almostEquals9:
+ dynamic=[
+ Class3.field,
+ Class3.runtimeType,
+ Object.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:Class3]
+*/
almostEquals9(Class3 a) => a.field == a.runtimeType;
-/*member: almostEquals10:dynamic=[Class3.==,Class3.field,Class3.runtimeType,Object.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostEquals10:
+ dynamic=[
+ Class3.==,
+ Class3.field,
+ Class3.runtimeType,
+ Object.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostEquals10(Class3 a) => a?.field == a.runtimeType;
-/*member: almostEquals11:dynamic=[Class3.==,Class3.field,Class3.runtimeType,Object.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostEquals11:
+ dynamic=[
+ Class3.==,
+ Class3.field,
+ Class3.runtimeType,
+ Object.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostEquals11(Class3 a) => a.field == a?.runtimeType;
-/*member: almostEquals12:dynamic=[Class3.==,Class3.field,Class3.runtimeType,Object.==],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostEquals12:
+ dynamic=[
+ Class3.==,
+ Class3.field,
+ Class3.runtimeType,
+ Object.==],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostEquals12(Class3 a) => a?.field == a?.runtimeType;
-/*member: almostToString1:dynamic=[Class3.runtimeType,Type.toString],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:Class3]*/
+/*member: almostToString1:
+ dynamic=[
+ Class3.runtimeType,
+ Type.toString],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:Class3]
+*/
almostToString1(Class3 a) => a.runtimeType.toString;
-/*member: almostToString2:dynamic=[Class3.==,Class3.runtimeType,Type.==,Type.toString],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostToString2:
+ dynamic=[
+ Class3.==,
+ Class3.runtimeType,
+ Type.==,
+ Type.toString],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostToString2(Class3 a) => a?.runtimeType?.toString;
-/*member: almostToString3:dynamic=[Class3.runtimeType,Type.noSuchMethod(1)],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostToString3:
+ dynamic=[
+ Class3.runtimeType,
+ Type.noSuchMethod(1)],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostToString3(Class3 a) => a.runtimeType.noSuchMethod(null);
-/*member: almostToString4:dynamic=[Class3.==,Class3.runtimeType,Type.noSuchMethod(1)],runtimeType=[unknown:Class3],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3]*/
+/*member: almostToString4:
+ dynamic=[
+ Class3.==,
+ Class3.runtimeType,
+ Type.noSuchMethod(1)],
+ runtimeType=[unknown:Class3],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3]
+*/
almostToString4(Class3 a) => a?.runtimeType.noSuchMethod(null);
-/*member: notEquals1:dynamic=[Class3.runtimeType,Class4.runtimeType,Type.==],runtimeType=[equals:Class3/Class4],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,param:Class3,param:Class4]*/
+/*member: notEquals1:
+ dynamic=[
+ Class3.runtimeType,
+ Class4.runtimeType,
+ Type.==],
+ runtimeType=[equals:Class3/Class4],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ param:Class3,
+ param:Class4]
+*/
notEquals1(Class3 a, Class4 b) => a.runtimeType != b.runtimeType;
-/*member: notEquals2:dynamic=[Class3.==,Class3.runtimeType,Class4.runtimeType,Type.==],runtimeType=[equals:Class3/Class4],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3,param:Class4]*/
+/*member: notEquals2:
+ dynamic=[
+ Class3.==,
+ Class3.runtimeType,
+ Class4.runtimeType,
+ Type.==],
+ runtimeType=[equals:Class3/Class4],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3,
+ param:Class4]
+*/
notEquals2(Class3 a, Class4 b) => a?.runtimeType != b.runtimeType;
-/*member: notEquals3:dynamic=[Class3.runtimeType,Class4.==,Class4.runtimeType,Type.==],runtimeType=[equals:Class3/Class4],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3,param:Class4]*/
+/*member: notEquals3:
+ dynamic=[
+ Class3.runtimeType,
+ Class4.==,
+ Class4.runtimeType,
+ Type.==],
+ runtimeType=[equals:Class3/Class4],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3,
+ param:Class4]
+*/
notEquals3(Class3 a, Class4 b) => a.runtimeType != b?.runtimeType;
-/*member: notEquals4:dynamic=[Class3.==,Class3.runtimeType,Class4.==,Class4.runtimeType,Type.==],runtimeType=[equals:Class3/Class4],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1)],type=[inst:Closure,inst:JSBool,inst:JSNull,param:Class3,param:Class4]*/
+/*member: notEquals4:
+ dynamic=[
+ Class3.==,
+ Class3.runtimeType,
+ Class4.==,
+ Class4.runtimeType,
+ Type.==],
+ runtimeType=[equals:Class3/Class4],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1)],
+ type=[
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ param:Class3,
+ param:Class4]
+*/
notEquals4(Class3 a, Class4 b) => a?.runtimeType != b?.runtimeType;
/*member: main:dynamic=[exact:Class1a.==],static=[Class1a.(0),Class1b.(0),Class1c.(0),Class1d.(0),Class2.(0),Class3.(0),Class4.(0),almostEquals1(1),almostEquals10(1),almostEquals11(1),almostEquals12(1),almostEquals2(1),almostEquals3(1),almostEquals4(1),almostEquals5(1),almostEquals6(1),almostEquals7(1),almostEquals8(1),almostEquals9(1),almostToString1(1),almostToString2(1),almostToString3(1),almostToString4(1),checkTypeBound(4),equals1(2),notEquals1(2),notEquals2(2),notEquals3(2),notEquals4(2),print(1),throwTypeError(1),toString1(1),toString2(1),toString3(1),toString4(1),toString5(1),toString6(1),unknown(1)]*/
diff --git a/tests/compiler/dart2js/impact/data/statements.dart b/tests/compiler/dart2js/impact/data/statements.dart
index 57bb512a..4d94691 100644
--- a/tests/compiler/dart2js/impact/data/statements.dart
+++ b/tests/compiler/dart2js/impact/data/statements.dart
@@ -67,13 +67,104 @@
return 1;
}
-/*member: testForIn:dynamic=[Iterator.current,Iterator.iterator,Iterator.moveNext(0)],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkConcurrentModificationError(2),findType(1),instanceType(1)],type=[impl:Iterable<dynamic>,inst:Closure,inst:JSBool,inst:JSNull,inst:Null]*/
+/*member: testForIn:
+ dynamic=[
+ Iterator.current,
+ Iterator.iterator,
+ Iterator.moveNext(0)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkConcurrentModificationError(2),
+ findType(1),
+ instanceType(1)],
+ type=[
+ impl:Iterable<dynamic>,
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ inst:Null]
+*/
testForIn(o) {
// ignore: UNUSED_LOCAL_VARIABLE
for (var e in o) {}
}
-/*member: testForInTyped:dynamic=[Iterator.current,Iterator.iterator,Iterator.moveNext(0)],static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),checkConcurrentModificationError(2),findType(1),instanceType(1)],type=[impl:Iterable<dynamic>,impl:int,inst:Closure,inst:JSBool,inst:JSNull,inst:Null]*/
+/*member: testForInTyped:
+ dynamic=[
+ Iterator.current,
+ Iterator.iterator,
+ Iterator.moveNext(0)],
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ checkConcurrentModificationError(2),
+ findType(1),
+ instanceType(1)],
+ type=[
+ impl:Iterable<dynamic>,
+ impl:int,
+ inst:Closure,
+ inst:JSBool,
+ inst:JSNull,
+ inst:Null]
+*/
testForInTyped(o) {
// ignore: UNUSED_LOCAL_VARIABLE
for (int e in o) {}
@@ -89,7 +180,48 @@
try {} catch (e) {}
}
-/*member: testTryCatchOn:static=[Rti._bind(1),Rti._eval(1),_arrayInstanceType(1),_asBoolNullable(1),_asDoubleNullable(1),_asIntNullable(1),_asNumNullable(1),_asObject(1),_asStringNullable(1),_asTop(1),_generalAsCheckImplementation(1),_generalIsTestImplementation(1),_installSpecializedIsTest(1),_instanceType(1),_isBool(1),_isInt(1),_isNum(1),_isObject(1),_isString(1),_isTop(1),findType(1),instanceType(1),unwrapException(1)],type=[catch:String,inst:Closure,inst:JSBool,inst:PlainJavaScriptObject,inst:UnknownJavaScriptObject]*/
+/*member: testTryCatchOn:
+ static=[
+ Rti._bind(1),
+ Rti._eval(1),
+ _arrayInstanceType(1),
+ _asBool(1),
+ _asBoolQ(1),
+ _asBoolS(1),
+ _asDouble(1),
+ _asDoubleQ(1),
+ _asDoubleS(1),
+ _asInt(1),
+ _asIntQ(1),
+ _asIntS(1),
+ _asNum(1),
+ _asNumQ(1),
+ _asNumS(1),
+ _asObject(1),
+ _asString(1),
+ _asStringQ(1),
+ _asStringS(1),
+ _asTop(1),
+ _generalAsCheckImplementation(1),
+ _generalIsTestImplementation(1),
+ _installSpecializedIsTest(1),
+ _instanceType(1),
+ _isBool(1),
+ _isInt(1),
+ _isNum(1),
+ _isObject(1),
+ _isString(1),
+ _isTop(1),
+ findType(1),
+ instanceType(1),
+ unwrapException(1)],
+ type=[
+ catch:String,
+ inst:Closure,
+ inst:JSBool,
+ inst:PlainJavaScriptObject,
+ inst:UnknownJavaScriptObject]
+*/
testTryCatchOn() {
// ignore: UNUSED_CATCH_CLAUSE
try {} on String catch (e) {}
diff --git a/tests/corelib/collection_length_test.dart b/tests/corelib/collection_length_test.dart
index 984f30e..2bc1f18 100644
--- a/tests/corelib/collection_length_test.dart
+++ b/tests/corelib/collection_length_test.dart
@@ -71,6 +71,7 @@
testCollection(new ListQueue(), N);
testCollection(new DoubleLinkedQueue(), N);
testList([]..length = N, N);
+ testList(new List.filled(0, null, growable: true)..length = N, N);
testList(new List.filled(N, null), N);
testString(N);
}
diff --git a/tests/corelib/list_concurrent_modify_test.dart b/tests/corelib/list_concurrent_modify_test.dart
index 0111063..df62919 100644
--- a/tests/corelib/list_concurrent_modify_test.dart
+++ b/tests/corelib/list_concurrent_modify_test.dart
@@ -8,10 +8,8 @@
void main() {
// Growable lists. Initial length 0.
- testConcurrentModification(new List());
- testConcurrentModification(new List<int>().toList());
- testConcurrentModification(new List<int?>(0).toList());
- testConcurrentModification(new List.filled(0, null, growable: true));
+ testConcurrentModification(<int>[].toList());
+ testConcurrentModification(new List.filled(0, 0, growable: true));
testConcurrentModification([]);
testConcurrentModification(new List.from(const []));
testConcurrentModification(new MyList([]));
@@ -28,7 +26,7 @@
testConcurrentAddSelf([1, 2, 3]);
}
-void testConcurrentModification(List<int?> list) {
+void testConcurrentModification(List<int> list) {
// add, removeLast.
list.clear();
list.addAll([1, 2, 3, 2, 7, 9, 9, 7, 2, 3, 2, 1]);
@@ -93,6 +91,10 @@
_source.length = length;
}
+ void add(E element) {
+ _source.add(element);
+ }
+
E operator [](int index) => _source[index];
void operator []=(int index, E value) {
_source[index] = value;
diff --git a/tests/corelib/list_removeat_test.dart b/tests/corelib/list_removeat_test.dart
index 6fedda8..a1657c2 100644
--- a/tests/corelib/list_removeat_test.dart
+++ b/tests/corelib/list_removeat_test.dart
@@ -25,7 +25,10 @@
// Index must be integer and in range.
Expect.throwsRangeError(() => l1.removeAt(-1), "negative");
Expect.throwsRangeError(() => l1.removeAt(5), "too large");
- Expect.throwsArgumentError(() => l1.removeAt(null), "too large");
+ Expect.throws(() => l1.removeAt(null),
+ // With --null-safety a TypeError is thrown
+ // With --no-null-safety an ArgumentError is thrown
+ (e) => e is TypeError || e is ArgumentError, "is null");
Expect.equals(2, l1.removeAt(2), "l1-remove2");
Expect.equals(1, l1[1], "l1-1[1]");
@@ -47,7 +50,7 @@
testModifiableList(new MyList([0, 1, 2, 3, 4]));
// Fixed size list.
- var l2 = new List(5);
+ var l2 = new List<int?>.filled(5, null);
for (var i = 0; i < 5; i++) l2[i] = i;
Expect.throwsUnsupportedError(() => l2.removeAt(2), "fixed-length");
diff --git a/tests/corelib/list_test.dart b/tests/corelib/list_test.dart
index 18f2749..aa18a79 100644
--- a/tests/corelib/list_test.dart
+++ b/tests/corelib/list_test.dart
@@ -22,17 +22,21 @@
testTypedList(new Int32List(4).toList(growable: false));
// Fixed length lists, length 4.
- testFixedLengthList(<T>() => new List<T?>(4));
- testFixedLengthList(<T>() => new List<T?>(4).toList(growable: false));
- testFixedLengthList(<T>() => (new List<T?>()..length = 4).toList(growable: false));
+ testFixedLengthList(<T>() => new List<T?>.filled(4, null));
+ testFixedLengthList(
+ <T>() => new List<T?>.filled(4, null).toList(growable: false));
+ testFixedLengthList(<T>() => (<T?>[]..length = 4).toList(growable: false));
+ testFixedLengthList(<T>() => (new List<T?>.filled(0, null, growable: true)
+ ..length = 4)
+ .toList(growable: false));
// ListBase implementation of List.
- testFixedLengthList(<T>() => new MyFixedList(new List<T?>(4)));
- testFixedLengthList(<T>() => new MyFixedList<T?>(new List<T?>(4)).toList(growable: false));
+ testFixedLengthList(<T>() => new MyFixedList(new List<T?>.filled(4, null)));
+ testFixedLengthList(<T>() => new MyFixedList<T?>(new List<T?>.filled(4, null))
+ .toList(growable: false));
// Growable lists. Initial length 0.
- testGrowableList(<T>() => new List());
- testGrowableList(<T>() => new List<T?>().toList());
- testGrowableList(<T>() => new List<T?>(0).toList());
+ testGrowableList(<T>() => <T?>[].toList());
+ testGrowableList(<T>() => new List<T?>.filled(0, null).toList());
testGrowableList(<T>() => new List<T?>.filled(0, null, growable: true));
testGrowableList(<T>() => []);
testGrowableList(<T>() => new List.from(const []));
@@ -118,7 +122,7 @@
// Empty lists.
testRangeErrors([], "list");
- testRangeErrors(new List(0), "fixed-list");
+ testRangeErrors(new List.filled(0, null), "fixed-list");
testRangeErrors(const [], "const-list");
testRangeErrors(new List.unmodifiable([]), "unmodifiable");
testRangeErrors(new Uint8List(0), "typed-list");
@@ -126,7 +130,7 @@
testRangeErrors([1, 2, 3].sublist(1, 1), "sub-list");
// Non-empty lists.
testRangeErrors([1, 2, 3], "list");
- testRangeErrors(new List(3), "fixed-list");
+ testRangeErrors(new List.filled(3, null), "fixed-list");
testRangeErrors(const [1, 2, 3], "const-list");
testRangeErrors(new List.unmodifiable([1, 2, 3]), "unmodifiable");
testRangeErrors(new Uint8List(3), "typed-list");
@@ -279,8 +283,8 @@
void testLengthInvariantOperations(List<int?> list) {
testTypedLengthInvariantOperations(list);
- Expect.throwsTypeError(() => testUntypedListTests(list),
- 'List<int> cannot store non-ints');
+ Expect.throwsTypeError(
+ () => testUntypedListTests(list), 'List<int> cannot store non-ints');
// Argument errors on bad indices. List is still [0, 1, 2, 3].
@@ -568,11 +572,11 @@
void testListConstructor() {
// Is fixed-length.
- Expect.throws(() => new List(0).add(4));
- Expect.throws(() => new List(-2)); // Not negative. //# 01: ok
+ Expect.throws(() => new List<int?>.filled(0, null).add(4));
+ Expect.throws(() => new List.filled(-2, null)); // Not negative. //# 01: ok
// Not null.
- Expect.throws(() => new List(null));
- Expect.listEquals([4], new List()..add(4));
+ Expect.throws(() => new List.filled(null, null));
+ Expect.listEquals([4], <int>[]..add(4));
// Is fixed-length.
Expect.throws(() => new List.filled(0, 42).add(4));
// Not negative.
diff --git a/tests/language/control_flow_collections/await_for_null_test.dart b/tests/language/control_flow_collections/await_for_null_test.dart
index 492e153..a8f4154 100644
--- a/tests/language/control_flow_collections/await_for_null_test.dart
+++ b/tests/language/control_flow_collections/await_for_null_test.dart
@@ -8,14 +8,14 @@
Stream<int>? nullStream;
var a = <int>[await for (var i in nullStream) 1];
// ^^^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] The type 'Stream<int>?' used in the 'for' loop must implement 'Stream<dynamic>'.
var b = <int, int>{await for (var i in nullStream) 1: 1};
// ^^^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] The type 'Stream<int>?' used in the 'for' loop must implement 'Stream<dynamic>'.
var c = <int>{await for (var i in nullStream) 1};
// ^^^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] The type 'Stream<int>?' used in the 'for' loop must implement 'Stream<dynamic>'.
}
diff --git a/tests/language/control_flow_collections/for_downcast_test.dart b/tests/language/control_flow_collections/for_downcast_test.dart
index e16067e..f857295 100644
--- a/tests/language/control_flow_collections/for_downcast_test.dart
+++ b/tests/language/control_flow_collections/for_downcast_test.dart
@@ -117,14 +117,14 @@
Iterable<int>? nullIterable = null;
var a = <int>[for (var i in nullIterable) 1];
// ^^^^^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>'.
var b = {for (var i in nullIterable) 1: 1};
// ^^^^^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>'.
var c = <int>{for (var i in nullIterable) 1};
// ^^^^^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>'.
}
diff --git a/tests/language/control_flow_collections/for_null_condition_test.dart b/tests/language/control_flow_collections/for_null_condition_test.dart
index e88d665..31b02b9 100644
--- a/tests/language/control_flow_collections/for_null_condition_test.dart
+++ b/tests/language/control_flow_collections/for_null_condition_test.dart
@@ -9,14 +9,14 @@
bool? nullBool = null;
var a = <int>[for (; nullBool;) 1];
// ^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
var b = <int, int>{for (; nullBool;) 1: 1};
// ^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
var c = <int>{for (; nullBool;) 1};
// ^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
}
diff --git a/tests/language/control_flow_collections/if_null_condition_test.dart b/tests/language/control_flow_collections/if_null_condition_test.dart
index 4e613c2..667c6bd 100644
--- a/tests/language/control_flow_collections/if_null_condition_test.dart
+++ b/tests/language/control_flow_collections/if_null_condition_test.dart
@@ -6,16 +6,16 @@
bool? nullBool;
var a = <int>[if (nullBool) 1];
// ^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
var b = <int, int>{if (nullBool) 1: 1};
// ^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
var c = <int>{if (nullBool) 1};
// ^^^^^^^^
- // [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+ // [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] A value of type 'bool?' can't be assigned to a variable of type 'bool'.
}
diff --git a/tests/language/nnbd/resolution/null_aware_subscript_produces_nullable_type_test.dart b/tests/language/nnbd/resolution/null_aware_subscript_produces_nullable_type_test.dart
index c4f6385..43472fd 100644
--- a/tests/language/nnbd/resolution/null_aware_subscript_produces_nullable_type_test.dart
+++ b/tests/language/nnbd/resolution/null_aware_subscript_produces_nullable_type_test.dart
@@ -19,7 +19,7 @@
void f2(NotGeneric? x) {
x?[0] + 1;
//^^^^^
-// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] unspecified
x?[0] = 1;
useNonNullable(x?[0] = 1);
@@ -46,14 +46,14 @@
void f3<T extends num>(Generic<T>? x) {
x?[0] + 1;
//^^^^^
-// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] unspecified
}
void f4<T extends num>(Generic<T?> x) {
x[0] + 1;
//^^^^
-// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] unspecified
}
diff --git a/tests/language/nnbd/resolution/question_question_lub_test.dart b/tests/language/nnbd/resolution/question_question_lub_test.dart
index b050b2a..830c848 100644
--- a/tests/language/nnbd/resolution/question_question_lub_test.dart
+++ b/tests/language/nnbd/resolution/question_question_lub_test.dart
@@ -16,13 +16,13 @@
(nullableInt ?? nonNullInt) + 1;
(nullableInt ?? nullableInt) + 1;
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] unspecified
(nonNullInt ?? nullableInt) + 1;
// ^^^^^^^^^^^
// [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION
//^^^^^^^^^^^^^^^^^^^^^^^^^^^
-// [analyzer] STATIC_WARNING.USE_OF_NULLABLE_VALUE
+// [analyzer] STATIC_WARNING.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] unspecified
(nonNullInt ?? nonNullInt) + 1;
// ^^^^^^^^^^
diff --git a/tests/standalone/io/process_check_arguments_test.dart b/tests/standalone/io/process_check_arguments_test.dart
index f6bfd0b..9922dc1 100644
--- a/tests/standalone/io/process_check_arguments_test.dart
+++ b/tests/standalone/io/process_check_arguments_test.dart
@@ -36,4 +36,5 @@
test([scriptFile.path, '4', '0', 'a\tb', 'a']);
test([scriptFile.path, '4', '0', 'a\tb', 'a\t\t\t\tb']);
test([scriptFile.path, '4', '0', 'a\tb', 'a b']);
+ test([scriptFile.path, '5', '0', 'a\tb', 'a b', '']);
}
diff --git a/tests/standalone_2/io/process_check_arguments_test.dart b/tests/standalone_2/io/process_check_arguments_test.dart
index c79c00e..366223d 100644
--- a/tests/standalone_2/io/process_check_arguments_test.dart
+++ b/tests/standalone_2/io/process_check_arguments_test.dart
@@ -36,4 +36,5 @@
test([scriptFile.path, '4', '0', 'a\tb', 'a']);
test([scriptFile.path, '4', '0', 'a\tb', 'a\t\t\t\tb']);
test([scriptFile.path, '4', '0', 'a\tb', 'a b']);
+ test([scriptFile.path, '5', '0', 'a\tb', 'a b', '']);
}
diff --git a/tools/VERSION b/tools/VERSION
index 8909bf9..fe4153b 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -33,7 +33,7 @@
MAJOR 2
MINOR 9
PATCH 0
-PRERELEASE 1
+PRERELEASE 2
PRERELEASE_PATCH 0
ABI_VERSION 32
OLDEST_SUPPORTED_ABI_VERSION 32
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index e4602d8..c549bb6 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -327,6 +327,7 @@
"pkg/dart_internal/",
"pkg/dart2native/",
"pkg/dart2js_tools/",
+ "pkg/dds/",
"pkg/expect/",
"pkg/front_end/",
"pkg/js/",
@@ -412,6 +413,7 @@
"pkg/dart_internal/",
"pkg/dart2native/",
"pkg/dart2js_tools/",
+ "pkg/dds/",
"pkg/expect/",
"pkg/front_end/",
"pkg/js/",
diff --git a/tools/generate_package_config.dart b/tools/generate_package_config.dart
index 3d415c3..19e9c94 100755
--- a/tools/generate_package_config.dart
+++ b/tools/generate_package_config.dart
@@ -34,6 +34,7 @@
packageDirectory('pkg/front_end/testcases/general_nnbd_opt_out/'),
packageDirectory('pkg/front_end/testcases/late_lowering/'),
packageDirectory('pkg/front_end/testcases/nnbd/'),
+ packageDirectory('pkg/front_end/testcases/nonfunction_type_aliases/'),
];
var packages = [