mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[dart2js] Remove remaining language version overrides
Now that dart2js only takes migrated files as input, all tests should use the current language version. Change-Id: I6c84850f5786aeac04154b67bd7a3c19083c8bba Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345344 Reviewed-by: Nate Biggs <natebiggs@google.com> Commit-Queue: Mayank Patke <fishythefish@google.com>
This commit is contained in:
parent
307c6d1dd2
commit
f79ed9301b
|
@ -54,7 +54,7 @@ class DartTypeConverter extends ir.DartTypeVisitor<DartType> {
|
|||
|
||||
DartType _convertNullability(
|
||||
DartType baseType, ir.DartType nullabilitySource) {
|
||||
final nullability = nullabilitySource.nullability;
|
||||
final nullability = nullabilitySource.declaredNullability;
|
||||
switch (nullability) {
|
||||
case ir.Nullability.nonNullable:
|
||||
return baseType;
|
||||
|
@ -68,7 +68,8 @@ class DartTypeConverter extends ir.DartTypeVisitor<DartType> {
|
|||
// nullability of the bound. We don't need a nullability wrapper in this
|
||||
// case.
|
||||
if (nullabilitySource is ir.TypeParameterType ||
|
||||
nullabilitySource is ir.StructuralParameterType) {
|
||||
nullabilitySource is ir.StructuralParameterType ||
|
||||
nullabilitySource is ir.ExtensionType) {
|
||||
return baseType;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,8 +95,7 @@ Future<api.CompilationResult> runCompiler(
|
|||
bool showDiagnostics = true,
|
||||
Uri? librariesSpecificationUri,
|
||||
Uri? packageConfig,
|
||||
void beforeRun(Compiler compiler)?,
|
||||
bool unsafeToTouchSourceFiles = false}) async {
|
||||
void beforeRun(Compiler compiler)?}) async {
|
||||
if (entryPoint == null) {
|
||||
entryPoint = Uri.parse('memory:main.dart');
|
||||
}
|
||||
|
@ -109,8 +108,7 @@ Future<api.CompilationResult> runCompiler(
|
|||
environment: environment,
|
||||
showDiagnostics: showDiagnostics,
|
||||
librariesSpecificationUri: librariesSpecificationUri,
|
||||
packageConfig: packageConfig,
|
||||
unsafeToTouchSourceFiles: unsafeToTouchSourceFiles);
|
||||
packageConfig: packageConfig);
|
||||
if (beforeRun != null) {
|
||||
beforeRun(compiler);
|
||||
}
|
||||
|
@ -130,8 +128,7 @@ Compiler compilerFor(
|
|||
Map<String, String>? environment,
|
||||
bool showDiagnostics = true,
|
||||
Uri? librariesSpecificationUri,
|
||||
Uri? packageConfig,
|
||||
bool unsafeToTouchSourceFiles = false}) {
|
||||
Uri? packageConfig}) {
|
||||
retainDataForTesting = true;
|
||||
librariesSpecificationUri ??= sdkLibrariesSpecificationUri;
|
||||
|
||||
|
@ -148,41 +145,6 @@ Compiler compilerFor(
|
|||
// Create a local in case we end up cloning memorySourceFiles.
|
||||
Map<String, dynamic> sources = memorySourceFiles;
|
||||
|
||||
// If soundNullSafety is not requested, then we prepend the opt out string to
|
||||
// the memory files.
|
||||
// TODO(48820): After migrating all tests we should no longer have to infer
|
||||
// a mode in the memory compiler. The logic to update options and to update
|
||||
// sources to opt-out should be removed.
|
||||
if (!options.contains(Flags.soundNullSafety)) {
|
||||
bool addUnsoundFlag = false;
|
||||
if (!unsafeToTouchSourceFiles) {
|
||||
// Map may be immutable so copy.
|
||||
sources = {};
|
||||
memorySourceFiles.forEach((k, v) => sources[k] = v);
|
||||
addUnsoundFlag = true;
|
||||
}
|
||||
|
||||
for (var key in sources.keys) {
|
||||
if (sources[key] is String && key.endsWith('.dart')) {
|
||||
RegExp optOutStr = RegExp(r"\/\/\s*@dart\s*=\s*2\.(\d+)");
|
||||
final match = optOutStr.firstMatch(sources[key]);
|
||||
if (match == null) {
|
||||
if (!unsafeToTouchSourceFiles) {
|
||||
sources[key] = '// @dart=2.7\n' + sources[key];
|
||||
}
|
||||
} else {
|
||||
// If the file version is prior to 2.12, we treat it as unsound
|
||||
if (int.parse(match.group(1)!) < 12) {
|
||||
addUnsoundFlag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addUnsoundFlag && !options.contains(Flags.noSoundNullSafety)) {
|
||||
options = [Flags.noSoundNullSafety, ...options];
|
||||
}
|
||||
}
|
||||
|
||||
MemorySourceFileProvider provider;
|
||||
provider = MemorySourceFileProvider(sources);
|
||||
diagnosticHandler = createCompilerDiagnostics(diagnosticHandler, provider,
|
||||
|
@ -193,15 +155,10 @@ Compiler compilerFor(
|
|||
outputProvider = const NullCompilerOutput();
|
||||
}
|
||||
|
||||
options.add('${Flags.entryUri}=$entryPoint');
|
||||
options = [...options, '${Flags.entryUri}=$entryPoint'];
|
||||
|
||||
CompilerOptions compilerOptions = CompilerOptions.parse(options,
|
||||
librariesSpecificationUri: librariesSpecificationUri,
|
||||
// Unsound platform dill files are no longer packaged in the SDK and must
|
||||
// be read from the build directory during tests.
|
||||
platformBinaries: options.contains(Flags.noSoundNullSafety)
|
||||
? buildPlatformBinariesUri
|
||||
: null)
|
||||
librariesSpecificationUri: librariesSpecificationUri)
|
||||
..environment = environment ?? {}
|
||||
..packageConfig = packageConfig;
|
||||
|
||||
|
|
|
@ -35,4 +35,3 @@ dev_dependencies:
|
|||
modular_test: any
|
||||
sourcemap_testing: any
|
||||
testing: any
|
||||
vm: any
|
||||
|
|
|
@ -8,8 +8,8 @@ import '../helpers/compiler_helper.dart';
|
|||
|
||||
const String TEST = r"""
|
||||
foo() {
|
||||
String s = Object().toString();
|
||||
Object o = Object().toString();
|
||||
String? s = Object()?.toString();
|
||||
Object? o = Object()?.toString();
|
||||
return s == 'foo'
|
||||
&& s == null
|
||||
&& null == s
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
// 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 'codegen_test_helper.dart';
|
||||
|
||||
main(List<String> args) {
|
||||
runTests2(args, 0);
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
// 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 'codegen_test_helper.dart';
|
||||
|
||||
main(List<String> args) {
|
||||
runTests2(args, 1);
|
||||
}
|
|
@ -6,7 +6,6 @@ import 'dart:io';
|
|||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:compiler/src/closure.dart';
|
||||
import 'package:compiler/src/common.dart';
|
||||
import 'package:compiler/src/commandline_options.dart';
|
||||
import 'package:compiler/src/compiler.dart';
|
||||
import 'package:compiler/src/elements/entities.dart';
|
||||
import 'package:compiler/src/js_model/element_map.dart';
|
||||
|
@ -17,11 +16,9 @@ import '../equivalence/id_equivalence.dart';
|
|||
import '../equivalence/id_equivalence_helper.dart';
|
||||
|
||||
const List<String> skip = [];
|
||||
const List<String> skip2 = [];
|
||||
|
||||
main(List<String> args) {
|
||||
runTests(args);
|
||||
runTests2(args);
|
||||
}
|
||||
|
||||
runTests(List<String> args, [int? shardIndex]) {
|
||||
|
@ -30,16 +27,7 @@ runTests(List<String> args, [int? shardIndex]) {
|
|||
shards: 2,
|
||||
directory: 'data',
|
||||
skip: skip,
|
||||
options: [Flags.soundNullSafety]);
|
||||
}
|
||||
|
||||
runTests2(List<String> args, [int? shardIndex]) {
|
||||
runTestsCommon(args,
|
||||
shardIndex: shardIndex,
|
||||
shards: 2,
|
||||
directory: 'data_2',
|
||||
skip: skip2,
|
||||
options: []);
|
||||
options: const []);
|
||||
}
|
||||
|
||||
runTestsCommon(List<String> args,
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.17
|
||||
|
||||
/*member: main:ignore*/
|
||||
void main() {
|
||||
final x1 = XX();
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.14
|
||||
|
||||
/*member: main:ignore*/
|
||||
void main() {
|
||||
for (var a in [false, true]) {
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.12
|
||||
|
||||
/*member: main:ignore*/
|
||||
void main() {
|
||||
for (var a in [false, true]) {
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
spec=pkg/compiler/test/codegen/codegen_test_helper.dart
|
||||
prod=pkg/compiler/test/codegen/codegen_test_helper.dart
|
||||
canary=pkg/compiler/test/codegen/codegen_test_helper.dart
|
|
@ -1,118 +0,0 @@
|
|||
// 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.7
|
||||
|
||||
/*member: main:ignore*/
|
||||
void main() {
|
||||
for (var a in [false, true]) {
|
||||
sink = foo1(a);
|
||||
sink = foo2(a);
|
||||
sink = foo3(a);
|
||||
sink = foo4(a, 2);
|
||||
sink = foo4(a, 10);
|
||||
|
||||
for (var b in [false, true]) {
|
||||
sink = foo5(a, b);
|
||||
sink = foo_regress_37502(a, b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Object sink;
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
/*spec|canary.member: foo1:function(param) {
|
||||
return (A.boolConversionCheck(param) ? 4294967295 : 1) / 2 | 0;
|
||||
}*/
|
||||
/*prod.member: foo1:function(param) {
|
||||
return (param ? 4294967295 : 1) / 2 | 0;
|
||||
}*/
|
||||
int foo1(bool param) {
|
||||
var a = param ? 0xFFFFFFFF : 1;
|
||||
return a ~/ 2;
|
||||
// Above can be compiled to division followed by truncate.
|
||||
// present: ' / 2 | 0'
|
||||
}
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
/*spec|canary.member: foo2:function(param) {
|
||||
return (A.boolConversionCheck(param) ? 4294967295 : 1) / 3 | 0;
|
||||
}*/
|
||||
/*prod.member: foo2:function(param) {
|
||||
return (param ? 4294967295 : 1) / 3 | 0;
|
||||
}*/
|
||||
int foo2(bool param) {
|
||||
var a = param ? 0xFFFFFFFF : 1;
|
||||
return a ~/ 3;
|
||||
// Above can be compiled to division followed by truncate.
|
||||
// present: ' / 3 | 0'
|
||||
}
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
/*spec|canary.member: foo3:function(param) {
|
||||
return B.JSInt_methods._tdivFast$1(A.boolConversionCheck(param) ? 4294967295 : -1, 2);
|
||||
}*/
|
||||
/*prod.member: foo3:function(param) {
|
||||
return B.JSInt_methods._tdivFast$1(param ? 4294967295 : -1, 2);
|
||||
}*/
|
||||
int foo3(bool param) {
|
||||
var a = param ? 0xFFFFFFFF : -1;
|
||||
return a ~/ 2;
|
||||
// Potentially negative inputs go via '_tdivFast' fast helper.
|
||||
// present: '_tdivFast'
|
||||
}
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
/*spec|canary.member: foo4:function(param1, param2) {
|
||||
return B.JSInt_methods.$tdiv(A.boolConversionCheck(param1) ? 4294967295 : 0, param2);
|
||||
}*/
|
||||
/*prod.member: foo4:function(param1, param2) {
|
||||
return B.JSInt_methods.$tdiv(param1 ? 4294967295 : 0, param2);
|
||||
}*/
|
||||
int foo4(bool param1, int param2) {
|
||||
var a = param1 ? 0xFFFFFFFF : 0;
|
||||
return a ~/ param2;
|
||||
// Unknown divisor goes via full implementation.
|
||||
// present: '$tdiv'
|
||||
// absent: '/'
|
||||
}
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
/*spec|canary.member: foo5:function(param1, param2) {
|
||||
var a = A.boolConversionCheck(param1) ? 4294967295 : 0;
|
||||
return B.JSInt_methods.$tdiv(a, A.boolConversionCheck(param2) ? 3 : 4);
|
||||
}*/
|
||||
/*prod.member: foo5:function(param1, param2) {
|
||||
var a = param1 ? 4294967295 : 0;
|
||||
return B.JSInt_methods.$tdiv(a, param2 ? 3 : 4);
|
||||
}*/
|
||||
int foo5(bool param1, bool param2) {
|
||||
var a = param1 ? 0xFFFFFFFF : 0;
|
||||
var b = param2 ? 3 : 4;
|
||||
return a ~/ b;
|
||||
// We could optimize this with range analysis, but type inference summarizes
|
||||
// '3 or 4' to uint31, which is not >= 2.
|
||||
// present: '$tdiv'
|
||||
// absent: '/'
|
||||
}
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
/*spec|canary.member: foo_regress_37502:function(param1, param2) {
|
||||
var a = A.boolConversionCheck(param1) ? 1.2 : 12.3;
|
||||
return B.JSInt_methods.gcd$1(B.JSNumber_methods.$tdiv(a, A.boolConversionCheck(param2) ? 3.14 : 2.81), 2);
|
||||
}*/
|
||||
/*prod.member: foo_regress_37502:function(param1, param2) {
|
||||
var a = param1 ? 1.2 : 12.3;
|
||||
return B.JSInt_methods.gcd$1(B.JSNumber_methods.$tdiv(a, param2 ? 3.14 : 2.81), 2);
|
||||
}*/
|
||||
foo_regress_37502(param1, param2) {
|
||||
var a = param1 ? 1.2 : 12.3;
|
||||
var b = param2 ? 3.14 : 2.81;
|
||||
return (a ~/ b).gcd(2);
|
||||
// The result of ~/ is int; gcd is defined only on int and is too complex
|
||||
// to be inlined.
|
||||
//
|
||||
// present: 'JSInt_methods.gcd'
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
// 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.10
|
||||
|
||||
// ignore_for_file: unused_local_variable
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
// No code to construct unused map.
|
||||
/*member: foo1:function() {
|
||||
return;
|
||||
}*/
|
||||
void foo1() {
|
||||
var x = {};
|
||||
return;
|
||||
}
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
// No code to construct unused maps.
|
||||
/*member: foo2:function() {
|
||||
return;
|
||||
}*/
|
||||
void foo2() {
|
||||
var x = {};
|
||||
var y = <String, String>{};
|
||||
return;
|
||||
}
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
// No code to construct maps which become unused after list is removed.
|
||||
/*member: foo3:function() {
|
||||
return;
|
||||
}*/
|
||||
void foo3() {
|
||||
var x = [{}, {}];
|
||||
return;
|
||||
}
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
// Constructor is inlined, allocation is removed, leaving maps unused.
|
||||
/*member: foo4:function() {
|
||||
return;
|
||||
}*/
|
||||
void foo4() {
|
||||
var x = AAA4({});
|
||||
return;
|
||||
}
|
||||
|
||||
class AAA4 {
|
||||
Map<String, String> field1 = {};
|
||||
Map<String, int> field2;
|
||||
AAA4(this.field2);
|
||||
}
|
||||
|
||||
/*member: main:ignore*/
|
||||
main() {
|
||||
foo1();
|
||||
foo2();
|
||||
foo3();
|
||||
foo4();
|
||||
}
|
|
@ -15,7 +15,7 @@ main() {
|
|||
runTest() async {
|
||||
String generated = await compile(
|
||||
'final List a = const ["bar", "baz"];'
|
||||
'int foo() {'
|
||||
'void foo() {'
|
||||
' for (int i = 0; i < a.length; i++) {'
|
||||
' print(a[i]);'
|
||||
' }'
|
||||
|
|
|
@ -9,7 +9,7 @@ import 'package:async_helper/async_helper.dart';
|
|||
import '../helpers/compiler_helper.dart';
|
||||
|
||||
const String TEST1 = r"""
|
||||
foo(int a) {
|
||||
foo(int? a) {
|
||||
return a == null;
|
||||
// present: 'a == null'
|
||||
// absent: 'eq'
|
||||
|
@ -25,7 +25,7 @@ foo(int a) {
|
|||
""";
|
||||
|
||||
const String TEST3 = r"""
|
||||
foo(int a, int b) {
|
||||
foo(int? a, int? b) {
|
||||
return a == b;
|
||||
// present: 'a == b'
|
||||
// absent: 'eq'
|
||||
|
@ -34,7 +34,7 @@ foo(int a, int b) {
|
|||
""";
|
||||
|
||||
const String TEST4 = r"""
|
||||
foo(String a, String b) {
|
||||
foo(String? a, String? b) {
|
||||
return a == b;
|
||||
// present: 'a == b'
|
||||
// absent: 'eq'
|
||||
|
@ -45,7 +45,7 @@ foo(String a, String b) {
|
|||
// Comparable includes String and int, so can't be compared with `a == b` since
|
||||
// that will convert an operand to make `2 == "2"` true.
|
||||
const String TEST5 = r"""
|
||||
foo(Comparable a, Comparable b) {
|
||||
foo(Comparable? a, Comparable? b) {
|
||||
return a == b;
|
||||
// present: 'a === b'
|
||||
// present: 'a == null'
|
||||
|
@ -66,7 +66,7 @@ foo(dynamic a, dynamic b) {
|
|||
// StringBuffer uses `Object.==`, i.e. `identical`. This can be lowered to `==`
|
||||
// because no operand will cause JavaScript conversions.
|
||||
const String TEST7 = r"""
|
||||
foo(StringBuffer a, StringBuffer b) {
|
||||
foo(StringBuffer? a, StringBuffer? b) {
|
||||
return a == b;
|
||||
// present: ' == '
|
||||
// absent: '==='
|
||||
|
|
|
@ -13,7 +13,7 @@ import '../helpers/compiler_helper.dart';
|
|||
|
||||
const String TEST = r"""
|
||||
class A {
|
||||
Object value;
|
||||
Object? value;
|
||||
@pragma('dart2js:tryInline')
|
||||
@pragma('dart2js:as:trust')
|
||||
T foo<T>() => value as T;
|
||||
|
|
|
@ -20,8 +20,8 @@ void foo(bar) {
|
|||
const String TEST_TWO = r"""
|
||||
void foo(a) {
|
||||
var list = <int>[];
|
||||
list[0] = list[0 % a];
|
||||
list[1] = list[1 % a];
|
||||
list[0] = list[0 % a as int];
|
||||
list[1] = list[1 % a as int];
|
||||
}
|
||||
""";
|
||||
|
||||
|
@ -53,7 +53,7 @@ class A {
|
|||
class B {}
|
||||
|
||||
main() {
|
||||
helper([new A(32), A(21), B(), null][0]);
|
||||
helper([new A(32), A(21), B(), null][0] as A);
|
||||
}
|
||||
|
||||
helper(A a) {
|
||||
|
@ -106,7 +106,7 @@ class A {
|
|||
main() {
|
||||
dynamic a = A();
|
||||
dynamic b = A.bar();
|
||||
for (int i = 0; i < a.field; i++) { a.field = 42; b.field = 42; }
|
||||
for (int i = 0; i < a.field!; i++) { a.field = 42; b.field = 42; }
|
||||
}
|
||||
""";
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import '../helpers/compiler_helper.dart';
|
|||
|
||||
const String TEST_ONE = r"""
|
||||
foo(b) {
|
||||
var a = b ? [1,2,3] : null;
|
||||
dynamic a = b ? [1,2,3] : null;
|
||||
print(a.first);
|
||||
}
|
||||
""";
|
||||
|
|
|
@ -31,8 +31,7 @@ void main() {
|
|||
entry: 'entry',
|
||||
methodName: 'test',
|
||||
disableTypeInference: false,
|
||||
disableInlining: false,
|
||||
soundNullSafety: true, check: (String generated) {
|
||||
disableInlining: false, check: (String generated) {
|
||||
RegExp regexp = RegExp(r'=== \$');
|
||||
Expect.equals(1, regexp.allMatches(generated).length);
|
||||
});
|
||||
|
|
|
@ -46,8 +46,7 @@ Future check(String test, {String entry = 'test'}) {
|
|||
methodName: 'test',
|
||||
check: checkerForAbsentPresent(test),
|
||||
disableTypeInference: false,
|
||||
disableInlining: false,
|
||||
soundNullSafety: true);
|
||||
disableInlining: false);
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -17,7 +17,7 @@ main() {
|
|||
|
||||
String TEST2(selectorName, args) {
|
||||
return """
|
||||
var a = [42];
|
||||
var a = <int?>[42];
|
||||
main() {
|
||||
a.$selectorName($args);
|
||||
return a[0];
|
||||
|
@ -103,7 +103,7 @@ checkRangeError(String test,
|
|||
main() {
|
||||
asyncTest(() async {
|
||||
await checkRangeError(TEST1, hasRangeError: false);
|
||||
await checkRangeError(TEST2('insert', 'null, null'), hasRangeError: true);
|
||||
await checkRangeError(TEST2('insert', '-1, null'), hasRangeError: true);
|
||||
await checkRangeError(TEST2('add', 'null'), hasRangeError: true);
|
||||
await checkRangeError(TEST2('clear', ''), hasRangeError: true);
|
||||
await checkRangeError(TEST2('toString', ''), hasRangeError: false);
|
||||
|
|
|
@ -8,7 +8,7 @@ import '../helpers/compiler_helper.dart';
|
|||
|
||||
const String TEST1 = r"""
|
||||
main() {
|
||||
var a = [42, null];
|
||||
var a = <dynamic>[42, null];
|
||||
return a[0] + 42;
|
||||
}
|
||||
""";
|
||||
|
@ -32,7 +32,7 @@ main() {
|
|||
|
||||
const String TEST4 = r"""
|
||||
main() {
|
||||
var a = List.filled(42, null);
|
||||
var a = List<dynamic>.filled(42, null);
|
||||
a[a.length - 1] = 42;
|
||||
return 42 + a[0];
|
||||
}
|
||||
|
|
|
@ -226,7 +226,7 @@ const String TEST_18 = """
|
|||
|
||||
main() {
|
||||
var a = [42, true];
|
||||
if (a[1]) {
|
||||
if (a[1] as bool) {
|
||||
a[0] = 1;
|
||||
} else {
|
||||
a[0] = 2;
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: method1:params=0*/
|
||||
@pragma('dart2js:noInline')
|
||||
method1([a]) => /*access=[a],params=0*/ () => a;
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
// Derived from tests/web_2/constant_folding_test
|
||||
// Derived from tests/web/constant_folding_test
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
|
@ -20,7 +18,7 @@ void main() {
|
|||
}
|
||||
|
||||
/*member: jsEquals:calls=[Expect_equals(3),Expect_equals(3),get$isNegative(1),get$isNegative(1),toString$0(1),toString$0(1)],params=3*/
|
||||
void jsEquals(expected, actual, [String reason = null]) {
|
||||
void jsEquals(expected, actual, [String reason = ""]) {
|
||||
if (expected is num && actual is num) {
|
||||
if (expected.isNaN && actual.isNaN) return;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
class Class {
|
||||
/*member: Class.constructor1:params=0*/
|
||||
@pragma('dart2js:noInline')
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:calls=*,params=0*/
|
||||
main() {
|
||||
method1(new Class1a());
|
||||
|
@ -17,7 +15,7 @@ main() {
|
|||
class Class1a {
|
||||
/*member: Class1a.field1:emitted*/
|
||||
@pragma('dart2js:noElision')
|
||||
int field1;
|
||||
int? field1;
|
||||
}
|
||||
|
||||
/*member: method1:access=[field1],params=1*/
|
||||
|
@ -29,7 +27,7 @@ method1(dynamic c) {
|
|||
class Class2a<T> {
|
||||
/*member: Class2a.field2:emitted*/
|
||||
@pragma('dart2js:noElision')
|
||||
T field2;
|
||||
T? field2;
|
||||
}
|
||||
|
||||
/*member: method2:access=[field2],params=1*/
|
||||
|
@ -41,13 +39,13 @@ method2(dynamic c) {
|
|||
class Class3a {
|
||||
/*member: Class3a.field3:emitted,get=simple*/
|
||||
@pragma('dart2js:noElision')
|
||||
int field3;
|
||||
int? field3;
|
||||
}
|
||||
|
||||
class Class3b {
|
||||
/*member: Class3b.field3:emitted,get=simple*/
|
||||
@pragma('dart2js:noElision')
|
||||
int field3;
|
||||
int? field3;
|
||||
}
|
||||
|
||||
/*member: method3:calls=[get$field3(0)],params=1*/
|
||||
|
@ -59,14 +57,14 @@ method3(dynamic c) {
|
|||
class Class4a {
|
||||
/*member: Class4a.field4:emitted,get=simple*/
|
||||
@pragma('dart2js:noElision')
|
||||
int field4;
|
||||
int? field4;
|
||||
}
|
||||
|
||||
class Class4b implements Class4a {
|
||||
/*member: Class4b.field4:emitted,get=simple*/
|
||||
@pragma('dart2js:noElision')
|
||||
@override
|
||||
int field4;
|
||||
int? field4;
|
||||
}
|
||||
|
||||
/*member: method4:calls=[get$field4(0)],params=1*/
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:calls=*,params=0*/
|
||||
main() {
|
||||
method1(new Class1a()..field1);
|
||||
|
@ -16,7 +14,7 @@ main() {
|
|||
|
||||
class Class1a {
|
||||
/*member: Class1a.field1:emitted*/
|
||||
int field1;
|
||||
int? field1;
|
||||
}
|
||||
|
||||
/*member: method1:assign=[field1],params=1*/
|
||||
|
@ -31,7 +29,7 @@ class Class2a<T> {
|
|||
emitted
|
||||
*/
|
||||
/*prod.member: Class2a.field2:emitted*/
|
||||
T field2;
|
||||
T? field2;
|
||||
}
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
|
@ -56,7 +54,7 @@ class Class3a {
|
|||
emitted,
|
||||
set=simple
|
||||
*/
|
||||
int field3;
|
||||
int? field3;
|
||||
}
|
||||
|
||||
class Class3b {
|
||||
|
@ -68,7 +66,7 @@ class Class3b {
|
|||
emitted,
|
||||
set=simple
|
||||
*/
|
||||
int field3;
|
||||
int? field3;
|
||||
}
|
||||
|
||||
/*member: method3:calls=[set$field3(1)],params=1*/
|
||||
|
@ -86,7 +84,7 @@ class Class4a {
|
|||
emitted,
|
||||
set=simple
|
||||
*/
|
||||
int field4;
|
||||
int? field4;
|
||||
}
|
||||
|
||||
class Class4b implements Class4a {
|
||||
|
@ -99,7 +97,7 @@ class Class4b implements Class4a {
|
|||
emitted,
|
||||
set=simple
|
||||
*/
|
||||
int field4;
|
||||
int? field4;
|
||||
}
|
||||
|
||||
/*member: method4:calls=[set$field4(1)],params=1*/
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:calls=*,params=0*/
|
||||
main() {
|
||||
method1(new Class1a());
|
||||
|
@ -16,7 +14,7 @@ main() {
|
|||
|
||||
class Class1a {
|
||||
/*member: Class1a.field1:elided*/
|
||||
int field1;
|
||||
int? field1;
|
||||
}
|
||||
|
||||
/*member: method1:params=1*/
|
||||
|
@ -31,7 +29,7 @@ class Class2a<T> {
|
|||
elided
|
||||
*/
|
||||
/*prod.member: Class2a.field2:elided*/
|
||||
T field2;
|
||||
T? field2;
|
||||
}
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
|
@ -53,7 +51,7 @@ class Class3a {
|
|||
elided,
|
||||
set=simple
|
||||
*/
|
||||
int field3;
|
||||
int? field3;
|
||||
}
|
||||
|
||||
class Class3b {
|
||||
|
@ -65,7 +63,7 @@ class Class3b {
|
|||
elided,
|
||||
set=simple
|
||||
*/
|
||||
int field3;
|
||||
int? field3;
|
||||
}
|
||||
|
||||
/*member: method3:calls=[set$field3(1)],params=1*/
|
||||
|
@ -83,7 +81,7 @@ class Class4a {
|
|||
elided,
|
||||
set=simple
|
||||
*/
|
||||
int field4;
|
||||
int? field4;
|
||||
}
|
||||
|
||||
class Class4b implements Class4a {
|
||||
|
@ -96,7 +94,7 @@ class Class4b implements Class4a {
|
|||
elided,
|
||||
set=simple
|
||||
*/
|
||||
int field4;
|
||||
int? field4;
|
||||
}
|
||||
|
||||
/*member: method4:calls=[set$field4(1)],params=1*/
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
/*member: _field4:params=0*/
|
||||
|
@ -65,14 +63,14 @@ class Class4 extends Class1 {
|
|||
|
||||
/*member: method6:access=[toString],params=1*/
|
||||
@pragma('dart2js:noInline')
|
||||
method6(Class1 c) {
|
||||
return c.field1;
|
||||
method6(Class1? c) {
|
||||
return c!.field1;
|
||||
}
|
||||
|
||||
/*member: method7:access=[toString],calls=[_field4(0)],params=1*/
|
||||
@pragma('dart2js:noInline')
|
||||
method7(Class1 c) {
|
||||
return c.field4();
|
||||
method7(Class1? c) {
|
||||
return c!.field4();
|
||||
}
|
||||
|
||||
var field8;
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
enum Enum {
|
||||
a,
|
||||
b,
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:access=*,calls=*,params=0*/
|
||||
main() {
|
||||
method1(new Class1a());
|
||||
|
@ -27,7 +25,7 @@ main() {
|
|||
class Class1a {
|
||||
/*member: Class1a.field1:emitted*/
|
||||
@pragma('dart2js:noElision')
|
||||
int field1;
|
||||
int? field1;
|
||||
}
|
||||
|
||||
/*member: method1:assign=[field1],params=1*/
|
||||
|
@ -66,7 +64,7 @@ method3(Class3a a) => a.field3 = 42;
|
|||
|
||||
class Class5a {
|
||||
/*member: Class5a.field5:elided*/
|
||||
int field5;
|
||||
int? field5;
|
||||
}
|
||||
|
||||
/*member: method5:params=1*/
|
||||
|
@ -90,7 +88,7 @@ method6(Class6a c) {
|
|||
|
||||
/*member: field7:emitted*/
|
||||
@pragma('dart2js:noElision')
|
||||
int field7;
|
||||
int? field7;
|
||||
|
||||
/*member: method7:assign=[field7],params=0*/
|
||||
@pragma('dart2js:noInline')
|
||||
|
@ -98,7 +96,7 @@ method7() {
|
|||
field7 = 42;
|
||||
}
|
||||
|
||||
int field8;
|
||||
int? field8;
|
||||
|
||||
/*member: method8:params=0*/
|
||||
@pragma('dart2js:noInline')
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
var field1a;
|
||||
|
||||
var field1b;
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
class Class {
|
||||
/*member: Class.method1:params=0*/
|
||||
@pragma('dart2js:noInline')
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
// ignore: import_internal_library
|
||||
import 'dart:_js_helper';
|
||||
|
||||
|
@ -14,9 +12,9 @@ class Class {
|
|||
}
|
||||
|
||||
@pragma('dart2js:noElision')
|
||||
int field1;
|
||||
int? field1;
|
||||
|
||||
int field2;
|
||||
int? field2;
|
||||
|
||||
/*member: Class.method1:
|
||||
calls=[method1(a,b,c)],
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
// ignore: import_internal_library
|
||||
import 'dart:_js_helper';
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
// ignore: import_internal_library
|
||||
import 'dart:_js_helper';
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
typedef int BinaryFunc(int x, int y);
|
||||
|
||||
class A {
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: method1:params=0*/
|
||||
@pragma('dart2js:noInline')
|
||||
method1() {}
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
class I1 {}
|
||||
|
||||
class I2 {}
|
||||
|
|
|
@ -56,7 +56,7 @@ foo(param) {
|
|||
|
||||
const String REM3 = r"""
|
||||
foo(param) {
|
||||
var a = param ? 123 : null;
|
||||
dynamic a = param ? 123 : null;
|
||||
return 100.remainder(a);
|
||||
// No specialization for possibly null inputs.
|
||||
// present: 'remainder'
|
||||
|
|
|
@ -12,7 +12,7 @@ import '../helpers/compiler_helper.dart';
|
|||
// TODO(sra): Add tests with non-nullable input types.
|
||||
|
||||
const TEST1N = r"""
|
||||
foo(int a) {
|
||||
foo(int? a) {
|
||||
return a is double;
|
||||
// absent: 'return true'
|
||||
// absent: 'return false'
|
||||
|
@ -20,7 +20,7 @@ foo(int a) {
|
|||
""";
|
||||
|
||||
const TEST2N = r"""
|
||||
foo(int a) {
|
||||
foo(int? a) {
|
||||
return a is num;
|
||||
// absent: 'return true'
|
||||
// absent: 'return false'
|
||||
|
@ -28,7 +28,7 @@ foo(int a) {
|
|||
""";
|
||||
|
||||
const TEST3N = r"""
|
||||
foo(double a) {
|
||||
foo(double? a) {
|
||||
return a is int;
|
||||
// absent: 'return true'
|
||||
// absent: 'return false'
|
||||
|
@ -36,7 +36,7 @@ foo(double a) {
|
|||
""";
|
||||
|
||||
const TEST4N = r"""
|
||||
foo(double a) {
|
||||
foo(double? a) {
|
||||
return a is num;
|
||||
// absent: 'return true'
|
||||
// absent: 'return false'
|
||||
|
@ -44,7 +44,7 @@ foo(double a) {
|
|||
""";
|
||||
|
||||
const TEST5N = r"""
|
||||
foo(num a) {
|
||||
foo(num? a) {
|
||||
return a is int;
|
||||
// absent: 'return true'
|
||||
// absent: 'return false'
|
||||
|
@ -52,7 +52,7 @@ foo(num a) {
|
|||
""";
|
||||
|
||||
const TEST6N = r"""
|
||||
foo(num a) {
|
||||
foo(num? a) {
|
||||
return a is double;
|
||||
// absent: 'return true'
|
||||
// absent: 'return false'
|
||||
|
|
|
@ -62,7 +62,7 @@ foo(param1, param2, param3) {
|
|||
""";
|
||||
|
||||
const String PARAMETER_INIT = r"""
|
||||
int foo(var start, var test) {
|
||||
void foo(var start, var test) {
|
||||
var result = start;
|
||||
if (test) {
|
||||
foo(1, 2);
|
||||
|
|
|
@ -130,7 +130,6 @@ main() {
|
|||
entry: 'main',
|
||||
methodName: 'foo',
|
||||
disableTypeInference: false,
|
||||
soundNullSafety: true,
|
||||
check: checkerForAbsentPresent(test));
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class A {
|
|||
// Make the source size and AST size bigger so that it is not analyzed
|
||||
// first.
|
||||
1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+11+1+1+1+11+1+1+11+1+1;
|
||||
return this.foo == other.foo;
|
||||
return this.foo == (other as A).foo;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,14 +33,14 @@ class B extends A {
|
|||
B(int foo, this.bar) : super(foo);
|
||||
int bar;
|
||||
operator==(other) {
|
||||
if (other.bar != bar) return false;
|
||||
if ((other as B).bar != bar) return false;
|
||||
return other.foo == foo;
|
||||
}
|
||||
}
|
||||
|
||||
main() {
|
||||
var a = A(inscrutable(0) == 0 ? 42 : "fish");
|
||||
var b = B(0, inscrutable(0) == 0 ? 2 : "horse");
|
||||
var a = A(inscrutable(0) == 0 ? 42 : "fish" as dynamic);
|
||||
var b = B(0, inscrutable(0) == 0 ? 2 : "horse" as dynamic);
|
||||
var c = inscrutable(0) == 0 ? a : "kurt";
|
||||
var d = inscrutable(0) == 0 ? b : "gert";
|
||||
if (c == d) {
|
||||
|
|
|
@ -25,13 +25,13 @@ foo(d) {
|
|||
""";
|
||||
|
||||
const String TEST_THREE = r"""
|
||||
foo(int a, int b) {
|
||||
foo(a, b) {
|
||||
return 0 + a + b;
|
||||
}
|
||||
""";
|
||||
|
||||
const String TEST_THREE_WITH_BAILOUT = r"""
|
||||
foo(int a, int b) {
|
||||
foo(a, b) {
|
||||
var t;
|
||||
for (int i = 0; i < 1; i++) {
|
||||
t = 0 + a + b;
|
||||
|
|
|
@ -8,7 +8,7 @@ import '../helpers/compiler_helper.dart';
|
|||
const String TEST_ONE = r"""
|
||||
sum(param0, param1) {
|
||||
var sum = 0;
|
||||
for (var i = param0; i < param1; i += 1) sum = sum + i;
|
||||
for (var i = param0; i < param1; i += 1) sum = sum + i as int;
|
||||
return sum;
|
||||
}
|
||||
""";
|
||||
|
|
|
@ -9,7 +9,7 @@ import '../helpers/compiler_helper.dart';
|
|||
const String TEST_ONE = r"""
|
||||
sum(param0, param1) {
|
||||
var sum = 0;
|
||||
for (var i = param0; i < param1; i += 1) sum = sum + i;
|
||||
for (var i = param0; i < param1; i += 1) sum = sum + i as int;
|
||||
return sum;
|
||||
}
|
||||
""";
|
||||
|
|
|
@ -17,7 +17,9 @@ const int BELOW_ZERO_CHECK = 6;
|
|||
|
||||
final List TESTS = [
|
||||
"""
|
||||
main(bool check) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(check) {
|
||||
check as bool;
|
||||
var a = check ? [1] : [1, 2];
|
||||
var sum = 0;
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
|
@ -28,7 +30,9 @@ main(bool check) {
|
|||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(int value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value as int;
|
||||
var a = [1, 2];
|
||||
var sum = 0;
|
||||
for (int i = 0; i < value; i++) {
|
||||
|
@ -39,7 +43,9 @@ main(int value) {
|
|||
""",
|
||||
ABOVE_ZERO,
|
||||
"""
|
||||
main(bool check) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(check) {
|
||||
check as bool;
|
||||
// Make sure value is an int.
|
||||
var value = check ? 42 : 54;
|
||||
var a = List.filled(value, 1);
|
||||
|
@ -52,77 +58,90 @@ main(bool check) {
|
|||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main() {
|
||||
test() {
|
||||
var a = [];
|
||||
return a[0];
|
||||
}
|
||||
""",
|
||||
KEPT,
|
||||
"""
|
||||
main() {
|
||||
test() {
|
||||
var a = [];
|
||||
return a.removeLast();
|
||||
}
|
||||
""",
|
||||
KEPT,
|
||||
"""
|
||||
main() {
|
||||
test() {
|
||||
var a = List.filled(4, null);
|
||||
return a[0];
|
||||
}
|
||||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main() {
|
||||
test() {
|
||||
var a = List.filled(4, null);
|
||||
return a.removeLast();
|
||||
}
|
||||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(int value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value as int;
|
||||
var a = List.filled(value, null);
|
||||
return a[value];
|
||||
}
|
||||
""",
|
||||
KEPT,
|
||||
"""
|
||||
main(int value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value as int;
|
||||
var a = List.filled(1024, null);
|
||||
return a[1023 & value];
|
||||
}
|
||||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(int value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value as int;
|
||||
var a = List.filled(1024, null);
|
||||
return a[1024 & value];
|
||||
}
|
||||
""",
|
||||
ABOVE_ZERO,
|
||||
"""
|
||||
main() {
|
||||
test() {
|
||||
var a = [];
|
||||
return a[1];
|
||||
}
|
||||
""",
|
||||
ABOVE_ZERO,
|
||||
"""
|
||||
main(int value, int Function() call) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value, call) {
|
||||
value as int;
|
||||
call as int Function();
|
||||
var a = [];
|
||||
return a[value] + call() + a[value];
|
||||
}
|
||||
""",
|
||||
ONE_ZERO_CHECK,
|
||||
"""
|
||||
main(bool value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value as bool;
|
||||
var a = value ? [1, 2, 3] : [];
|
||||
return a[1] + a[0];
|
||||
}
|
||||
""",
|
||||
ONE_CHECK,
|
||||
"""
|
||||
main(int n) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(n) {
|
||||
n as int;
|
||||
var a = List.filled(n, 1);
|
||||
var sum = 0;
|
||||
for (int i = 0; i <= a.length - 1; i++) {
|
||||
|
@ -133,7 +152,9 @@ main(int n) {
|
|||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(int n) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(n) {
|
||||
n as int;
|
||||
var a = List.filled(n, 1);
|
||||
var sum = 0;
|
||||
for (int i = a.length - 1; i >= 0; i--) {
|
||||
|
@ -144,7 +165,8 @@ main(int n) {
|
|||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(dynamic value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(dynamic value) {
|
||||
value = value is int ? value as int : 42;
|
||||
int sum = ~value;
|
||||
for (int i = 0; i < 42; i++) sum += (value & 4);
|
||||
|
@ -156,7 +178,8 @@ main(dynamic value) {
|
|||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value = value is int ? value as int : 42;
|
||||
int sum = ~value;
|
||||
for (int i = 0; i < 42; i++) sum += (value & 4);
|
||||
|
@ -170,7 +193,8 @@ main(value) {
|
|||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value = value is int ? value as int : 42;
|
||||
int sum = ~value;
|
||||
for (int i = 0; i < 42; i++) sum += (value & 4);
|
||||
|
@ -182,7 +206,9 @@ main(value) {
|
|||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(int value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value as int;
|
||||
var a = List.filled(value, 1);
|
||||
var sum = 0;
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
|
@ -194,9 +220,11 @@ main(int value) {
|
|||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(int value) {
|
||||
var a = List.filled(value, null);
|
||||
var sum = 0;
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value as int;
|
||||
var a = List<dynamic>.filled(value, null);
|
||||
num sum = 0;
|
||||
for (int i = a.length - 1; i >= 0; i--) {
|
||||
sum += a[i];
|
||||
if (sum == 0) i--;
|
||||
|
@ -206,7 +234,9 @@ main(int value) {
|
|||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(int value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value as int;
|
||||
var a = List.filled(6, value);
|
||||
var sum = 0;
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
|
@ -218,7 +248,9 @@ main(int value) {
|
|||
""",
|
||||
REMOVED,
|
||||
"""
|
||||
main(int value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value as int;
|
||||
var a = List.filled(7, value);
|
||||
var sum = 0;
|
||||
for (int i = 0; i < a.length;) {
|
||||
|
@ -230,7 +262,9 @@ main(int value) {
|
|||
""",
|
||||
BELOW_ZERO_CHECK,
|
||||
"""
|
||||
main(int value) {
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
test(value) {
|
||||
value as int;
|
||||
var a = List.filled(7, value);
|
||||
var sum = 0;
|
||||
for (int i = -2; i < a.length; i = 0) {
|
||||
|
@ -243,7 +277,8 @@ main(int value) {
|
|||
];
|
||||
|
||||
Future expect(String code, int kind) {
|
||||
return compile(code, disableTypeInference: false, check: (String generated) {
|
||||
return compile(code, entry: 'test', disableTypeInference: false,
|
||||
check: (String generated) {
|
||||
switch (kind) {
|
||||
case REMOVED:
|
||||
Expect.isFalse(generated.contains('ioore'));
|
||||
|
|
|
@ -115,8 +115,7 @@ main() {
|
|||
return compile(test,
|
||||
entry: 'foo',
|
||||
check: checkerForAbsentPresent(test),
|
||||
enableVariance: true,
|
||||
soundNullSafety: true);
|
||||
enableVariance: true);
|
||||
}
|
||||
|
||||
await check(LEGACY_COV_CAST);
|
||||
|
|
|
@ -84,7 +84,7 @@ class A2 extends A {
|
|||
A2();
|
||||
}
|
||||
|
||||
class C1 {}
|
||||
mixin C1 {}
|
||||
|
||||
class C2 {
|
||||
C2() {
|
||||
|
@ -102,7 +102,7 @@ class C3 extends C2 with C1 {
|
|||
// Implicit redirecting "super" call via mixin.
|
||||
}
|
||||
|
||||
class D1 {
|
||||
mixin D1 {
|
||||
}
|
||||
|
||||
class D2 {
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import 'lib_000_01.dart' deferred as b1;
|
||||
|
||||
/*member: entryLib1:member_unit=main{}*/
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import 'lib_000_10.dart' deferred as b2;
|
||||
|
||||
/*member: entryLib2:member_unit=main{}*/
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import 'lib_001_00.dart' deferred as b3;
|
||||
|
||||
/*member: entryLib3:member_unit=main{}*/
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import 'lib_010_00.dart' deferred as b4;
|
||||
|
||||
/*member: entryLib4:member_unit=main{}*/
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import 'lib_100_00.dart' deferred as b5;
|
||||
|
||||
/*member: entryLib5:member_unit=main{}*/
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
/*member: v:member_unit=2{b1, b2, b3, b4, b5}*/
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
import 'libB.dart';
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
import 'libB.dart';
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
import 'libB.dart';
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
import 'libB.dart';
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
import 'libB.dart';
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
/*spec.library:
|
||||
a_pre_fragments=[
|
||||
p10: {units: [18{b2, b3}], usedBy: [], needs: []},
|
||||
|
@ -79,19 +77,21 @@
|
|||
|
||||
/*three-frag.library:
|
||||
a_pre_fragments=[
|
||||
p1: {units: [26{b3, b4}, 21{b2, b5}, 19{b2, b4}, 18{b2, b3}, 10{b1, b5}, 6{b1, b4}, 4{b1, b3}, 3{b1, b2}, 31{b5}, 29{b4}, 25{b3}, 17{b2}, 1{b1}], usedBy: [p2], needs: []},
|
||||
p2: {units: [9{b1, b2, b3, b4}, 28{b3, b4, b5}, 23{b2, b4, b5}, 22{b2, b3, b5}, 20{b2, b3, b4}, 14{b1, b4, b5}, 12{b1, b3, b5}, 8{b1, b3, b4}, 11{b1, b2, b5}, 7{b1, b2, b4}, 5{b1, b2, b3}, 30{b4, b5}, 27{b3, b5}], usedBy: [p3], needs: [p1]},
|
||||
p3: {units: [2{b1, b2, b3, b4, b5}, 24{b2, b3, b4, b5}, 16{b1, b3, b4, b5}, 15{b1, b2, b4, b5}, 13{b1, b2, b3, b5}], usedBy: [], needs: [p2]}],
|
||||
p1: {units: [21{b2, b5}, 19{b2, b4}, 18{b2, b3}, 10{b1, b5}, 6{b1, b4}, 4{b1, b3}, 3{b1, b2}, 31{b5}, 29{b4}, 25{b3}, 17{b2}, 1{b1}], usedBy: [p2], needs: []},
|
||||
p2: {units: [23{b2, b4, b5}, 22{b2, b3, b5}, 20{b2, b3, b4}, 14{b1, b4, b5}, 12{b1, b3, b5}, 8{b1, b3, b4}, 11{b1, b2, b5}, 7{b1, b2, b4}, 5{b1, b2, b3}, 30{b4, b5}, 27{b3, b5}, 26{b3, b4}], usedBy: [p3], needs: [p1]},
|
||||
p3: {units: [24{b2, b3, b4, b5}, 16{b1, b3, b4, b5}, 15{b1, b2, b4, b5}, 13{b1, b2, b3, b5}, 9{b1, b2, b3, b4}, 28{b3, b4, b5}], usedBy: [p4], needs: [p2]},
|
||||
p4: {units: [2{b1, b2, b3, b4, b5}], usedBy: [], needs: [p3]}],
|
||||
b_finalized_fragments=[
|
||||
f1: [26{b3, b4}, 21{b2, b5}, 19{b2, b4}, 18{b2, b3}, 10{b1, b5}, 6{b1, b4}, 4{b1, b3}, 3{b1, b2}, 31{b5}, 29{b4}, 25{b3}, 17{b2}, 1{b1}],
|
||||
f2: [9{b1, b2, b3, b4}, 28{b3, b4, b5}, 23{b2, b4, b5}, 22{b2, b3, b5}, 20{b2, b3, b4}, 14{b1, b4, b5}, 12{b1, b3, b5}, 8{b1, b3, b4}, 11{b1, b2, b5}, 7{b1, b2, b4}, 5{b1, b2, b3}, 30{b4, b5}, 27{b3, b5}],
|
||||
f3: [2{b1, b2, b3, b4, b5}, 24{b2, b3, b4, b5}, 16{b1, b3, b4, b5}, 15{b1, b2, b4, b5}, 13{b1, b2, b3, b5}]],
|
||||
f1: [21{b2, b5}, 19{b2, b4}, 18{b2, b3}, 10{b1, b5}, 6{b1, b4}, 4{b1, b3}, 3{b1, b2}, 31{b5}, 29{b4}, 25{b3}, 17{b2}, 1{b1}],
|
||||
f2: [23{b2, b4, b5}, 22{b2, b3, b5}, 20{b2, b3, b4}, 14{b1, b4, b5}, 12{b1, b3, b5}, 8{b1, b3, b4}, 11{b1, b2, b5}, 7{b1, b2, b4}, 5{b1, b2, b3}, 30{b4, b5}, 27{b3, b5}, 26{b3, b4}],
|
||||
f3: [24{b2, b3, b4, b5}, 16{b1, b3, b4, b5}, 15{b1, b2, b4, b5}, 13{b1, b2, b3, b5}, 9{b1, b2, b3, b4}, 28{b3, b4, b5}],
|
||||
f4: [2{b1, b2, b3, b4, b5}]],
|
||||
c_steps=[
|
||||
b1=(f3, f2, f1),
|
||||
b2=(f3, f2, f1),
|
||||
b3=(f3, f2, f1),
|
||||
b4=(f3, f2, f1),
|
||||
b5=(f3, f2, f1)]
|
||||
b1=(f4, f3, f2, f1),
|
||||
b2=(f4, f3, f2, f1),
|
||||
b3=(f4, f3, f2, f1),
|
||||
b4=(f4, f3, f2, f1),
|
||||
b5=(f4, f3, f2, f1)]
|
||||
*/
|
||||
|
||||
/*two-frag.library:
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
/*class: A:
|
||||
class_unit=1{libb},
|
||||
type_unit=2{liba, libb}
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import 'lib_shared.dart';
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
import 'lib_shared.dart';
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.10
|
||||
|
||||
/*spec.library:
|
||||
a_pre_fragments=[
|
||||
p1: {units: [3{liba}], usedBy: [], needs: []},
|
||||
|
|
|
@ -44,12 +44,10 @@ Future<void> runTest(String testGroup, List<String> options,
|
|||
options: [
|
||||
'--stage=cfe',
|
||||
'--out=$cfeFilename',
|
||||
'${Flags.noSoundNullSafety}',
|
||||
...options,
|
||||
],
|
||||
outputProvider: cfeCollector,
|
||||
beforeRun: (c) => compiler = c,
|
||||
unsafeToTouchSourceFiles: true);
|
||||
beforeRun: (c) => compiler = c);
|
||||
final cfeDill = cfeCollector.binaryOutputMap.values.first.list;
|
||||
final dillInputFiles = {cfeFilename: cfeDill};
|
||||
final resultCollector = OutputCollector();
|
||||
|
@ -59,7 +57,6 @@ Future<void> runTest(String testGroup, List<String> options,
|
|||
options: [
|
||||
'${Flags.deferredLoadIdMapUri}=$resultFilename',
|
||||
'--input-dill=memory:$cfeFilename',
|
||||
'${Flags.noSoundNullSafety}',
|
||||
...options,
|
||||
],
|
||||
beforeRun: (c) => compiler = c);
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
"canonicalUri": "memory:sdk/tests/web/native/lib.dart"
|
||||
}]*/
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: defaultArg:function=[{
|
||||
"id": "function/memory:sdk/tests/web/native/lib.dart::defaultArg",
|
||||
"kind": "function",
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*library:
|
||||
constant=[
|
||||
{
|
||||
|
@ -107,7 +105,7 @@
|
|||
"id": "outputUnit/1",
|
||||
"kind": "outputUnit",
|
||||
"name": "1",
|
||||
"size": 1206,
|
||||
"size": 1204,
|
||||
"filename": "out_1.part.js",
|
||||
"imports": [
|
||||
"lib"
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
"canonicalUri": "memory:sdk/tests/web/native/lib1.dart"
|
||||
}]*/
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
import 'lib2.dart';
|
||||
|
||||
const dynamic field = const A();
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
"canonicalUri": "memory:sdk/tests/web/native/lib2.dart"
|
||||
}]*/
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*class: A:class=[{
|
||||
"id": "class/memory:sdk/tests/web/native/lib2.dart::A",
|
||||
"kind": "class",
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
"id": "outputUnit/1",
|
||||
"kind": "outputUnit",
|
||||
"name": "1",
|
||||
"size": 930,
|
||||
"size": 928,
|
||||
"filename": "out_1.part.js",
|
||||
"imports": [
|
||||
"lib1"
|
||||
|
@ -128,8 +128,6 @@
|
|||
}]
|
||||
*/
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
import 'dart:async';
|
||||
import 'lib1.dart' deferred as lib1;
|
||||
import 'lib2.dart' as lib2;
|
||||
|
|
|
@ -8,7 +8,6 @@ import 'package:expect/expect.dart';
|
|||
import 'package:front_end/src/fasta/messages.dart'
|
||||
show templateCantReadFile, messageMissingMain;
|
||||
import 'package:compiler/compiler_api.dart' as api;
|
||||
import 'package:compiler/src/commandline_options.dart';
|
||||
import 'package:compiler/src/util/memory_compiler.dart';
|
||||
|
||||
final EXCEPTION = 'Crash-marker';
|
||||
|
@ -72,8 +71,7 @@ Future<RunResult> run(
|
|||
await runCompiler(
|
||||
entryPoint: entryPoint,
|
||||
memorySourceFiles: memorySourceFiles,
|
||||
diagnosticHandler: diagnostics,
|
||||
options: [Flags.soundNullSafety]);
|
||||
diagnosticHandler: diagnostics);
|
||||
} catch (e) {
|
||||
result.exceptions.add(e);
|
||||
}
|
||||
|
|
|
@ -153,8 +153,7 @@ Future<CompiledData<T>?> computeData<T>(String name, Uri entryPoint,
|
|||
compiler.stopAfterGlobalTypeInferenceForTesting =
|
||||
options.contains(stopAfterTypeInference);
|
||||
},
|
||||
packageConfig: packageConfig,
|
||||
unsafeToTouchSourceFiles: true);
|
||||
packageConfig: packageConfig);
|
||||
if (!result.isSuccess) {
|
||||
if (skipFailedCompilations) return null;
|
||||
Expect.isTrue(
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:compiler/src/commandline_options.dart';
|
||||
import 'package:compiler/src/elements/entities.dart';
|
||||
import 'package:compiler/src/elements/types.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
|
@ -62,15 +61,15 @@ main() {
|
|||
F10() {
|
||||
void local<A extends B, B>(A a, B b) {}
|
||||
}
|
||||
void F11<Q extends C3<Q>>(Q q) {}
|
||||
void F12<P extends C3<P>>(P p) {}
|
||||
void F11<Q extends C3<Q>?>(Q q) {}
|
||||
void F12<P extends C3<P>?>(P p) {}
|
||||
class C5<T> {
|
||||
Map<T,A> F15<A extends B, B extends T>(A a, B b) => null;
|
||||
Map<T,A> F16<A extends T, B extends A>(A a, B b) => null;
|
||||
T F17<A extends List<B>, B extends Map<T,A>>(A a, B b, T t) => null;
|
||||
T F18<P extends T>(
|
||||
[Q Function<Q extends P>(P, Q, T) f1,
|
||||
X Function<X extends P>(P, X, T) f2]) => null;
|
||||
Map<T,A>? F15<A extends B, B extends T>(A a, B b) => null;
|
||||
Map<T,A>? F16<A extends T, B extends A>(A a, B b) => null;
|
||||
T? F17<A extends List<B>?, B extends Map<T,A>?>(A a, B b, T? t) => null;
|
||||
T? F18<P extends T>(
|
||||
[Q Function<Q extends P>(P, Q, T)? f1,
|
||||
X Function<X extends P>(P, X, T)? f2]) => null;
|
||||
}
|
||||
|
||||
main() {
|
||||
|
@ -90,8 +89,7 @@ main() {
|
|||
C5<num>().F17(null, null, null);
|
||||
C5<num>().F18();
|
||||
}
|
||||
"""),
|
||||
options: [Flags.noSoundNullSafety, Flags.printLegacyStars]);
|
||||
"""));
|
||||
|
||||
var types = env.types;
|
||||
|
||||
|
@ -104,9 +102,7 @@ main() {
|
|||
Expect.equals(expectedBounds.length, functionType.typeVariables.length,
|
||||
"Unexpected type variable count in ${env.printType(type)}.");
|
||||
for (int i = 0; i < expectedBounds.length; i++) {
|
||||
Expect.equals(
|
||||
env.legacyWrap(expectedBounds[i]),
|
||||
functionType.typeVariables[i].bound,
|
||||
Expect.equals(expectedBounds[i], functionType.typeVariables[i].bound,
|
||||
"Unexpected ${i}th bound in ${env.printType(type)}.");
|
||||
}
|
||||
}
|
||||
|
@ -154,6 +150,7 @@ main() {
|
|||
}
|
||||
|
||||
final Object_ = env['Object'] as InterfaceType;
|
||||
final nullableObject = types.nullableType(Object_);
|
||||
final num_ = env['num'] as InterfaceType;
|
||||
final int_ = env['int'] as InterfaceType;
|
||||
final C1 = env.instantiate(env.getClass('C1'), []) as InterfaceType;
|
||||
|
@ -207,77 +204,77 @@ main() {
|
|||
all.forEach(print);
|
||||
|
||||
List<ToStringTestData> toStringExpected = [
|
||||
ToStringTestData(F1, 'void Function<#A>(#A*)*'),
|
||||
ToStringTestData(F2, 'void Function<#A>(#A*)*'),
|
||||
ToStringTestData(F3, 'void Function<#A,#B>(#A*,#B*)*'),
|
||||
ToStringTestData(F4, 'void Function<#A,#B>(#B*,#A*)*'),
|
||||
ToStringTestData(F5, 'void Function<#A extends num*>(#A*)*'),
|
||||
ToStringTestData(F6, 'void Function<#A extends int*>(#A*)*'),
|
||||
ToStringTestData(F7, 'void Function<#A extends num*>(#A*,[int*])*'),
|
||||
ToStringTestData(F8, '#A* Function<#A extends num*>(#A*)*'),
|
||||
ToStringTestData(F9, 'void Function<#A extends #B*,#B>(#A*,#B*)'),
|
||||
ToStringTestData(F10, 'void Function<#A extends #B*,#B>(#A*,#B*)'),
|
||||
ToStringTestData(F11, 'void Function<#A extends C3<#A*>*>(#A*)'),
|
||||
ToStringTestData(F12, 'void Function<#A extends C3<#A*>*>(#A*)'),
|
||||
ToStringTestData(F13, '#A* Function<#A>(#A*,#A*)*'),
|
||||
ToStringTestData(F14, '#A* Function<#A>(#A*,#A*)*'),
|
||||
ToStringTestData(F15,
|
||||
'Map<C5.T*,#A*>* Function<#A extends #B*,#B extends C5.T*>(#A*,#B*)'),
|
||||
ToStringTestData(F16,
|
||||
'Map<C5.T*,#A*>* Function<#A extends C5.T*,#B extends #A*>(#A*,#B*)'),
|
||||
ToStringTestData(F1, 'void Function<#A>(#A)'),
|
||||
ToStringTestData(F2, 'void Function<#A>(#A)'),
|
||||
ToStringTestData(F3, 'void Function<#A,#B>(#A,#B)'),
|
||||
ToStringTestData(F4, 'void Function<#A,#B>(#B,#A)'),
|
||||
ToStringTestData(F5, 'void Function<#A extends num>(#A)'),
|
||||
ToStringTestData(F6, 'void Function<#A extends int>(#A)'),
|
||||
ToStringTestData(F7, 'void Function<#A extends num>(#A,[int])'),
|
||||
ToStringTestData(F8, '#A Function<#A extends num>(#A)'),
|
||||
ToStringTestData(F9, 'void Function<#A extends #B,#B>(#A,#B)'),
|
||||
ToStringTestData(F10, 'void Function<#A extends #B,#B>(#A,#B)'),
|
||||
ToStringTestData(F11, 'void Function<#A extends C3<#A>?>(#A)'),
|
||||
ToStringTestData(F12, 'void Function<#A extends C3<#A>?>(#A)'),
|
||||
ToStringTestData(F13, '#A Function<#A>(#A,#A)'),
|
||||
ToStringTestData(F14, '#A Function<#A>(#A,#A)'),
|
||||
ToStringTestData(
|
||||
F15, 'Map<C5.T,#A>? Function<#A extends #B,#B extends C5.T>(#A,#B)'),
|
||||
ToStringTestData(
|
||||
F16, 'Map<C5.T,#A>? Function<#A extends C5.T,#B extends #A>(#A,#B)'),
|
||||
ToStringTestData(
|
||||
F17,
|
||||
'C5.T* Function<#A extends List<#B*>*,'
|
||||
'#B extends Map<C5.T*,#A*>*>(#A*,#B*,Object*)'),
|
||||
'C5.T? Function<#A extends List<#B>?,'
|
||||
'#B extends Map<C5.T,#A>?>(#A,#B,Object?)'),
|
||||
ToStringTestData(
|
||||
F18,
|
||||
'C5.T* Function<#A extends C5.T*>(['
|
||||
'#A2* Function<#A2 extends #A*>(#A*,#A2*,C5.T*)*,'
|
||||
'#A3* Function<#A3 extends #A*>(#A*,#A3*,C5.T*)*])'),
|
||||
'C5.T? Function<#A extends C5.T>(['
|
||||
'#A2 Function<#A2 extends #A>(#A,#A2,C5.T)?,'
|
||||
'#A3 Function<#A3 extends #A>(#A,#A3,C5.T)?])'),
|
||||
];
|
||||
|
||||
for (var test in toStringExpected) {
|
||||
testToString(test.type, test.expected);
|
||||
}
|
||||
|
||||
testBounds(F1, [Object_]);
|
||||
testBounds(F2, [Object_]);
|
||||
testBounds(F3, [Object_, Object_]);
|
||||
testBounds(F4, [Object_, Object_]);
|
||||
testBounds(F1, [nullableObject]);
|
||||
testBounds(F2, [nullableObject]);
|
||||
testBounds(F3, [nullableObject, nullableObject]);
|
||||
testBounds(F4, [nullableObject, nullableObject]);
|
||||
testBounds(F5, [num_]);
|
||||
testBounds(F6, [int_]);
|
||||
testBounds(F7, [num_]);
|
||||
testBounds(F8, [num_]);
|
||||
testBounds(F9, [F9.typeVariables.last, Object_]);
|
||||
testBounds(F10, [F10.typeVariables.last, Object_]);
|
||||
testBounds(F9, [F9.typeVariables.last, nullableObject]);
|
||||
testBounds(F10, [F10.typeVariables.last, nullableObject]);
|
||||
testBounds(F11, [
|
||||
env.instantiate(C3, [F11.typeVariables.last])
|
||||
types.nullableType(env.instantiate(C3, [F11.typeVariables.last]))
|
||||
]);
|
||||
testBounds(F12, [
|
||||
env.instantiate(C3, [F12.typeVariables.last])
|
||||
types.nullableType(env.instantiate(C3, [F12.typeVariables.last]))
|
||||
]);
|
||||
testBounds(F13, [Object_]);
|
||||
testBounds(F14, [Object_]);
|
||||
testBounds(F13, [nullableObject]);
|
||||
testBounds(F14, [nullableObject]);
|
||||
|
||||
List<InstantiateTestData> instantiateExpected = [
|
||||
InstantiateTestData(F1, [C1], 'void Function(C1*)'),
|
||||
InstantiateTestData(F2, [C2], 'void Function(C2*)'),
|
||||
InstantiateTestData(F3, [C1, C2], 'void Function(C1*,C2*)'),
|
||||
InstantiateTestData(F4, [C1, C2], 'void Function(C2*,C1*)'),
|
||||
InstantiateTestData(F5, [num_], 'void Function(num*)'),
|
||||
InstantiateTestData(F6, [int_], 'void Function(int*)'),
|
||||
InstantiateTestData(F7, [int_], 'void Function(int*,[int*])'),
|
||||
InstantiateTestData(F8, [int_], 'int* Function(int*)'),
|
||||
InstantiateTestData(F9, [int_, num_], 'void Function(int*,num*)'),
|
||||
InstantiateTestData(F10, [int_, num_], 'void Function(int*,num*)'),
|
||||
InstantiateTestData(F11, [C4], 'void Function(C4*)'),
|
||||
InstantiateTestData(F12, [C4], 'void Function(C4*)'),
|
||||
InstantiateTestData(F13, [C1], 'C1* Function(C1*,C1*)'),
|
||||
InstantiateTestData(F14, [C2], 'C2* Function(C2*,C2*)'),
|
||||
InstantiateTestData(F1, [C1], 'void Function(C1)'),
|
||||
InstantiateTestData(F2, [C2], 'void Function(C2)'),
|
||||
InstantiateTestData(F3, [C1, C2], 'void Function(C1,C2)'),
|
||||
InstantiateTestData(F4, [C1, C2], 'void Function(C2,C1)'),
|
||||
InstantiateTestData(F5, [num_], 'void Function(num)'),
|
||||
InstantiateTestData(F6, [int_], 'void Function(int)'),
|
||||
InstantiateTestData(F7, [int_], 'void Function(int,[int])'),
|
||||
InstantiateTestData(F8, [int_], 'int Function(int)'),
|
||||
InstantiateTestData(F9, [int_, num_], 'void Function(int,num)'),
|
||||
InstantiateTestData(F10, [int_, num_], 'void Function(int,num)'),
|
||||
InstantiateTestData(F11, [C4], 'void Function(C4)'),
|
||||
InstantiateTestData(F12, [C4], 'void Function(C4)'),
|
||||
InstantiateTestData(F13, [C1], 'C1 Function(C1,C1)'),
|
||||
InstantiateTestData(F14, [C2], 'C2 Function(C2,C2)'),
|
||||
InstantiateTestData(
|
||||
F15, [int_, num_], 'Map<C5.T*,int*>* Function(int*,num*)'),
|
||||
F15, [int_, num_], 'Map<C5.T,int>? Function(int,num)'),
|
||||
InstantiateTestData(
|
||||
F16, [num_, int_], 'Map<C5.T*,num*>* Function(num*,int*)'),
|
||||
F16, [num_, int_], 'Map<C5.T,num>? Function(num,int)'),
|
||||
];
|
||||
|
||||
for (var test in instantiateExpected) {
|
||||
|
@ -286,22 +283,22 @@ main() {
|
|||
|
||||
List<SubstTestData> substExpected = [
|
||||
SubstTestData([num_], [C5_T], F15,
|
||||
'Map<num*,#A*>* Function<#A extends #B*,#B extends num*>(#A*,#B*)'),
|
||||
'Map<num,#A>? Function<#A extends #B,#B extends num>(#A,#B)'),
|
||||
SubstTestData([num_], [C5_T], F16,
|
||||
'Map<num*,#A*>* Function<#A extends num*,#B extends #A*>(#A*,#B*)'),
|
||||
'Map<num,#A>? Function<#A extends num,#B extends #A>(#A,#B)'),
|
||||
SubstTestData(
|
||||
[num_],
|
||||
[C5_T],
|
||||
F17,
|
||||
'num* Function<#A extends List<#B*>*,'
|
||||
'#B extends Map<num*,#A*>*>(#A*,#B*,Object*)'),
|
||||
'num? Function<#A extends List<#B>?,'
|
||||
'#B extends Map<num,#A>?>(#A,#B,Object?)'),
|
||||
SubstTestData(
|
||||
[num_],
|
||||
[C5_T],
|
||||
F18,
|
||||
'num* Function<#A extends num*>(['
|
||||
'#A2* Function<#A2 extends #A*>(#A*,#A2*,num*)*,'
|
||||
'#A3* Function<#A3 extends #A*>(#A*,#A3*,num*)*])'),
|
||||
'num? Function<#A extends num>(['
|
||||
'#A2 Function<#A2 extends #A>(#A,#A2,num)?,'
|
||||
'#A3 Function<#A3 extends #A>(#A,#A3,num)?])'),
|
||||
];
|
||||
|
||||
for (var test in substExpected) {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:compiler/src/commandline_options.dart';
|
||||
import 'package:compiler/src/elements/entities.dart';
|
||||
import 'package:compiler/src/elements/types.dart';
|
||||
import 'package:compiler/src/universe/call_structure.dart';
|
||||
|
@ -30,7 +29,7 @@ main() {
|
|||
${createUses(signatures, prefix: 't')}
|
||||
${createUses(signatures, prefix: 'm')}
|
||||
}
|
||||
""", options: [Flags.noSoundNullSafety]);
|
||||
""");
|
||||
|
||||
for (FunctionTypeData data in signatures) {
|
||||
DartType functionType = env.getElementType('t${data.name}');
|
||||
|
|
|
@ -41,8 +41,7 @@ Future<String> compile(String code,
|
|||
bool omitImplicitChecks = true,
|
||||
bool enableVariance = false,
|
||||
void check(String generatedEntry)?,
|
||||
bool returnAll = false,
|
||||
bool soundNullSafety = false}) async {
|
||||
bool returnAll = false}) async {
|
||||
OutputCollector? outputCollector = returnAll ? OutputCollector() : null;
|
||||
List<String> options = <String>[];
|
||||
if (disableTypeInference) {
|
||||
|
@ -64,12 +63,6 @@ Future<String> compile(String code,
|
|||
options.add('${Flags.enableLanguageExperiments}=variance');
|
||||
}
|
||||
|
||||
if (soundNullSafety) {
|
||||
options.add(Flags.soundNullSafety);
|
||||
} else {
|
||||
options.add(Flags.noSoundNullSafety);
|
||||
}
|
||||
|
||||
Uri entryPoint = Uri.parse('memory:$_commonTestPath/main.dart');
|
||||
|
||||
Map<String, String> source;
|
||||
|
@ -105,7 +98,6 @@ Future<String> compile(String code,
|
|||
Future<String> compileAll(String code,
|
||||
{bool disableInlining = true,
|
||||
bool minify = false,
|
||||
bool soundNullSafety = false,
|
||||
int? expectedErrors,
|
||||
int? expectedWarnings}) async {
|
||||
OutputCollector outputCollector = OutputCollector();
|
||||
|
@ -117,11 +109,6 @@ Future<String> compileAll(String code,
|
|||
if (minify) {
|
||||
options.add(Flags.minify);
|
||||
}
|
||||
if (soundNullSafety) {
|
||||
options.add(Flags.soundNullSafety);
|
||||
} else {
|
||||
options.add(Flags.noSoundNullSafety);
|
||||
}
|
||||
|
||||
Uri entryPoint = Uri.parse('memory:$_commonTestPath/main.dart');
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ library dart2js.kernel.compiler_helper;
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:compiler/src/commandline_options.dart' show Flags;
|
||||
import 'package:compiler/src/common.dart';
|
||||
import 'package:compiler/src/dart2js.dart' as dart2js;
|
||||
import 'package:_fe_analyzer_shared/src/util/filenames.dart';
|
||||
|
@ -63,10 +62,6 @@ Future<CompilationResult> getCompilationResultsForD8(
|
|||
'-o${outputFile.toFilePath()}',
|
||||
if (Platform.packageConfig != null) '--packages=${Platform.packageConfig}',
|
||||
...options,
|
||||
if (options.contains(Flags.noSoundNullSafety))
|
||||
// Unsound platform dill files are no longer packaged in the SDK and must
|
||||
// be read from the build directory during tests.
|
||||
'--platform-binaries=$buildPlatformBinariesPath',
|
||||
];
|
||||
if (printSteps) print('Running: dart2js ${dart2jsArgs.join(' ')}');
|
||||
|
||||
|
|
|
@ -62,10 +62,6 @@ class TypeEnvironment {
|
|||
|
||||
TypeEnvironment._(Compiler this.compiler, {this.testBackendWorld = false});
|
||||
|
||||
DartType legacyWrap(DartType type) {
|
||||
return options.useLegacySubtyping ? types.legacyType(type) : type;
|
||||
}
|
||||
|
||||
ElementEnvironment get elementEnvironment {
|
||||
if (testBackendWorld) {
|
||||
return compiler.backendClosedWorldForTesting!.elementEnvironment;
|
||||
|
@ -130,6 +126,9 @@ class TypeEnvironment {
|
|||
if (name == 'void') {
|
||||
return types.voidType();
|
||||
}
|
||||
if (name == 'Never') {
|
||||
return types.neverType();
|
||||
}
|
||||
return getElementType(name);
|
||||
}
|
||||
|
||||
|
@ -202,7 +201,7 @@ class TypeEnvironment {
|
|||
types.map(printType).toList();
|
||||
|
||||
DartType instantiate(ClassEntity element, List<DartType> arguments) =>
|
||||
types.interfaceType(element, arguments.map(legacyWrap).toList());
|
||||
types.interfaceType(element, arguments);
|
||||
}
|
||||
|
||||
/// Data used to create a function type either as method declaration or a
|
||||
|
@ -221,13 +220,13 @@ class FunctionTypeData {
|
|||
/// Return source code that declares the function types in [dataList] as
|
||||
/// method declarations of the form:
|
||||
///
|
||||
/// $returnType $name$parameters => null;
|
||||
/// $returnType $name$parameters => throw "";
|
||||
String createMethods(List<FunctionTypeData> dataList,
|
||||
{String additionalData = '', String prefix = ''}) {
|
||||
StringBuffer sb = StringBuffer();
|
||||
for (FunctionTypeData data in dataList) {
|
||||
sb.writeln(
|
||||
'${data.returnType} $prefix${data.name}${data.parameters} => null;');
|
||||
'${data.returnType} $prefix${data.name}${data.parameters} => throw "";');
|
||||
}
|
||||
sb.write(additionalData);
|
||||
return sb.toString();
|
||||
|
@ -250,7 +249,7 @@ String createTypedefs(List<FunctionTypeData> dataList,
|
|||
}
|
||||
for (int index = 0; index < dataList.length; index++) {
|
||||
FunctionTypeData data = dataList[index];
|
||||
sb.writeln('f$index $prefix${data.name};');
|
||||
sb.writeln('f$index $prefix${data.name} = throw "";');
|
||||
}
|
||||
sb.write(additionalData);
|
||||
return sb.toString();
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:static=[explicitAs(1),implicitAs(1),promoted(1)],type=[inst:JSNull]*/
|
||||
main() {
|
||||
explicitAs(null);
|
||||
|
@ -52,10 +50,10 @@ main() {
|
|||
type=[
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
param:String*]
|
||||
param:String?]
|
||||
*/
|
||||
explicitAs(String i) {
|
||||
i.length;
|
||||
explicitAs(String? i) {
|
||||
i!.length;
|
||||
// ignore: unnecessary_cast
|
||||
return i as String;
|
||||
}
|
||||
|
@ -99,13 +97,14 @@ explicitAs(String i) {
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:String,
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
param:String*]
|
||||
param:String?]
|
||||
*/
|
||||
String implicitAs(String i) {
|
||||
String implicitAs(String? i) {
|
||||
dynamic j = i;
|
||||
i.length;
|
||||
i!.length;
|
||||
j.length;
|
||||
return j;
|
||||
}
|
||||
|
@ -152,9 +151,9 @@ String implicitAs(String i) {
|
|||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
is:String*]
|
||||
is:String]
|
||||
*/
|
||||
String promoted(dynamic i) {
|
||||
String? promoted(dynamic i) {
|
||||
if (i is! String) return null;
|
||||
i.length;
|
||||
return i;
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:
|
||||
static=[
|
||||
testAnonymousAsync(0),
|
||||
|
@ -243,7 +241,7 @@ testAnonymousAsyncStar() {
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:Stream<dynamic>*,
|
||||
impl:Stream<dynamic>,
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
|
@ -303,8 +301,8 @@ testAsyncForIn(o) async {
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:Stream<dynamic>*,
|
||||
impl:int*,
|
||||
impl:Stream<dynamic>,
|
||||
impl:int,
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:
|
||||
static=[
|
||||
testAbstractClassWithField(0),
|
||||
|
@ -122,7 +120,7 @@ class Sub5 extends Super5 {
|
|||
/*member: testSuperClosurization:static=[Sub5.(0)]*/
|
||||
testSuperClosurization() => Sub5();
|
||||
|
||||
class EmptyMixin {}
|
||||
mixin EmptyMixin {}
|
||||
|
||||
class ForwardingConstructorSuperClass {
|
||||
/*member: ForwardingConstructorSuperClass.:static=[Object.(0)]*/
|
||||
|
@ -180,9 +178,9 @@ class ForwardingConstructorTypedSuperClass {
|
|||
type=[
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
param:int*]
|
||||
param:int?]
|
||||
*/
|
||||
ForwardingConstructorTypedSuperClass(int arg);
|
||||
ForwardingConstructorTypedSuperClass(int? arg);
|
||||
}
|
||||
|
||||
class ForwardingConstructorTypedClass = ForwardingConstructorTypedSuperClass
|
||||
|
@ -242,7 +240,7 @@ class ForwardingConstructorGenericSuperClass<T> {
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:ForwardingConstructorGenericSuperClass.T*]
|
||||
param:ForwardingConstructorGenericSuperClass.T]
|
||||
*/
|
||||
ForwardingConstructorGenericSuperClass(T arg);
|
||||
}
|
||||
|
@ -257,7 +255,7 @@ class ForwardingConstructorGenericClass<
|
|||
type=[inst:JSNull]
|
||||
*/
|
||||
testForwardingConstructorGeneric() {
|
||||
ForwardingConstructorGenericClass<int>(null);
|
||||
ForwardingConstructorGenericClass<int?>(null);
|
||||
}
|
||||
|
||||
enum Enum { A }
|
||||
|
@ -324,14 +322,14 @@ testEnum() => Enum.A;
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
inst:List<staticGenericMethod.T*>,
|
||||
param:Object*,
|
||||
param:staticGenericMethod.T*]
|
||||
inst:List<staticGenericMethod.T>,
|
||||
param:Object?,
|
||||
param:staticGenericMethod.T]
|
||||
*/
|
||||
List<T> staticGenericMethod<T>(T arg) => [arg];
|
||||
|
||||
/*member: testStaticGenericMethod:
|
||||
static=[staticGenericMethod<bool*>(1)],
|
||||
static=[staticGenericMethod<bool>(1)],
|
||||
type=[inst:JSBool]
|
||||
*/
|
||||
testStaticGenericMethod() {
|
||||
|
@ -339,7 +337,7 @@ testStaticGenericMethod() {
|
|||
}
|
||||
|
||||
/*member: testInstanceGenericMethod:
|
||||
dynamic=[exact:GenericClass.genericMethod<bool*>(1)],
|
||||
dynamic=[exact:GenericClass.genericMethod<bool>(1)],
|
||||
static=[
|
||||
GenericClass.generative(0),
|
||||
checkTypeBound(4)],
|
||||
|
@ -351,14 +349,14 @@ testInstanceGenericMethod() {
|
|||
|
||||
abstract class AbstractClass {
|
||||
// ignore: UNUSED_FIELD
|
||||
final _field;
|
||||
final _field = null;
|
||||
|
||||
/*member: AbstractClass.:type=[inst:JSNull]*/
|
||||
factory AbstractClass() => null;
|
||||
/*member: AbstractClass.build:type=[inst:JSNull]*/
|
||||
static build() => null;
|
||||
}
|
||||
|
||||
/*member: testAbstractClassWithField:static=[AbstractClass.(0)]*/
|
||||
testAbstractClassWithField() => AbstractClass();
|
||||
/*member: testAbstractClassWithField:static=[AbstractClass.build(0)]*/
|
||||
testAbstractClassWithField() => AbstractClass.build();
|
||||
|
||||
/*member: testMixinInstantiation:static=[Sub.(0)]*/
|
||||
testMixinInstantiation() => Sub();
|
||||
|
@ -431,19 +429,19 @@ class GenericClass<X, Y> {
|
|||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
inst:Map<GenericClass.X*,genericMethod.T*>,
|
||||
param:Object*,
|
||||
param:genericMethod.T*]
|
||||
inst:Map<GenericClass.X?,genericMethod.T>,
|
||||
param:Object?,
|
||||
param:genericMethod.T]
|
||||
*/
|
||||
Map<X, T> genericMethod<T>(T arg) => {null: arg};
|
||||
Map<X?, T> genericMethod<T>(T arg) => {null: arg};
|
||||
}
|
||||
|
||||
/*member: Super.:static=[Object.(0)]*/
|
||||
class Super {}
|
||||
|
||||
class Mixin1 {}
|
||||
mixin Mixin1 {}
|
||||
|
||||
class Mixin2 {}
|
||||
mixin Mixin2 {}
|
||||
|
||||
/*member: Sub.:static=[_Sub&Super&Mixin1&Mixin2.(0)]*/
|
||||
class Sub extends Super with Mixin1, Mixin2 {}
|
||||
|
@ -453,9 +451,9 @@ class NamedMixin = Super with Mixin1, Mixin2;
|
|||
/*member: GenericSuper.:static=[Object.(0)]*/
|
||||
class GenericSuper<X1, Y1> {}
|
||||
|
||||
class GenericMixin1<X2, Y2> {}
|
||||
mixin GenericMixin1<X2, Y2> {}
|
||||
|
||||
class GenericMixin2<X3, Y3> {}
|
||||
mixin GenericMixin2<X3, Y3> {}
|
||||
|
||||
/*member: GenericSub.:
|
||||
static=[_GenericSub&GenericSuper&GenericMixin1&GenericMixin2.(0)]
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
const dynamic nullLiteralField = null;
|
||||
|
||||
const dynamic boolLiteralField = true;
|
||||
|
@ -91,8 +89,8 @@ const typeLiteralField = String;
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:Object*,
|
||||
param:id.T*]
|
||||
param:Object?,
|
||||
param:id.T]
|
||||
*/
|
||||
T id<T>(T t) => t;
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
import 'lib.dart';
|
||||
import 'lib.dart' deferred as defer;
|
||||
|
||||
|
@ -153,7 +151,7 @@ symbolLiteral() => #foo;
|
|||
|
||||
/*member: listLiteral:type=[
|
||||
inst:JSBool,
|
||||
inst:List<bool*>]*/
|
||||
inst:List<bool>]*/
|
||||
listLiteral() => const [true, false];
|
||||
|
||||
/*member: mapLiteral:type=[
|
||||
|
@ -194,7 +192,7 @@ instanceConstant() => const Class(true, false);
|
|||
type=[
|
||||
inst:Type,
|
||||
inst:_Type,
|
||||
lit:String*]
|
||||
lit:String]
|
||||
*/
|
||||
typeLiteral() {
|
||||
const dynamic local = String;
|
||||
|
@ -261,7 +259,7 @@ symbolLiteralRef() => symbolLiteralField;
|
|||
|
||||
/*member: listLiteralRef:type=[
|
||||
inst:JSBool,
|
||||
inst:List<bool*>]*/
|
||||
inst:List<bool>]*/
|
||||
listLiteralRef() => listLiteralField;
|
||||
|
||||
/*member: mapLiteralRef:type=[
|
||||
|
@ -302,7 +300,7 @@ instanceConstantRef() => instanceConstantField;
|
|||
type=[
|
||||
inst:Type,
|
||||
inst:_Type,
|
||||
lit:String*]
|
||||
lit:String]
|
||||
*/
|
||||
typeLiteralRef() => typeLiteralField;
|
||||
|
||||
|
@ -359,7 +357,7 @@ symbolLiteralDeferred() => defer.symbolLiteralField;
|
|||
// TODO(johnniwinther): Should we record that this is deferred?
|
||||
/*member: listLiteralDeferred:type=[
|
||||
inst:JSBool,
|
||||
inst:List<bool*>]*/
|
||||
inst:List<bool>]*/
|
||||
listLiteralDeferred() => defer.listLiteralField;
|
||||
|
||||
// TODO(johnniwinther): Should we record that this is deferred?
|
||||
|
@ -403,7 +401,7 @@ instanceConstantDeferred() => defer.instanceConstantField;
|
|||
type=[
|
||||
inst:Type,
|
||||
inst:_Type,
|
||||
lit:String*{defer}]
|
||||
lit:String{defer}]
|
||||
*/
|
||||
typeLiteralDeferred() => defer.typeLiteralField;
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:
|
||||
static=[
|
||||
testConstRedirectingFactoryInvoke(0),
|
||||
|
@ -117,7 +115,7 @@ testConstRedirectingFactoryInvoke() {
|
|||
const Class.redirect();
|
||||
}
|
||||
|
||||
/*member: testConstRedirectingFactoryInvokeGeneric:type=[const:GenericClass<int*,String*>]*/
|
||||
/*member: testConstRedirectingFactoryInvokeGeneric:type=[const:GenericClass<int,String>]*/
|
||||
testConstRedirectingFactoryInvokeGeneric() {
|
||||
const GenericClass<int, String>.redirect();
|
||||
}
|
||||
|
@ -139,8 +137,11 @@ class ClassImplicitConstructor {}
|
|||
testImplicitConstructor() => ClassImplicitConstructor();
|
||||
|
||||
class ClassFactoryConstructor {
|
||||
/*member: ClassFactoryConstructor.:type=[inst:JSNull]*/
|
||||
factory ClassFactoryConstructor() => null;
|
||||
/*member: ClassFactoryConstructor._:static=[Object.(0)]*/
|
||||
ClassFactoryConstructor._();
|
||||
|
||||
/*member: ClassFactoryConstructor.:static=[ClassFactoryConstructor._(0)]*/
|
||||
factory ClassFactoryConstructor() => ClassFactoryConstructor._();
|
||||
}
|
||||
|
||||
/*member: testFactoryConstructor:static=[ClassFactoryConstructor.(0)]*/
|
||||
|
@ -150,8 +151,8 @@ class Class {
|
|||
/*member: Class.generative:static=[Object.(0)]*/
|
||||
const Class.generative();
|
||||
|
||||
/*member: Class.fact:type=[inst:JSNull]*/
|
||||
factory Class.fact() => null;
|
||||
/*member: Class.fact:static=[Class.generative(0)]*/
|
||||
factory Class.fact() => Class.generative();
|
||||
|
||||
const factory Class.redirect() = Class.generative;
|
||||
}
|
||||
|
@ -162,6 +163,7 @@ class GenericClass<X, Y> {
|
|||
|
||||
/*member: GenericClass.fact:
|
||||
static=[
|
||||
GenericClass.generative(0),
|
||||
Rti._bind(1),
|
||||
Rti._eval(1),
|
||||
_arrayInstanceType(1),
|
||||
|
@ -195,15 +197,15 @@ class GenericClass<X, Y> {
|
|||
_isObject(1),
|
||||
_isString(1),
|
||||
_isTop(1),
|
||||
checkTypeBound(4),
|
||||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
param:Object*]
|
||||
param:Object?]
|
||||
*/
|
||||
factory GenericClass.fact() => null;
|
||||
factory GenericClass.fact() => GenericClass<X, Y>.generative();
|
||||
|
||||
const factory GenericClass.redirect() = GenericClass<X, Y>.generative;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:
|
||||
static=[
|
||||
effectivelyFinalList(0),
|
||||
|
@ -67,7 +65,7 @@ notEffectivelyFinalList() {
|
|||
}
|
||||
|
||||
/*member: _method1:type=[inst:JSNull]*/
|
||||
num _method1() => null;
|
||||
num? _method1() => null;
|
||||
|
||||
/*member: effectivelyFinalPromoted:
|
||||
dynamic=[
|
||||
|
@ -119,7 +117,7 @@ num _method1() => null;
|
|||
inst:JSPositiveInt,
|
||||
inst:JSUInt31,
|
||||
inst:JSUInt32,
|
||||
is:int*]
|
||||
is:int]
|
||||
*/
|
||||
effectivelyFinalPromoted() {
|
||||
dynamic c = _method1();
|
||||
|
@ -130,7 +128,7 @@ effectivelyFinalPromoted() {
|
|||
}
|
||||
|
||||
/*member: _method2:type=[inst:JSNull]*/
|
||||
String _method2() => null;
|
||||
String? _method2() => null;
|
||||
|
||||
/*member: effectivelyFinalPromotedInvalid:
|
||||
dynamic=[
|
||||
|
@ -183,7 +181,7 @@ String _method2() => null;
|
|||
inst:JSString,
|
||||
inst:JSUInt31,
|
||||
inst:JSUInt32,
|
||||
is:int*]
|
||||
is:int]
|
||||
*/
|
||||
effectivelyFinalPromotedInvalid() {
|
||||
dynamic c = _method2();
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: A.:static=[Object.(0)]*/
|
||||
class A {
|
||||
method1() {}
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:static=[
|
||||
testAs(1),
|
||||
testAsGeneric(1),
|
||||
|
@ -211,7 +209,7 @@ testIsTypedefDeep() => null is List<GenericTypedef<int, GenericTypedef>>;
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
as:Class*,
|
||||
as:Class,
|
||||
inst:Closure,
|
||||
inst:JSBool]
|
||||
*/
|
||||
|
@ -257,7 +255,7 @@ testAs(dynamic o) => o as Class;
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
as:GenericClass<int*,String*>*,
|
||||
as:GenericClass<int,String>,
|
||||
inst:Closure,
|
||||
inst:JSArray<dynamic>,
|
||||
inst:JSBool,
|
||||
|
@ -307,7 +305,7 @@ testAsGeneric(dynamic o) => o as GenericClass<int, String>;
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
as:GenericClass<dynamic,dynamic>*,
|
||||
as:GenericClass<dynamic,dynamic>,
|
||||
inst:Closure,
|
||||
inst:JSBool]
|
||||
*/
|
||||
|
@ -352,7 +350,7 @@ testAsGenericRaw(dynamic o) => o as GenericClass;
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
as:GenericClass<dynamic,dynamic>*,
|
||||
as:GenericClass<dynamic,dynamic>,
|
||||
inst:Closure,
|
||||
inst:JSBool]
|
||||
*/
|
||||
|
@ -412,9 +410,9 @@ testIfNotNull(o) => o?.foo;
|
|||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
param:Class*]
|
||||
param:Class?]
|
||||
*/
|
||||
testTypedIfNotNull(Class o) => o?.field;
|
||||
testTypedIfNotNull(Class? o) => o?.field;
|
||||
|
||||
/*member: testIfNotNullSet:
|
||||
dynamic=[foo=],
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/// ignore: IMPORT_INTERNAL_LIBRARY
|
||||
import 'dart:_internal';
|
||||
|
||||
|
@ -51,11 +49,11 @@ class C implements A<int>, B<String, bool> {}
|
|||
_isString(1),
|
||||
_isTop(1),
|
||||
_setArrayType(2),
|
||||
extractTypeArguments<A<dynamic>*>(2),
|
||||
extractTypeArguments<A<dynamic>>(2),
|
||||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:A<dynamic>*,
|
||||
impl:A<dynamic>,
|
||||
impl:Function,
|
||||
inst:Closure,
|
||||
inst:JSArray<dynamic>,
|
||||
|
@ -105,11 +103,11 @@ testA(c, f) => extractTypeArguments<A>(c, f);
|
|||
_isString(1),
|
||||
_isTop(1),
|
||||
_setArrayType(2),
|
||||
extractTypeArguments<B<dynamic,dynamic>*>(2),
|
||||
extractTypeArguments<B<dynamic,dynamic>>(2),
|
||||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:B<dynamic,dynamic>*,
|
||||
impl:B<dynamic,dynamic>,
|
||||
impl:Function,
|
||||
inst:Closure,
|
||||
inst:JSArray<dynamic>,
|
||||
|
|
|
@ -2,13 +2,11 @@
|
|||
// 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.7
|
||||
|
||||
import "dart:async";
|
||||
|
||||
/*member: main:
|
||||
dynamic=[runtimeType],
|
||||
runtimeType=[unknown:FutureOr<int*>*],
|
||||
runtimeType=[unknown:FutureOr<int>],
|
||||
static=[
|
||||
Future.value(1),
|
||||
checkTypeBound(4),
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:
|
||||
static=[
|
||||
testDefaultValuesNamed(0),
|
||||
|
@ -70,7 +68,7 @@ main() {
|
|||
type=[
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
param:bool*]
|
||||
param:bool]
|
||||
*/
|
||||
testDefaultValuesPositional([bool value = false]) {}
|
||||
|
||||
|
@ -114,7 +112,7 @@ testDefaultValuesPositional([bool value = false]) {}
|
|||
type=[
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
param:bool*]
|
||||
param:bool]
|
||||
*/
|
||||
testDefaultValuesNamed({bool value = false}) {}
|
||||
|
||||
|
@ -228,7 +226,7 @@ class ClassInstanceFieldWithInitializer {
|
|||
type=[
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
param:bool*]
|
||||
param:bool]
|
||||
*/
|
||||
var field = false;
|
||||
}
|
||||
|
@ -279,9 +277,9 @@ class ClassInstanceFieldTyped {
|
|||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
param:int*]
|
||||
param:int?]
|
||||
*/
|
||||
int field;
|
||||
int? field;
|
||||
}
|
||||
|
||||
/*member: testInstanceFieldTyped:static=[ClassInstanceFieldTyped.(0)]*/
|
||||
|
@ -354,7 +352,7 @@ class ClassGeneric<T> {
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:ClassGeneric.T*]
|
||||
param:ClassGeneric.T]
|
||||
*/
|
||||
ClassGeneric(T arg);
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
class A {}
|
||||
|
||||
class B {}
|
||||
|
@ -57,9 +55,9 @@ class Class1 {
|
|||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
param:A*]
|
||||
param:A?]
|
||||
*/
|
||||
A field1;
|
||||
A? field1;
|
||||
}
|
||||
|
||||
/*member: method1:
|
||||
|
@ -101,10 +99,10 @@ class Class1 {
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:A*,
|
||||
impl:A?,
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
is:Class1*]
|
||||
is:Class1]
|
||||
*/
|
||||
method1(dynamic o, dynamic value) {
|
||||
if (o is! Class1) return;
|
||||
|
@ -160,9 +158,9 @@ class Class2<T> {
|
|||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:Class2.T*]
|
||||
param:Class2.T?]
|
||||
*/
|
||||
T field2;
|
||||
T? field2;
|
||||
}
|
||||
|
||||
/*member: method2:
|
||||
|
@ -205,7 +203,7 @@ class Class2<T> {
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:A*,
|
||||
impl:A?,
|
||||
inst:Closure,
|
||||
inst:JSArray<dynamic>,
|
||||
inst:JSBool,
|
||||
|
@ -213,7 +211,7 @@ class Class2<T> {
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
is:Class2<A*>*]
|
||||
is:Class2<A>]
|
||||
*/
|
||||
method2(dynamic o, dynamic value) {
|
||||
if (o is! Class2<A>) return;
|
||||
|
@ -263,11 +261,11 @@ class Class3 {
|
|||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
param:A*,
|
||||
param:B*,
|
||||
param:C*]
|
||||
param:A,
|
||||
param:B?,
|
||||
param:C?]
|
||||
*/
|
||||
method3(A a, [B b, C c]) {}
|
||||
method3(A a, [B? b, C? c]) {}
|
||||
}
|
||||
|
||||
/*member: method3:
|
||||
|
@ -309,14 +307,14 @@ class Class3 {
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:A*,
|
||||
impl:C*,
|
||||
impl:A,
|
||||
impl:C?,
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
is:Class3*,
|
||||
param:B*]
|
||||
is:Class3,
|
||||
param:B?]
|
||||
*/
|
||||
method3(dynamic o, dynamic a, B b, dynamic c) {
|
||||
method3(dynamic o, dynamic a, B? b, dynamic c) {
|
||||
if (o is! Class3) return;
|
||||
o.method3(a, b, c);
|
||||
}
|
||||
|
@ -364,11 +362,11 @@ class Class4 {
|
|||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
param:A*,
|
||||
param:B*,
|
||||
param:C*]
|
||||
param:A,
|
||||
param:B?,
|
||||
param:C?]
|
||||
*/
|
||||
method4(A a, {B b, C c}) {}
|
||||
method4(A a, {B? b, C? c}) {}
|
||||
}
|
||||
|
||||
/*member: method4:
|
||||
|
@ -410,14 +408,14 @@ class Class4 {
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:A*,
|
||||
impl:C*,
|
||||
impl:A,
|
||||
impl:C?,
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
is:Class4*,
|
||||
param:B*]
|
||||
is:Class4,
|
||||
param:B?]
|
||||
*/
|
||||
method4(dynamic o, dynamic a, B b, dynamic c) {
|
||||
method4(dynamic o, dynamic a, B? b, dynamic c) {
|
||||
if (o is! Class4) return;
|
||||
o.method4(a, c: c, b: b);
|
||||
}
|
||||
|
@ -471,18 +469,18 @@ class Class5<T1, T2> {
|
|||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:C*,
|
||||
param:Class5.T1*,
|
||||
param:Class5.T2*,
|
||||
param:Object*,
|
||||
param:method5.S1*,
|
||||
param:method5.S2*]
|
||||
param:C?,
|
||||
param:Class5.T1,
|
||||
param:Class5.T2?,
|
||||
param:Object?,
|
||||
param:method5.S1?,
|
||||
param:method5.S2?]
|
||||
*/
|
||||
method5<S1, S2>(T1 a, [T2 b, C c, S1 d, S2 e]) {}
|
||||
method5<S1, S2>(T1 a, [T2? b, C? c, S1? d, S2? e]) {}
|
||||
}
|
||||
|
||||
/*member: method5:
|
||||
dynamic=[Class5.method5<D*,E*>(5)],
|
||||
dynamic=[Class5.method5<D,E>(5)],
|
||||
static=[
|
||||
Rti._bind(1),
|
||||
Rti._eval(1),
|
||||
|
@ -521,8 +519,8 @@ class Class5<T1, T2> {
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:A*,
|
||||
impl:D*,
|
||||
impl:A,
|
||||
impl:D?,
|
||||
inst:Closure,
|
||||
inst:JSArray<dynamic>,
|
||||
inst:JSBool,
|
||||
|
@ -530,12 +528,12 @@ class Class5<T1, T2> {
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
is:Class5<A*,B*>*,
|
||||
param:B*,
|
||||
param:C*,
|
||||
param:E*]
|
||||
is:Class5<A,B>,
|
||||
param:B?,
|
||||
param:C?,
|
||||
param:E?]
|
||||
*/
|
||||
method5(dynamic o, dynamic a, B b, C c, dynamic d, E e) {
|
||||
method5(dynamic o, dynamic a, B? b, C? c, dynamic d, E? e) {
|
||||
if (o is! Class5<A, B>) return;
|
||||
o.method5<D, E>(a, b, c, d, e);
|
||||
}
|
||||
|
@ -589,18 +587,18 @@ class Class6<T1, T2> {
|
|||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:C*,
|
||||
param:Class6.T1*,
|
||||
param:Class6.T2*,
|
||||
param:Object*,
|
||||
param:method6.S1*,
|
||||
param:method6.S2*]
|
||||
param:C?,
|
||||
param:Class6.T1,
|
||||
param:Class6.T2?,
|
||||
param:Object?,
|
||||
param:method6.S1?,
|
||||
param:method6.S2?]
|
||||
*/
|
||||
method6<S1, S2>(T1 a, {T2 b, C c, S1 d, S2 e}) {}
|
||||
method6<S1, S2>(T1 a, {T2? b, C? c, S1? d, S2? e}) {}
|
||||
}
|
||||
|
||||
/*member: method6:
|
||||
dynamic=[Class6.method6<D*,E*>(1,b,c,d,e)],
|
||||
dynamic=[Class6.method6<D,E>(1,b,c,d,e)],
|
||||
static=[
|
||||
Rti._bind(1),
|
||||
Rti._eval(1),
|
||||
|
@ -639,8 +637,8 @@ class Class6<T1, T2> {
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:A*,
|
||||
impl:D*,
|
||||
impl:A,
|
||||
impl:D?,
|
||||
inst:Closure,
|
||||
inst:JSArray<dynamic>,
|
||||
inst:JSBool,
|
||||
|
@ -648,20 +646,69 @@ class Class6<T1, T2> {
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
is:Class6<A*,B*>*,
|
||||
param:B*,
|
||||
param:C*,
|
||||
param:E*]
|
||||
is:Class6<A,B>,
|
||||
param:B?,
|
||||
param:C?,
|
||||
param:E?]
|
||||
*/
|
||||
method6(dynamic o, dynamic a, B b, C c, dynamic d, E e) {
|
||||
method6(dynamic o, dynamic a, B? b, C? c, dynamic d, E? e) {
|
||||
if (o is! Class6<A, B>) return;
|
||||
o.method6<D, E>(a, d: d, b: b, e: e, c: c);
|
||||
}
|
||||
|
||||
/*member: Class7.:static=[Object.(0)]*/
|
||||
class Class7 {
|
||||
/*member: Class7.f:type=[inst:JSNull]*/
|
||||
A Function(A) get f => null;
|
||||
/*member: Class7.f:
|
||||
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),
|
||||
_generalNullableAsCheckImplementation(1),
|
||||
_generalNullableIsTestImplementation(1),
|
||||
_installSpecializedAsCheck(1),
|
||||
_installSpecializedIsTest(1),
|
||||
_instanceType(1),
|
||||
_isBool(1),
|
||||
_isInt(1),
|
||||
_isNum(1),
|
||||
_isObject(1),
|
||||
_isString(1),
|
||||
_isTop(1),
|
||||
_setArrayType(2),
|
||||
def:<anonymous>,
|
||||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
inst:Closure,
|
||||
inst:Function,
|
||||
inst:JSArray<dynamic>,
|
||||
inst:JSBool,
|
||||
inst:JSExtendableArray<dynamic>,
|
||||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:A]
|
||||
*/
|
||||
A Function(A) get f => (a) => a;
|
||||
}
|
||||
|
||||
/*member: method7:
|
||||
|
@ -705,232 +752,24 @@ class Class7 {
|
|||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:A*,
|
||||
impl:A,
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
is:Class7*]
|
||||
is:Class7]
|
||||
*/
|
||||
method7(dynamic o, dynamic a) {
|
||||
if (o is! Class7) return;
|
||||
o.f(a);
|
||||
}
|
||||
|
||||
/*member: F.:static=[Object.(0)]*/
|
||||
class F<T> {
|
||||
/*member: F.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),
|
||||
_generalNullableAsCheckImplementation(1),
|
||||
_generalNullableIsTestImplementation(1),
|
||||
_installSpecializedAsCheck(1),
|
||||
_installSpecializedIsTest(1),
|
||||
_instanceType(1),
|
||||
_isBool(1),
|
||||
_isInt(1),
|
||||
_isNum(1),
|
||||
_isObject(1),
|
||||
_isString(1),
|
||||
_isTop(1),
|
||||
_setArrayType(2),
|
||||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
inst:Closure,
|
||||
inst:JSArray<dynamic>,
|
||||
inst:JSBool,
|
||||
inst:JSExtendableArray<dynamic>,
|
||||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:List<F.T*>*]
|
||||
*/
|
||||
T method(List<T> list) => null;
|
||||
T? method(List<T> list) => null;
|
||||
|
||||
/*member: F.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),
|
||||
_generalNullableAsCheckImplementation(1),
|
||||
_generalNullableIsTestImplementation(1),
|
||||
_installSpecializedAsCheck(1),
|
||||
_installSpecializedIsTest(1),
|
||||
_instanceType(1),
|
||||
_isBool(1),
|
||||
_isInt(1),
|
||||
_isNum(1),
|
||||
_isObject(1),
|
||||
_isString(1),
|
||||
_isTop(1),
|
||||
_setArrayType(2),
|
||||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
inst:Closure,
|
||||
inst:JSArray<dynamic>,
|
||||
inst:JSBool,
|
||||
inst:JSExtendableArray<dynamic>,
|
||||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:F.T*]
|
||||
*/
|
||||
T field;
|
||||
T? field;
|
||||
}
|
||||
|
||||
/*member: G.:static=[F.(0)]*/
|
||||
class G extends F<int> {}
|
||||
|
||||
/*member: method8:
|
||||
dynamic=[G.method(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),
|
||||
_generalNullableAsCheckImplementation(1),
|
||||
_generalNullableIsTestImplementation(1),
|
||||
_installSpecializedAsCheck(1),
|
||||
_installSpecializedIsTest(1),
|
||||
_instanceType(1),
|
||||
_isBool(1),
|
||||
_isInt(1),
|
||||
_isNum(1),
|
||||
_isObject(1),
|
||||
_isString(1),
|
||||
_isTop(1),
|
||||
_setArrayType(2),
|
||||
findType(1),
|
||||
instanceType(1)],
|
||||
type=[
|
||||
impl:List<int*>*,
|
||||
inst:Closure,
|
||||
inst:JSArray<dynamic>,
|
||||
inst:JSBool,
|
||||
inst:JSExtendableArray<dynamic>,
|
||||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
is:G*,
|
||||
param:Iterable<int*>*]
|
||||
*/
|
||||
method8(dynamic g, Iterable<int> iterable) {
|
||||
if (g is! G) return null;
|
||||
return g.method(iterable);
|
||||
}
|
||||
|
||||
/*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),
|
||||
_generalNullableAsCheckImplementation(1),
|
||||
_generalNullableIsTestImplementation(1),
|
||||
_installSpecializedAsCheck(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;
|
||||
}
|
||||
|
||||
/*member: main:%*/
|
||||
main() {
|
||||
method1(new Class1(), null);
|
||||
|
@ -940,6 +779,4 @@ main() {
|
|||
method5(new Class5<A, B>(), null, null, null, null, null);
|
||||
method6(new Class6<A, B>(), null, null, null, null, null);
|
||||
method7(new Class7(), null);
|
||||
method8(new G(), null);
|
||||
method9(new G(), null);
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:
|
||||
static=[
|
||||
testClosure(0),
|
||||
|
@ -157,7 +155,7 @@ testTopLevelInvoke() {
|
|||
type=[
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
param:int*]
|
||||
param:int]
|
||||
*/
|
||||
void topLevelFunction1Typed(int a) {}
|
||||
|
||||
|
@ -202,11 +200,11 @@ void topLevelFunction1Typed(int a) {}
|
|||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
param:String*,
|
||||
param:double*,
|
||||
param:num*]
|
||||
param:String,
|
||||
param:double?,
|
||||
param:num?]
|
||||
*/
|
||||
int topLevelFunction2Typed(String a, [num b, double c]) => null;
|
||||
int? topLevelFunction2Typed(String a, [num? b, double? c]) => null;
|
||||
|
||||
/*member: topLevelFunction3Typed:
|
||||
static=[
|
||||
|
@ -255,11 +253,11 @@ int topLevelFunction2Typed(String a, [num b, double c]) => null;
|
|||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:List<int*>*,
|
||||
param:Map<String*,bool*>*,
|
||||
param:bool*]
|
||||
param:List<int>?,
|
||||
param:Map<String,bool>?,
|
||||
param:bool?]
|
||||
*/
|
||||
double topLevelFunction3Typed(bool a, {List<int> b, Map<String, bool> c}) {
|
||||
double? topLevelFunction3Typed(bool? a, {List<int>? b, Map<String, bool>? c}) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -284,8 +282,8 @@ double topLevelFunction3Typed(bool a, {List<int> b, Map<String, bool> c}) {
|
|||
inst:JSString,
|
||||
inst:JSUInt31,
|
||||
inst:JSUInt32,
|
||||
inst:List<int*>,
|
||||
inst:Map<String*,bool*>]
|
||||
inst:List<int>,
|
||||
inst:Map<String,bool>]
|
||||
*/
|
||||
testTopLevelInvokeTyped() {
|
||||
topLevelFunction1Typed(0);
|
||||
|
@ -345,9 +343,9 @@ testTopLevelInvokeTyped() {
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:void Function(num*)*]
|
||||
param:void Function(num)?]
|
||||
*/
|
||||
topLevelFunctionTyped1(void a(num b)) {}
|
||||
topLevelFunctionTyped1(void a(num b)?) {}
|
||||
|
||||
/*member: topLevelFunctionTyped2:
|
||||
static=[
|
||||
|
@ -395,9 +393,9 @@ topLevelFunctionTyped1(void a(num b)) {}
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:void Function(num*,[String*])*]
|
||||
param:void Function(num,[String])?]
|
||||
*/
|
||||
topLevelFunctionTyped2(void a(num b, [String c])) {}
|
||||
topLevelFunctionTyped2(void a(num b, [String c])?) {}
|
||||
|
||||
/*member: topLevelFunctionTyped3:
|
||||
static=[
|
||||
|
@ -445,9 +443,9 @@ topLevelFunctionTyped2(void a(num b, [String c])) {}
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:void Function(num*,{String* c,int* d})*]
|
||||
param:void Function(num,{String c,int d})?]
|
||||
*/
|
||||
topLevelFunctionTyped3(void a(num b, {String c, int d})) {}
|
||||
topLevelFunctionTyped3(void a(num b, {String c, int d})?) {}
|
||||
|
||||
/*member: topLevelFunctionTyped4:
|
||||
static=[
|
||||
|
@ -495,9 +493,9 @@ topLevelFunctionTyped3(void a(num b, {String c, int d})) {}
|
|||
inst:JSFixedArray<dynamic>,
|
||||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:void Function(num*,{int* c,String* d})*]
|
||||
param:void Function(num,{int c,String d})?]
|
||||
*/
|
||||
topLevelFunctionTyped4(void a(num b, {String d, int c})) {}
|
||||
topLevelFunctionTyped4(void a(num b, {String d, int c})?) {}
|
||||
|
||||
/*member: testTopLevelFunctionTyped:
|
||||
static=[
|
||||
|
@ -524,7 +522,7 @@ get topLevelGetter => null;
|
|||
testTopLevelGetterGet() => topLevelGetter;
|
||||
|
||||
/*member: topLevelGetterTyped:type=[inst:JSNull]*/
|
||||
int get topLevelGetterTyped => null;
|
||||
int? get topLevelGetterTyped => null;
|
||||
|
||||
/*member: testTopLevelGetterGetTyped:static=[topLevelGetterTyped]*/
|
||||
testTopLevelGetterGetTyped() => topLevelGetterTyped;
|
||||
|
@ -575,9 +573,9 @@ testTopLevelSetterSet() => topLevelSetter = null;
|
|||
type=[
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
param:int*]
|
||||
param:int?]
|
||||
*/
|
||||
void set topLevelSetterTyped(int value) {}
|
||||
void set topLevelSetterTyped(int? value) {}
|
||||
|
||||
/*member: testTopLevelSetterSetTyped:static=[set:topLevelSetterTyped],type=[inst:JSNull]*/
|
||||
testTopLevelSetterSetTyped() => topLevelSetterTyped = null;
|
||||
|
@ -658,9 +656,9 @@ testTopLevelFieldFinal() => topLevelFieldFinal;
|
|||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
param:int*]
|
||||
param:int?]
|
||||
*/
|
||||
int topLevelFieldTyped;
|
||||
int? topLevelFieldTyped;
|
||||
|
||||
/*member: testTopLevelFieldTyped:static=[topLevelFieldTyped]*/
|
||||
testTopLevelFieldTyped() => topLevelFieldTyped;
|
||||
|
@ -706,9 +704,9 @@ testTopLevelFieldTyped() => topLevelFieldTyped;
|
|||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
param:GenericClass<dynamic,dynamic>*]
|
||||
param:GenericClass<dynamic,dynamic>?]
|
||||
*/
|
||||
GenericClass topLevelFieldGeneric1;
|
||||
GenericClass? topLevelFieldGeneric1;
|
||||
|
||||
/*member: testTopLevelFieldGeneric1:static=[topLevelFieldGeneric1]*/
|
||||
testTopLevelFieldGeneric1() => topLevelFieldGeneric1;
|
||||
|
@ -754,9 +752,9 @@ testTopLevelFieldGeneric1() => topLevelFieldGeneric1;
|
|||
inst:Closure,
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
param:GenericClass<dynamic,dynamic>*]
|
||||
param:GenericClass<dynamic,dynamic>?]
|
||||
*/
|
||||
GenericClass<dynamic, dynamic> topLevelFieldGeneric2;
|
||||
GenericClass<dynamic, dynamic>? topLevelFieldGeneric2;
|
||||
|
||||
/*member: testTopLevelFieldGeneric2:static=[topLevelFieldGeneric2]*/
|
||||
testTopLevelFieldGeneric2() => topLevelFieldGeneric2;
|
||||
|
@ -808,9 +806,9 @@ testTopLevelFieldGeneric2() => topLevelFieldGeneric2;
|
|||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:GenericClass<int*,String*>*]
|
||||
param:GenericClass<int,String>?]
|
||||
*/
|
||||
GenericClass<int, String> topLevelFieldGeneric3;
|
||||
GenericClass<int, String>? topLevelFieldGeneric3;
|
||||
|
||||
/*member: testTopLevelFieldGeneric3:static=[topLevelFieldGeneric3]*/
|
||||
testTopLevelFieldGeneric3() => topLevelFieldGeneric3;
|
||||
|
@ -976,11 +974,11 @@ testLocalFunction() {
|
|||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:String*]
|
||||
param:String]
|
||||
*/
|
||||
testLocalFunctionTyped() {
|
||||
// ignore: UNUSED_ELEMENT
|
||||
int localFunction(String a) => null;
|
||||
int? localFunction(String a) => null;
|
||||
}
|
||||
|
||||
/*member: testLocalFunctionInvoke:
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
// @dart = 2.19
|
||||
|
||||
class B {
|
||||
/*member: B.x:
|
||||
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),
|
||||
_generalNullableAsCheckImplementation(1),
|
||||
_generalNullableIsTestImplementation(1),
|
||||
_installSpecializedAsCheck(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]
|
||||
*/
|
||||
final int x;
|
||||
const B(this.x);
|
||||
}
|
||||
|
||||
/*member: case3:
|
||||
static=[B.x=IntConstant(1)],
|
||||
type=[
|
||||
const:B,
|
||||
inst:JSInt,
|
||||
inst:JSNull,
|
||||
inst:JSNumNotInt,
|
||||
inst:JSNumber,
|
||||
inst:JSPositiveInt,
|
||||
inst:JSUInt31,
|
||||
inst:JSUInt32]
|
||||
*/
|
||||
int case3() {
|
||||
switch (null as dynamic) {
|
||||
case B(const bool.fromEnvironment('x') ? 0 : 1):
|
||||
return 1;
|
||||
default:
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
/*member: main:static=[
|
||||
case3(0),
|
||||
print(1)]*/
|
||||
void main() {
|
||||
print(case3());
|
||||
}
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
@JS()
|
||||
library jsinterop;
|
||||
|
||||
|
@ -95,7 +93,7 @@ class GenericClass<T> {
|
|||
inst:JSMutableArray<dynamic>,
|
||||
inst:JSNull,
|
||||
inst:JSUnmodifiableArray<dynamic>,
|
||||
param:void Function(GenericClass.T*)*]
|
||||
param:void Function(GenericClass.T)]
|
||||
*/
|
||||
external GenericClass method([Callback<T> callback]);
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
@JS()
|
||||
library main;
|
||||
|
||||
|
@ -61,7 +59,7 @@ import 'package:js/js.dart';
|
|||
native:PositionError,
|
||||
native:SensorErrorEvent,
|
||||
native:SpeechRecognitionError,
|
||||
param:Function*]
|
||||
param:Function]
|
||||
*/
|
||||
@JS()
|
||||
external set foo(Function f);
|
||||
|
@ -111,8 +109,8 @@ external set foo(Function f);
|
|||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
inst:JSString,
|
||||
param:File*,
|
||||
param:String*]
|
||||
param:File,
|
||||
param:String]
|
||||
*/
|
||||
void _doStuff(String name, File file) {
|
||||
if (file == null) {
|
||||
|
@ -123,7 +121,7 @@ void _doStuff(String name, File file) {
|
|||
|
||||
/*member: main:static=[
|
||||
_doStuff,
|
||||
allowInterop<Function*>(1),
|
||||
allowInterop<Function>(1),
|
||||
set:foo]*/
|
||||
void main() {
|
||||
foo = allowInterop(_doStuff);
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
@JS()
|
||||
library main;
|
||||
|
||||
|
@ -68,7 +66,7 @@ import 'package:js/js.dart';
|
|||
native:PositionError,
|
||||
native:SensorErrorEvent,
|
||||
native:SpeechRecognitionError,
|
||||
param:void Function(String*,File*)*]
|
||||
param:void Function(String,File)]
|
||||
*/
|
||||
@JS()
|
||||
external set foo(void Function(String, File) f);
|
||||
|
@ -118,8 +116,8 @@ external set foo(void Function(String, File) f);
|
|||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
inst:JSString,
|
||||
param:File*,
|
||||
param:String*]
|
||||
param:File,
|
||||
param:String]
|
||||
*/
|
||||
void _doStuff(String name, File file) {
|
||||
if (file == null) {
|
||||
|
@ -130,7 +128,7 @@ void _doStuff(String name, File file) {
|
|||
|
||||
/*member: main:static=[
|
||||
_doStuff,
|
||||
allowInterop<void Function(String*,File*)*>(1),
|
||||
allowInterop<void Function(String,File)>(1),
|
||||
set:foo]*/
|
||||
void main() {
|
||||
foo = allowInterop(_doStuff);
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
/*member: main:static=[
|
||||
testBoolFromEnvironment(0),
|
||||
testComplexConstSymbol(0),
|
||||
|
@ -131,7 +129,7 @@ const complexSymbolField =
|
|||
complexSymbolField1 ? complexSymbolField2 : complexSymbolField3;
|
||||
|
||||
/*member: testComplexConstSymbol:static=[Symbol.(1)],type=[inst:Symbol]*/
|
||||
testComplexConstSymbol() => const Symbol(complexSymbolField);
|
||||
testComplexConstSymbol() => const Symbol(complexSymbolField as String);
|
||||
|
||||
/*member: testIfNullConstSymbol:static=[Symbol.(1)],type=[inst:Symbol]*/
|
||||
testIfNullConstSymbol() => const Symbol(null ?? 'foo');
|
||||
|
@ -143,7 +141,7 @@ testIfNullConstSymbol() => const Symbol(null ?? 'foo');
|
|||
type=[
|
||||
inst:Type,
|
||||
inst:_Type,
|
||||
lit:Object*]
|
||||
lit:Object]
|
||||
*/
|
||||
testTypeLiteral() => Object;
|
||||
|
||||
|
@ -156,7 +154,7 @@ testEmptyListLiteral() => [];
|
|||
/*member: testEmptyListLiteralDynamic:type=[inst:List<dynamic>]*/
|
||||
testEmptyListLiteralDynamic() => <dynamic>[];
|
||||
|
||||
/*member: testEmptyListLiteralTyped:type=[inst:List<String*>]*/
|
||||
/*member: testEmptyListLiteralTyped:type=[inst:List<String>]*/
|
||||
testEmptyListLiteralTyped() => <String>[];
|
||||
|
||||
/*member: testEmptyListLiteralConstant:type=[inst:List<dynamic>]*/
|
||||
|
@ -164,7 +162,7 @@ testEmptyListLiteralConstant() => const [];
|
|||
|
||||
/*member: testNonEmptyListLiteral:type=[
|
||||
inst:JSBool,
|
||||
inst:List<bool*>]*/
|
||||
inst:List<bool>]*/
|
||||
testNonEmptyListLiteral() => [true];
|
||||
|
||||
/*member: testEmptyMapLiteral:type=[inst:Map<dynamic,dynamic>]*/
|
||||
|
@ -173,7 +171,7 @@ testEmptyMapLiteral() => {};
|
|||
/*member: testEmptyMapLiteralDynamic:type=[inst:Map<dynamic,dynamic>]*/
|
||||
testEmptyMapLiteralDynamic() => <dynamic, dynamic>{};
|
||||
|
||||
/*member: testEmptyMapLiteralTyped:type=[inst:Map<String*,int*>]*/
|
||||
/*member: testEmptyMapLiteralTyped:type=[inst:Map<String,int>]*/
|
||||
testEmptyMapLiteralTyped() => <String, int>{};
|
||||
|
||||
/*member: testEmptyMapLiteralConstant:
|
||||
|
@ -187,7 +185,7 @@ testEmptyMapLiteralConstant() => const {};
|
|||
/*member: testNonEmptyMapLiteral:type=[
|
||||
inst:JSBool,
|
||||
inst:JSNull,
|
||||
inst:Map<Null,bool*>]*/
|
||||
inst:Map<Null,bool>]*/
|
||||
testNonEmptyMapLiteral() => {null: true};
|
||||
|
||||
class GenericClass<X, Y> {
|
||||
|
|
|
@ -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.
|
||||
|
||||
// @dart = 2.7
|
||||
|
||||
// ignore: IMPORT_INTERNAL_LIBRARY
|
||||
import 'dart:_foreign_helper' as foreign show JS;
|
||||
// ignore: IMPORT_INTERNAL_LIBRARY
|
||||
|
@ -105,10 +103,10 @@ class NativeClass {
|
|||
native:bool,
|
||||
native:double,
|
||||
native:int,
|
||||
param:Object*]
|
||||
param:Object?]
|
||||
*/
|
||||
@annotation_Creates_SerializedScriptValue
|
||||
final Object field;
|
||||
final Object? field = null;
|
||||
|
||||
factory NativeClass._() {
|
||||
throw UnsupportedError("Not supported");
|
||||
|
@ -157,6 +155,7 @@ class NativeClass {
|
|||
type=[
|
||||
inst:Closure,
|
||||
inst:JSBool,
|
||||
param:NativeClass*]
|
||||
inst:JSNull,
|
||||
param:NativeClass?]
|
||||
*/
|
||||
testNativeField(NativeClass c) => c.field;
|
||||
testNativeField(NativeClass? c) => c?.field;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue