Version 2.10.0-75.0.dev
Merge commit 'e33f84d0812a99ff1bafdbf925b24dccef31b85c' into 'dev'
diff --git a/benchmarks/Dynamic/dart/Dynamic.dart b/benchmarks/Dynamic/dart/Dynamic.dart
new file mode 100644
index 0000000..d296f62
--- /dev/null
+++ b/benchmarks/Dynamic/dart/Dynamic.dart
@@ -0,0 +1,513 @@
+// 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.
+//
+// This benchmark suite measures the overhead of dynamically calling functions
+// and closures by calling a set of functions and closures, testing non-dynamic
+// calls, calls after casting the function tearoff or closure to dynamic, and
+// similarly defined functions and closures except that the parameters and
+// return types are all dynamic.
+
+import 'package:benchmark_harness/benchmark_harness.dart';
+
+const int kRepeat = 100;
+
+void main() {
+ const NonDynamicFunction().report();
+ const NonDynamicFunctionOptSkipped().report();
+ const NonDynamicFunctionOptProvided().report();
+ const NonDynamicFunctionNamedSkipped().report();
+ const NonDynamicFunctionNamedProvided().report();
+ const NonDynamicClosure().report();
+ const NonDynamicClosureOptSkipped().report();
+ const NonDynamicClosureOptProvided().report();
+ const NonDynamicClosureNamedSkipped().report();
+ const NonDynamicClosureNamedProvided().report();
+ const DynamicCastFunction().report();
+ const DynamicCastFunctionOptSkipped().report();
+ const DynamicCastFunctionOptProvided().report();
+ const DynamicCastFunctionNamedSkipped().report();
+ const DynamicCastFunctionNamedProvided().report();
+ const DynamicCastClosure().report();
+ const DynamicCastClosureOptSkipped().report();
+ const DynamicCastClosureOptProvided().report();
+ const DynamicCastClosureNamedSkipped().report();
+ const DynamicCastClosureNamedProvided().report();
+ const DynamicDefFunction().report();
+ const DynamicDefFunctionOptSkipped().report();
+ const DynamicDefFunctionOptProvided().report();
+ const DynamicDefFunctionNamedSkipped().report();
+ const DynamicDefFunctionNamedProvided().report();
+ const DynamicDefClosure().report();
+ const DynamicDefClosureOptSkipped().report();
+ const DynamicDefClosureOptProvided().report();
+ const DynamicDefClosureNamedSkipped().report();
+ const DynamicDefClosureNamedProvided().report();
+ const DynamicClassASingleton().report();
+ const DynamicClassBSingleton().report();
+ const DynamicClassCFresh().report();
+ const DynamicClassDFresh().report();
+}
+
+@pragma('vm:never-inline')
+void f1(String s) {}
+@pragma('vm:never-inline')
+Function(String) c1 = (String s) => {};
+@pragma('vm:never-inline')
+void f2(String s, [String t = 'default']) {}
+@pragma('vm:never-inline')
+Function(String, [String]) c2 = (String s, [String t = 'default']) => {};
+@pragma('vm:never-inline')
+void f3(String s, {String t = 'default'}) {}
+@pragma('vm:never-inline')
+Function(String, {String t}) c3 = (String s, {String t = 'default'}) => {};
+@pragma('vm:never-inline')
+dynamic df1 = f1 as dynamic;
+@pragma('vm:never-inline')
+dynamic dc1 = c1 as dynamic;
+@pragma('vm:never-inline')
+dynamic df2 = f2 as dynamic;
+@pragma('vm:never-inline')
+dynamic dc2 = c2 as dynamic;
+@pragma('vm:never-inline')
+dynamic df3 = f3 as dynamic;
+@pragma('vm:never-inline')
+dynamic dc3 = c3 as dynamic;
+@pragma('vm:never-inline')
+dynamic df1NonCast(dynamic s) {}
+@pragma('vm:never-inline')
+Function dc1NonCast = (dynamic s) => {};
+@pragma('vm:never-inline')
+dynamic df2NonCast(dynamic s, [dynamic t = 'default']) {}
+@pragma('vm:never-inline')
+Function dc2NonCast = (dynamic s, [dynamic t = 'default']) => {};
+@pragma('vm:never-inline')
+dynamic df3NonCast(dynamic s, {dynamic t = 'default'}) {}
+@pragma('vm:never-inline')
+Function dc3NonCast = (dynamic s, {dynamic t = 'default'}) => {};
+
+class A {
+ const A();
+}
+
+class B extends A {
+ const B();
+}
+
+@pragma('vm:never-inline')
+dynamic k = (A a) {};
+
+class C {
+ C();
+}
+
+class D extends C {
+ D();
+}
+
+@pragma('vm:never-inline')
+dynamic j = (C c) {};
+
+class NonDynamicFunction extends BenchmarkBase {
+ const NonDynamicFunction() : super('Dynamic.NonDynamicFunction');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ f1('');
+ }
+ }
+}
+
+class NonDynamicClosure extends BenchmarkBase {
+ const NonDynamicClosure() : super('Dynamic.NonDynamicClosure');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ c1('');
+ }
+ }
+}
+
+class NonDynamicFunctionOptSkipped extends BenchmarkBase {
+ const NonDynamicFunctionOptSkipped()
+ : super('Dynamic.NonDynamicFunctionOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ f2('');
+ }
+ }
+}
+
+class NonDynamicFunctionOptProvided extends BenchmarkBase {
+ const NonDynamicFunctionOptProvided()
+ : super('Dynamic.NonDynamicFunctionOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ f2('', '');
+ }
+ }
+}
+
+class NonDynamicFunctionNamedSkipped extends BenchmarkBase {
+ const NonDynamicFunctionNamedSkipped()
+ : super('Dynamic.NonDynamicFunctionNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ f3('');
+ }
+ }
+}
+
+class NonDynamicFunctionNamedProvided extends BenchmarkBase {
+ const NonDynamicFunctionNamedProvided()
+ : super('Dynamic.NonDynamicFunctionNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ f3('', t: '');
+ }
+ }
+}
+
+class NonDynamicClosureOptSkipped extends BenchmarkBase {
+ const NonDynamicClosureOptSkipped()
+ : super('Dynamic.NonDynamicClosureOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ c2('');
+ }
+ }
+}
+
+class NonDynamicClosureOptProvided extends BenchmarkBase {
+ const NonDynamicClosureOptProvided()
+ : super('Dynamic.NonDynamicClosureOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ c2('', '');
+ }
+ }
+}
+
+class NonDynamicClosureNamedSkipped extends BenchmarkBase {
+ const NonDynamicClosureNamedSkipped()
+ : super('Dynamic.NonDynamicClosureNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ c3('');
+ }
+ }
+}
+
+class NonDynamicClosureNamedProvided extends BenchmarkBase {
+ const NonDynamicClosureNamedProvided()
+ : super('Dynamic.NonDynamicClosureNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ c3('', t: '');
+ }
+ }
+}
+
+class DynamicCastFunction extends BenchmarkBase {
+ const DynamicCastFunction() : super('Dynamic.DynamicCastFunction');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df1('');
+ }
+ }
+}
+
+class DynamicCastClosure extends BenchmarkBase {
+ const DynamicCastClosure() : super('Dynamic.DynamicCastClosure');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc1('');
+ }
+ }
+}
+
+class DynamicCastFunctionOptSkipped extends BenchmarkBase {
+ const DynamicCastFunctionOptSkipped()
+ : super('Dynamic.DynamicCastFunctionOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df2('');
+ }
+ }
+}
+
+class DynamicCastFunctionOptProvided extends BenchmarkBase {
+ const DynamicCastFunctionOptProvided()
+ : super('Dynamic.DynamicCastFunctionOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df2('', '');
+ }
+ }
+}
+
+class DynamicCastFunctionNamedSkipped extends BenchmarkBase {
+ const DynamicCastFunctionNamedSkipped()
+ : super('Dynamic.DynamicCastFunctionNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df3('');
+ }
+ }
+}
+
+class DynamicCastFunctionNamedProvided extends BenchmarkBase {
+ const DynamicCastFunctionNamedProvided()
+ : super('Dynamic.DynamicCastFunctionNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df3('', t: '');
+ }
+ }
+}
+
+class DynamicCastClosureOptSkipped extends BenchmarkBase {
+ const DynamicCastClosureOptSkipped()
+ : super('Dynamic.DynamicCastClosureOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc2('');
+ }
+ }
+}
+
+class DynamicCastClosureOptProvided extends BenchmarkBase {
+ const DynamicCastClosureOptProvided()
+ : super('Dynamic.DynamicCastClosureOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc2('', '');
+ }
+ }
+}
+
+class DynamicCastClosureNamedSkipped extends BenchmarkBase {
+ const DynamicCastClosureNamedSkipped()
+ : super('Dynamic.DynamicCastClosureNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc3('');
+ }
+ }
+}
+
+class DynamicCastClosureNamedProvided extends BenchmarkBase {
+ const DynamicCastClosureNamedProvided()
+ : super('Dynamic.DynamicCastClosureNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc3('', t: '');
+ }
+ }
+}
+
+class DynamicDefFunction extends BenchmarkBase {
+ const DynamicDefFunction() : super('Dynamic.DynamicDefFunction');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df1NonCast('');
+ }
+ }
+}
+
+class DynamicDefClosure extends BenchmarkBase {
+ const DynamicDefClosure() : super('Dynamic.DynamicDefClosure');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc1NonCast('');
+ }
+ }
+}
+
+class DynamicDefFunctionOptSkipped extends BenchmarkBase {
+ const DynamicDefFunctionOptSkipped()
+ : super('Dynamic.DynamicDefFunctionOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df2NonCast('');
+ }
+ }
+}
+
+class DynamicDefFunctionOptProvided extends BenchmarkBase {
+ const DynamicDefFunctionOptProvided()
+ : super('Dynamic.DynamicDefFunctionOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df2NonCast('', '');
+ }
+ }
+}
+
+class DynamicDefFunctionNamedSkipped extends BenchmarkBase {
+ const DynamicDefFunctionNamedSkipped()
+ : super('Dynamic.DynamicDefFunctionNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df3NonCast('');
+ }
+ }
+}
+
+class DynamicDefFunctionNamedProvided extends BenchmarkBase {
+ const DynamicDefFunctionNamedProvided()
+ : super('Dynamic.DynamicDefFunctionNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df3NonCast('', t: '');
+ }
+ }
+}
+
+class DynamicDefClosureOptSkipped extends BenchmarkBase {
+ const DynamicDefClosureOptSkipped()
+ : super('Dynamic.DynamicDefClosureOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc2NonCast('');
+ }
+ }
+}
+
+class DynamicDefClosureOptProvided extends BenchmarkBase {
+ const DynamicDefClosureOptProvided()
+ : super('Dynamic.DynamicDefClosureOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc2NonCast('', '');
+ }
+ }
+}
+
+class DynamicDefClosureNamedSkipped extends BenchmarkBase {
+ const DynamicDefClosureNamedSkipped()
+ : super('Dynamic.DynamicDefClosureNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc3NonCast('');
+ }
+ }
+}
+
+class DynamicDefClosureNamedProvided extends BenchmarkBase {
+ const DynamicDefClosureNamedProvided()
+ : super('Dynamic.DynamicDefClosureNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc3NonCast('', t: '');
+ }
+ }
+}
+
+class DynamicClassASingleton extends BenchmarkBase {
+ final A a;
+ const DynamicClassASingleton()
+ : a = const A(),
+ super('Dynamic.DynamicClassASingleton');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ k(a);
+ }
+ }
+}
+
+class DynamicClassBSingleton extends BenchmarkBase {
+ final B b;
+ const DynamicClassBSingleton()
+ : b = const B(),
+ super('Dynamic.DynamicClassBSingleton');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ k(b);
+ }
+ }
+}
+
+class DynamicClassCFresh extends BenchmarkBase {
+ const DynamicClassCFresh() : super('Dynamic.DynamicClassCFresh');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ j(C());
+ }
+ }
+}
+
+class DynamicClassDFresh extends BenchmarkBase {
+ const DynamicClassDFresh() : super('Dynamic.DynamicClassDFresh');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ j(D());
+ }
+ }
+}
diff --git a/benchmarks/Dynamic/dart2/Dynamic.dart b/benchmarks/Dynamic/dart2/Dynamic.dart
new file mode 100644
index 0000000..d296f62
--- /dev/null
+++ b/benchmarks/Dynamic/dart2/Dynamic.dart
@@ -0,0 +1,513 @@
+// 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.
+//
+// This benchmark suite measures the overhead of dynamically calling functions
+// and closures by calling a set of functions and closures, testing non-dynamic
+// calls, calls after casting the function tearoff or closure to dynamic, and
+// similarly defined functions and closures except that the parameters and
+// return types are all dynamic.
+
+import 'package:benchmark_harness/benchmark_harness.dart';
+
+const int kRepeat = 100;
+
+void main() {
+ const NonDynamicFunction().report();
+ const NonDynamicFunctionOptSkipped().report();
+ const NonDynamicFunctionOptProvided().report();
+ const NonDynamicFunctionNamedSkipped().report();
+ const NonDynamicFunctionNamedProvided().report();
+ const NonDynamicClosure().report();
+ const NonDynamicClosureOptSkipped().report();
+ const NonDynamicClosureOptProvided().report();
+ const NonDynamicClosureNamedSkipped().report();
+ const NonDynamicClosureNamedProvided().report();
+ const DynamicCastFunction().report();
+ const DynamicCastFunctionOptSkipped().report();
+ const DynamicCastFunctionOptProvided().report();
+ const DynamicCastFunctionNamedSkipped().report();
+ const DynamicCastFunctionNamedProvided().report();
+ const DynamicCastClosure().report();
+ const DynamicCastClosureOptSkipped().report();
+ const DynamicCastClosureOptProvided().report();
+ const DynamicCastClosureNamedSkipped().report();
+ const DynamicCastClosureNamedProvided().report();
+ const DynamicDefFunction().report();
+ const DynamicDefFunctionOptSkipped().report();
+ const DynamicDefFunctionOptProvided().report();
+ const DynamicDefFunctionNamedSkipped().report();
+ const DynamicDefFunctionNamedProvided().report();
+ const DynamicDefClosure().report();
+ const DynamicDefClosureOptSkipped().report();
+ const DynamicDefClosureOptProvided().report();
+ const DynamicDefClosureNamedSkipped().report();
+ const DynamicDefClosureNamedProvided().report();
+ const DynamicClassASingleton().report();
+ const DynamicClassBSingleton().report();
+ const DynamicClassCFresh().report();
+ const DynamicClassDFresh().report();
+}
+
+@pragma('vm:never-inline')
+void f1(String s) {}
+@pragma('vm:never-inline')
+Function(String) c1 = (String s) => {};
+@pragma('vm:never-inline')
+void f2(String s, [String t = 'default']) {}
+@pragma('vm:never-inline')
+Function(String, [String]) c2 = (String s, [String t = 'default']) => {};
+@pragma('vm:never-inline')
+void f3(String s, {String t = 'default'}) {}
+@pragma('vm:never-inline')
+Function(String, {String t}) c3 = (String s, {String t = 'default'}) => {};
+@pragma('vm:never-inline')
+dynamic df1 = f1 as dynamic;
+@pragma('vm:never-inline')
+dynamic dc1 = c1 as dynamic;
+@pragma('vm:never-inline')
+dynamic df2 = f2 as dynamic;
+@pragma('vm:never-inline')
+dynamic dc2 = c2 as dynamic;
+@pragma('vm:never-inline')
+dynamic df3 = f3 as dynamic;
+@pragma('vm:never-inline')
+dynamic dc3 = c3 as dynamic;
+@pragma('vm:never-inline')
+dynamic df1NonCast(dynamic s) {}
+@pragma('vm:never-inline')
+Function dc1NonCast = (dynamic s) => {};
+@pragma('vm:never-inline')
+dynamic df2NonCast(dynamic s, [dynamic t = 'default']) {}
+@pragma('vm:never-inline')
+Function dc2NonCast = (dynamic s, [dynamic t = 'default']) => {};
+@pragma('vm:never-inline')
+dynamic df3NonCast(dynamic s, {dynamic t = 'default'}) {}
+@pragma('vm:never-inline')
+Function dc3NonCast = (dynamic s, {dynamic t = 'default'}) => {};
+
+class A {
+ const A();
+}
+
+class B extends A {
+ const B();
+}
+
+@pragma('vm:never-inline')
+dynamic k = (A a) {};
+
+class C {
+ C();
+}
+
+class D extends C {
+ D();
+}
+
+@pragma('vm:never-inline')
+dynamic j = (C c) {};
+
+class NonDynamicFunction extends BenchmarkBase {
+ const NonDynamicFunction() : super('Dynamic.NonDynamicFunction');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ f1('');
+ }
+ }
+}
+
+class NonDynamicClosure extends BenchmarkBase {
+ const NonDynamicClosure() : super('Dynamic.NonDynamicClosure');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ c1('');
+ }
+ }
+}
+
+class NonDynamicFunctionOptSkipped extends BenchmarkBase {
+ const NonDynamicFunctionOptSkipped()
+ : super('Dynamic.NonDynamicFunctionOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ f2('');
+ }
+ }
+}
+
+class NonDynamicFunctionOptProvided extends BenchmarkBase {
+ const NonDynamicFunctionOptProvided()
+ : super('Dynamic.NonDynamicFunctionOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ f2('', '');
+ }
+ }
+}
+
+class NonDynamicFunctionNamedSkipped extends BenchmarkBase {
+ const NonDynamicFunctionNamedSkipped()
+ : super('Dynamic.NonDynamicFunctionNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ f3('');
+ }
+ }
+}
+
+class NonDynamicFunctionNamedProvided extends BenchmarkBase {
+ const NonDynamicFunctionNamedProvided()
+ : super('Dynamic.NonDynamicFunctionNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ f3('', t: '');
+ }
+ }
+}
+
+class NonDynamicClosureOptSkipped extends BenchmarkBase {
+ const NonDynamicClosureOptSkipped()
+ : super('Dynamic.NonDynamicClosureOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ c2('');
+ }
+ }
+}
+
+class NonDynamicClosureOptProvided extends BenchmarkBase {
+ const NonDynamicClosureOptProvided()
+ : super('Dynamic.NonDynamicClosureOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ c2('', '');
+ }
+ }
+}
+
+class NonDynamicClosureNamedSkipped extends BenchmarkBase {
+ const NonDynamicClosureNamedSkipped()
+ : super('Dynamic.NonDynamicClosureNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ c3('');
+ }
+ }
+}
+
+class NonDynamicClosureNamedProvided extends BenchmarkBase {
+ const NonDynamicClosureNamedProvided()
+ : super('Dynamic.NonDynamicClosureNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ c3('', t: '');
+ }
+ }
+}
+
+class DynamicCastFunction extends BenchmarkBase {
+ const DynamicCastFunction() : super('Dynamic.DynamicCastFunction');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df1('');
+ }
+ }
+}
+
+class DynamicCastClosure extends BenchmarkBase {
+ const DynamicCastClosure() : super('Dynamic.DynamicCastClosure');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc1('');
+ }
+ }
+}
+
+class DynamicCastFunctionOptSkipped extends BenchmarkBase {
+ const DynamicCastFunctionOptSkipped()
+ : super('Dynamic.DynamicCastFunctionOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df2('');
+ }
+ }
+}
+
+class DynamicCastFunctionOptProvided extends BenchmarkBase {
+ const DynamicCastFunctionOptProvided()
+ : super('Dynamic.DynamicCastFunctionOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df2('', '');
+ }
+ }
+}
+
+class DynamicCastFunctionNamedSkipped extends BenchmarkBase {
+ const DynamicCastFunctionNamedSkipped()
+ : super('Dynamic.DynamicCastFunctionNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df3('');
+ }
+ }
+}
+
+class DynamicCastFunctionNamedProvided extends BenchmarkBase {
+ const DynamicCastFunctionNamedProvided()
+ : super('Dynamic.DynamicCastFunctionNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df3('', t: '');
+ }
+ }
+}
+
+class DynamicCastClosureOptSkipped extends BenchmarkBase {
+ const DynamicCastClosureOptSkipped()
+ : super('Dynamic.DynamicCastClosureOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc2('');
+ }
+ }
+}
+
+class DynamicCastClosureOptProvided extends BenchmarkBase {
+ const DynamicCastClosureOptProvided()
+ : super('Dynamic.DynamicCastClosureOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc2('', '');
+ }
+ }
+}
+
+class DynamicCastClosureNamedSkipped extends BenchmarkBase {
+ const DynamicCastClosureNamedSkipped()
+ : super('Dynamic.DynamicCastClosureNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc3('');
+ }
+ }
+}
+
+class DynamicCastClosureNamedProvided extends BenchmarkBase {
+ const DynamicCastClosureNamedProvided()
+ : super('Dynamic.DynamicCastClosureNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc3('', t: '');
+ }
+ }
+}
+
+class DynamicDefFunction extends BenchmarkBase {
+ const DynamicDefFunction() : super('Dynamic.DynamicDefFunction');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df1NonCast('');
+ }
+ }
+}
+
+class DynamicDefClosure extends BenchmarkBase {
+ const DynamicDefClosure() : super('Dynamic.DynamicDefClosure');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc1NonCast('');
+ }
+ }
+}
+
+class DynamicDefFunctionOptSkipped extends BenchmarkBase {
+ const DynamicDefFunctionOptSkipped()
+ : super('Dynamic.DynamicDefFunctionOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df2NonCast('');
+ }
+ }
+}
+
+class DynamicDefFunctionOptProvided extends BenchmarkBase {
+ const DynamicDefFunctionOptProvided()
+ : super('Dynamic.DynamicDefFunctionOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df2NonCast('', '');
+ }
+ }
+}
+
+class DynamicDefFunctionNamedSkipped extends BenchmarkBase {
+ const DynamicDefFunctionNamedSkipped()
+ : super('Dynamic.DynamicDefFunctionNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df3NonCast('');
+ }
+ }
+}
+
+class DynamicDefFunctionNamedProvided extends BenchmarkBase {
+ const DynamicDefFunctionNamedProvided()
+ : super('Dynamic.DynamicDefFunctionNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ df3NonCast('', t: '');
+ }
+ }
+}
+
+class DynamicDefClosureOptSkipped extends BenchmarkBase {
+ const DynamicDefClosureOptSkipped()
+ : super('Dynamic.DynamicDefClosureOptSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc2NonCast('');
+ }
+ }
+}
+
+class DynamicDefClosureOptProvided extends BenchmarkBase {
+ const DynamicDefClosureOptProvided()
+ : super('Dynamic.DynamicDefClosureOptProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc2NonCast('', '');
+ }
+ }
+}
+
+class DynamicDefClosureNamedSkipped extends BenchmarkBase {
+ const DynamicDefClosureNamedSkipped()
+ : super('Dynamic.DynamicDefClosureNamedSkipped');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc3NonCast('');
+ }
+ }
+}
+
+class DynamicDefClosureNamedProvided extends BenchmarkBase {
+ const DynamicDefClosureNamedProvided()
+ : super('Dynamic.DynamicDefClosureNamedProvided');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ dc3NonCast('', t: '');
+ }
+ }
+}
+
+class DynamicClassASingleton extends BenchmarkBase {
+ final A a;
+ const DynamicClassASingleton()
+ : a = const A(),
+ super('Dynamic.DynamicClassASingleton');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ k(a);
+ }
+ }
+}
+
+class DynamicClassBSingleton extends BenchmarkBase {
+ final B b;
+ const DynamicClassBSingleton()
+ : b = const B(),
+ super('Dynamic.DynamicClassBSingleton');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ k(b);
+ }
+ }
+}
+
+class DynamicClassCFresh extends BenchmarkBase {
+ const DynamicClassCFresh() : super('Dynamic.DynamicClassCFresh');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ j(C());
+ }
+ }
+}
+
+class DynamicClassDFresh extends BenchmarkBase {
+ const DynamicClassDFresh() : super('Dynamic.DynamicClassDFresh');
+
+ @override
+ void run() {
+ for (int i = 0; i < kRepeat; i++) {
+ j(D());
+ }
+ }
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart b/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart
index d12f07d..b9bfecb 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart
@@ -6,7 +6,9 @@
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/correction/fix/data_driven/transform.dart';
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set.dart';
+import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_manager.dart';
import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer_plugin/utilities/change_builder/change_builder_core.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:meta/meta.dart';
@@ -26,22 +28,13 @@
// invalid suggestions.
importedUris.add(importElement.uri);
}
- for (var set in _availableTransformSets) {
+ for (var set in _availableTransformSetsForLibrary(library)) {
for (var transform in set.transformsFor(name, importedUris)) {
yield DataDrivenFix(transform);
}
}
}
- List<TransformSet> get _availableTransformSets {
- if (transformSetsForTests != null) {
- return transformSetsForTests;
- }
- // TODO(brianwilkerson) This data needs to be cached somewhere and updated
- // when the `package_config.json` file for an analysis context is modified.
- return <TransformSet>[];
- }
-
/// Return the name of the element that was changed.
String get _name {
var node = this.node;
@@ -69,6 +62,15 @@
return null;
}
+ /// Return the transform sets that are available for fixing issues in the
+ /// given [library].
+ List<TransformSet> _availableTransformSetsForLibrary(LibraryElement library) {
+ if (transformSetsForTests != null) {
+ return transformSetsForTests;
+ }
+ return TransformSetManager.instance.forLibrary(library);
+ }
+
/// Return an instance of this class. Used as a tear-off in `FixProcessor`.
static DataDriven newInstance() => DataDriven();
}
diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_manager.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_manager.dart
new file mode 100644
index 0000000..a4a3f55
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_manager.dart
@@ -0,0 +1,56 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set.dart';
+import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_parser.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/file_system/file_system.dart';
+
+/// An object used to manage the transform sets.
+class TransformSetManager {
+ /// The single instance of this class.
+ static final TransformSetManager instance = TransformSetManager._();
+
+ /// The name of the data file.
+ static const String _dataFileName = 'fix_data.yaml';
+
+ /// Initialize a newly created transform set manager.
+ TransformSetManager._();
+
+ /// Return the transform sets associated with the [library].
+ List<TransformSet> forLibrary(LibraryElement library) {
+ var transformSets = <TransformSet>[];
+ var workspace = library.session.analysisContext.workspace;
+ var libraryPath = library.source.fullName;
+ var package = workspace.findPackageFor(libraryPath);
+ var packageMap = package.packagesAvailableTo(libraryPath);
+ for (var entry in packageMap.entries) {
+ var directory = entry.value[0];
+ var file = directory.getChildAssumingFile(_dataFileName);
+ var transformSet = _loadTransformSet(file);
+ if (transformSet != null) {
+ transformSets.add(transformSet);
+ }
+ }
+ // TODO(brianwilkerson) Consider looking for a data file in the SDK.
+ return transformSets;
+ }
+
+ /// Read the [file] and parse the content. Return the transform set that was
+ /// parsed, or `null` if the file doesn't exist, isn't readable, or if the
+ /// content couldn't be parsed.
+ TransformSet _loadTransformSet(File file) {
+ try {
+ // TODO(brianwilkerson) Consider caching the transform sets.
+ var content = file.readAsStringSync();
+ var parser = TransformSetParser(ErrorReporter(
+ AnalysisErrorListener.NULL_LISTENER, file.createSource()));
+ return parser.parse(content);
+ } on FileSystemException {
+ // Fall through to return `null`.
+ }
+ return null;
+ }
+}
diff --git a/pkg/analysis_server/test/src/cider/cider_service.dart b/pkg/analysis_server/test/src/cider/cider_service.dart
index b08f2f2..2fe6e3a 100644
--- a/pkg/analysis_server/test/src/cider/cider_service.dart
+++ b/pkg/analysis_server/test/src/cider/cider_service.dart
@@ -54,7 +54,8 @@
logger = PerformanceLog(logBuffer);
sdk = MockSdk(resourceProvider: resourceProvider);
- newFile('/workspace/WORKSPACE', content: '');
+ newFile('/workspace/WORKSPACE');
+ newFile('/workspace/dart/test/BUILD');
createFileResolver();
}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/test_all.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/test_all.dart
index b6be18f..aeb109f 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/test_all.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/test_all.dart
@@ -8,6 +8,7 @@
import 'diagnostics/test_all.dart' as diagnostics;
import 'modify_parameters_test.dart' as modify_parameters;
import 'rename_test.dart' as rename_change;
+import 'transform_set_manager_test.dart' as transform_set_manager;
import 'transform_set_parser_test.dart' as transform_set_parser;
void main() {
@@ -16,6 +17,7 @@
diagnostics.main();
modify_parameters.main();
rename_change.main();
+ transform_set_manager.main();
transform_set_parser.main();
});
}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_manager_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_manager_test.dart
new file mode 100644
index 0000000..1e29672
--- /dev/null
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_manager_test.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_manager.dart';
+import 'package:matcher/matcher.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../../../../../abstract_context.dart';
+
+void main() {
+ defineReflectiveSuite(() {
+ defineReflectiveTests(TransformSetManagerTest);
+ });
+}
+
+@reflectiveTest
+class TransformSetManagerTest extends AbstractContextTest {
+ TransformSetManager manager = TransformSetManager.instance;
+
+ void test_twoFiles() async {
+ _addDataFile('p1');
+ _addDataFile('p2');
+ addSource('/home/test/pubspec.yaml', '');
+ var testSource = addSource('/home/test/lib/test.dart', '');
+ var result = await session.getResolvedLibrary(testSource.fullName);
+ var sets = manager.forLibrary(result.element);
+ expect(sets, hasLength(2));
+ }
+
+ void test_zeroFiles() async {
+ addTestPackageDependency('p1', '/.pub-cache/p1');
+ addTestPackageDependency('p2', '/.pub-cache/p2');
+ addSource('/home/test/pubspec.yaml', '');
+ var testSource = addSource('/home/test/lib/test.dart', '');
+ var result = await session.getResolvedLibrary(testSource.fullName);
+ var sets = manager.forLibrary(result.element);
+ expect(sets, hasLength(0));
+ }
+
+ void _addDataFile(String packageName) {
+ addPackageFile(packageName, 'fix_data.yaml', '''
+version: 1
+transforms:
+- title: 'Rename A'
+ element:
+ uris:
+ - 'test.dart'
+ components:
+ - 'A'
+ changes:
+ - kind: 'rename'
+ newName: 'B'
+''');
+ }
+}
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index f58b06e..57401d2 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -16,7 +16,6 @@
import 'package:analyzer/src/dart/ast/to_source_visitor.dart';
import 'package:analyzer/src/dart/ast/token.dart';
import 'package:analyzer/src/dart/element/element.dart';
-import 'package:analyzer/src/dart/element/type.dart';
import 'package:analyzer/src/fasta/token_utils.dart' as util show findPrevious;
import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine;
import 'package:analyzer/src/generated/engine.dart';
@@ -2167,7 +2166,7 @@
DartType readType;
@override
- DartType writeType = DynamicTypeImpl.instance;
+ DartType writeType;
}
/// A conditional expression.
diff --git a/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart
index 3711c65..2d4ef65 100644
--- a/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart
@@ -77,14 +77,13 @@
left?.accept(_resolver);
left = node.leftHandSide;
- TokenType operator = node.operator.type;
- if (left is! IndexExpression &&
- left is! PrefixedIdentifier &&
- left is! PropertyAccess &&
- left is! SimpleIdentifier) {
- if (operator != TokenType.EQ) {
+ var operator = node.operator.type;
+ if (operator != TokenType.EQ) {
+ if (node.readElement == null || node.readType == null) {
_resolver.setReadElement(left, null);
}
+ }
+ if (node.writeElement == null || node.writeType == null) {
_resolver.setWriteElement(left, null);
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart
index 6468d25..ebe40fd 100644
--- a/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart
@@ -55,12 +55,26 @@
node.operand.accept(_resolver);
- var receiverType = getReadType(
- node.operand,
- );
+ var operand = node.operand;
+ if (operand is SimpleIdentifier) {
+ var element = operand.staticElement;
+ // ElementResolver does not set it.
+ if (element is VariableElement) {
+ _resolver.setReadElement(operand, element);
+ _resolver.setWriteElement(operand, element);
+ }
+ }
+
+ if (node.readElement == null || node.readType == null) {
+ _resolver.setReadElement(operand, null);
+ }
+ if (node.writeElement == null || node.writeType == null) {
+ _resolver.setWriteElement(operand, null);
+ }
_assignmentShared.checkFinalAlreadyAssigned(node.operand);
+ var receiverType = node.readType;
_resolve1(node, receiverType);
_resolve2(node, receiverType);
}
diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart
index 56baebc..d45a6c0 100644
--- a/pkg/analyzer/lib/src/error/codes.dart
+++ b/pkg/analyzer/lib/src/error/codes.dart
@@ -2897,7 +2897,7 @@
// void m() {}
// }
// f() {
- // E(3)[!..!]m();
+ // [!E!](3)..m();
// }
// ```
//
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index 8b3ae89..637b99b1 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -509,6 +509,21 @@
Element prefixElement = prefix.staticElement;
if (prefixElement is PrefixElement) {
var lookupResult = prefixElement.scope.lookup2(identifier.name);
+
+ if (identifier.inGetterContext()) {
+ _resolver.setReadElement(
+ node,
+ _resolver.toLegacyElement(lookupResult.getter),
+ );
+ }
+
+ if (identifier.inSetterContext()) {
+ _resolver.setWriteElement(
+ node,
+ _resolver.toLegacyElement(lookupResult.setter),
+ );
+ }
+
var element = lookupResult.getter;
if (element == null && identifier.inSetterContext()) {
element = lookupResult.setter;
@@ -747,19 +762,16 @@
_resolver.setWriteElement(node, element);
+ Element getter;
var inGetterContext = node.inGetterContext();
if (inGetterContext) {
if (element is PropertyAccessorElement &&
element.enclosingElement is CompilationUnitElement) {
- _resolver.setReadElement(node, element.variable.getter);
- } else {
- _resolver.setReadElement(node, null);
+ getter = element.variable.getter;
}
}
- if (node.inSetterContext() &&
- inGetterContext &&
- enclosingClass != null) {
+ if (node.inSetterContext() && inGetterContext && enclosingClass != null) {
InterfaceType enclosingType = enclosingClass.thisType;
var result = _typePropertyResolver.resolve(
receiver: null,
@@ -771,8 +783,13 @@
node.auxiliaryElements = AuxiliaryElements(
result.getter,
);
- _resolver.setReadElement(node, result.getter);
+ getter ??= result.getter;
}
+
+ if (inGetterContext) {
+ _resolver.setReadElement(node, getter);
+ }
+
//
// Validate annotation element.
//
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 6038680..901e787 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -573,24 +573,28 @@
}
void setReadElement(Expression node, Element element) {
+ DartType readType = DynamicTypeImpl.instance;
+ if (node is IndexExpression) {
+ if (element is MethodElement) {
+ readType = element.returnType;
+ }
+ } else if (node is PrefixedIdentifier ||
+ node is PropertyAccess ||
+ node is SimpleIdentifier) {
+ if (element is PropertyAccessorElement && element.isGetter) {
+ readType = element.returnType;
+ } else if (element is VariableElement) {
+ readType = localVariableTypeProvider.getType(node);
+ }
+ }
+
var parent = node.parent;
if (parent is AssignmentExpressionImpl && parent.leftHandSide == node) {
parent.readElement = element;
-
- DartType readType = DynamicTypeImpl.instance;
- if (node is IndexExpression) {
- if (element is MethodElement) {
- readType = element.returnType;
- }
- } else if (node is PrefixedIdentifier ||
- node is PropertyAccess ||
- node is SimpleIdentifier) {
- if (element is PropertyAccessorElement && element.isGetter) {
- readType = element.returnType;
- } else if (element is VariableElement) {
- readType = localVariableTypeProvider.getType(node);
- }
- }
+ parent.readType = readType;
+ } else if (parent is PostfixExpressionImpl &&
+ parent.operator.type.isIncrementOperator) {
+ parent.readElement = element;
parent.readType = readType;
}
}
@@ -601,34 +605,38 @@
}
void setWriteElement(Expression node, Element element) {
+ DartType writeType = DynamicTypeImpl.instance;
+ if (node is IndexExpression) {
+ if (element is MethodElement) {
+ var parameters = element.parameters;
+ if (parameters.length == 2) {
+ writeType = parameters[1].type;
+ }
+ }
+ } else if (node is PrefixedIdentifier ||
+ node is PropertyAccess ||
+ node is SimpleIdentifier) {
+ if (element is PropertyAccessorElement && element.isSetter) {
+ if (element.isSynthetic) {
+ writeType = element.variable.type;
+ } else {
+ var parameters = element.parameters;
+ if (parameters.length == 1) {
+ writeType = parameters[0].type;
+ }
+ }
+ } else if (element is VariableElement) {
+ writeType = element.type;
+ }
+ }
+
var parent = node.parent;
if (parent is AssignmentExpressionImpl && parent.leftHandSide == node) {
parent.writeElement = element;
-
- DartType writeType = DynamicTypeImpl.instance;
- if (node is IndexExpression) {
- if (element is MethodElement) {
- var parameters = element.parameters;
- if (parameters.length == 2) {
- writeType = parameters[1].type;
- }
- }
- } else if (node is PrefixedIdentifier ||
- node is PropertyAccess ||
- node is SimpleIdentifier) {
- if (element is PropertyAccessorElement && element.isSetter) {
- if (element.isSynthetic) {
- writeType = element.variable.type;
- } else {
- var parameters = element.parameters;
- if (parameters.length == 1) {
- writeType = parameters[0].type;
- }
- }
- } else if (element is VariableElement) {
- writeType = element.type;
- }
- }
+ parent.writeType = writeType;
+ } else if (parent is PostfixExpressionImpl &&
+ parent.operator.type.isIncrementOperator) {
+ parent.writeElement = element;
parent.writeType = writeType;
}
}
diff --git a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
index 7aed8b1..8bd22e9 100644
--- a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
@@ -204,6 +204,86 @@
assertType(indexed, 'double');
}
+ test_indexExpression_instance_compound() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int operator[](int index) => 0;
+ operator[]=(int index, num _) {}
+}
+
+void f(A a) {
+ a[0] += 2;
+}
+''');
+
+ assertAssignment(
+ findNode.assignment('[0] += 2'),
+ readElement: findElement.method('[]'),
+ readType: 'int',
+ writeElement: findElement.method('[]='),
+ writeType: 'num',
+ operatorElement: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+ }
+
+ test_indexExpression_super_compound() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int operator[](int index) => 0;
+ operator[]=(int index, num _) {}
+}
+
+class B extends A {
+ void f(A a) {
+ this[0] += 2;
+ }
+}
+''');
+
+ assertAssignment(
+ findNode.assignment('[0] += 2'),
+ readElement: findElement.method('[]'),
+ readType: 'int',
+ writeElement: findElement.method('[]='),
+ writeType: 'num',
+ operatorElement: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+ }
+
+ test_indexExpression_this_compound() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int operator[](int index) => 0;
+ operator[]=(int index, num _) {}
+
+ void f(A a) {
+ this[0] += 2;
+ }
+}
+''');
+
+ assertAssignment(
+ findNode.assignment('[0] += 2'),
+ readElement: findElement.method('[]'),
+ readType: 'int',
+ writeElement: findElement.method('[]='),
+ writeType: 'num',
+ operatorElement: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+ }
+
test_notLValue_parenthesized_compound() async {
await assertErrorsInCode(r'''
void f(int a, int b, double c) {
@@ -287,6 +367,122 @@
assertTypeArgumentTypes(findNode.methodInvocation('f()'), ['int$question']);
}
+ test_prefixedIdentifier_instance_compound() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int get x => 0;
+ set x(num _) {}
+}
+
+void f(A a) {
+ a.x += 2;
+}
+''');
+
+ var assignment = findNode.assignment('x += 2');
+ assertAssignment(
+ assignment,
+ readElement: findElement.getter('x'),
+ readType: 'int',
+ writeElement: findElement.setter('x'),
+ writeType: 'num',
+ operatorElement: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+
+ var prefixed = assignment.leftHandSide as PrefixedIdentifier;
+ assertSimpleIdentifier(
+ prefixed.identifier,
+ readElement: findElement.getter('x'),
+ writeElement: findElement.setter('x'),
+ type: 'num',
+ );
+
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_prefixedIdentifier_topLevel_compound() async {
+ newFile('$testPackageLibPath/a.dart', content: r'''
+int get x => 0;
+set x(num _) {}
+''');
+ await assertNoErrorsInCode(r'''
+import 'a.dart' as p;
+
+void f() {
+ p.x += 2;
+}
+''');
+
+ var importFind = findElement.importFind('package:test/a.dart');
+
+ var assignment = findNode.assignment('x += 2');
+ assertAssignment(
+ assignment,
+ readElement: importFind.topGet('x'),
+ readType: 'int',
+ writeElement: importFind.topSet('x'),
+ writeType: 'num',
+ operatorElement: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+
+ var prefixed = assignment.leftHandSide as PrefixedIdentifier;
+ assertImportPrefix(prefixed.prefix, importFind.prefix);
+
+ assertSimpleIdentifier(
+ prefixed.identifier,
+ readElement: importFind.topGet('x'),
+ writeElement: importFind.topSet('x'),
+ type: 'num',
+ );
+
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_propertyAccess_cascade_compound() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int get x => 0;
+ set x(num _) {}
+}
+
+void f(A a) {
+ a..x += 2;
+}
+''');
+
+ var assignment = findNode.assignment('x += 2');
+ assertAssignment(
+ assignment,
+ readElement: findElement.getter('x'),
+ readType: 'int',
+ writeElement: findElement.setter('x'),
+ writeType: 'num',
+ operatorElement: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+
+ var propertyAccess = assignment.leftHandSide as PropertyAccess;
+ assertSimpleIdentifier(
+ propertyAccess.propertyName,
+ readElement: findElement.getter('x'),
+ writeElement: findElement.setter('x'),
+ type: 'num',
+ );
+
+ assertType(assignment.rightHandSide, 'int');
+ }
+
test_propertyAccess_forwardingStub() async {
await resolveTestCode(r'''
class A {
@@ -319,6 +515,123 @@
assertType(right, 'int');
}
+ test_propertyAccess_instance_compound() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int get x => 0;
+ set x(num _) {}
+}
+
+void f() {
+ A().x += 2;
+}
+''');
+
+ var assignment = findNode.assignment('x += 2');
+ assertAssignment(
+ assignment,
+ readElement: findElement.getter('x'),
+ readType: 'int',
+ writeElement: findElement.setter('x'),
+ writeType: 'num',
+ operatorElement: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+
+ var propertyAccess = assignment.leftHandSide as PropertyAccess;
+ assertSimpleIdentifier(
+ propertyAccess.propertyName,
+ readElement: findElement.getter('x'),
+ writeElement: findElement.setter('x'),
+ type: 'num',
+ );
+
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_propertyAccess_super_compound() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ set x(num _) {}
+ int get x => 0;
+}
+
+class B extends A {
+ set x(num _) {}
+ int get x => 0;
+
+ void f() {
+ super.x += 2;
+ }
+}
+''');
+
+ var assignment = findNode.assignment('x += 2');
+ assertAssignment(
+ assignment,
+ readElement: findElement.getter('x', of: 'A'),
+ readType: 'int',
+ writeElement: findElement.setter('x', of: 'A'),
+ writeType: 'num',
+ operatorElement: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+
+ var propertyAccess = assignment.leftHandSide as PropertyAccess;
+ assertSuperExpression(propertyAccess.target);
+ assertSimpleIdentifier(
+ propertyAccess.propertyName,
+ readElement: findElement.getter('x', of: 'A'),
+ writeElement: findElement.setter('x', of: 'A'),
+ type: 'num',
+ );
+
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_propertyAccess_this_compound() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int get x => 0;
+ set x(num _) {}
+
+ void f() {
+ this.x += 2;
+ }
+}
+''');
+
+ var assignment = findNode.assignment('x += 2');
+ assertAssignment(
+ assignment,
+ readElement: findElement.getter('x'),
+ readType: 'int',
+ writeElement: findElement.setter('x'),
+ writeType: 'num',
+ operatorElement: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+
+ var propertyAccess = assignment.leftHandSide as PropertyAccess;
+ assertSimpleIdentifier(
+ propertyAccess.propertyName,
+ readElement: findElement.getter('x'),
+ writeElement: findElement.setter('x'),
+ type: 'num',
+ );
+
+ assertType(assignment.rightHandSide, 'int');
+ }
+
test_simple_indexExpression() async {
await resolveTestCode(r'''
main() {
@@ -1149,6 +1462,42 @@
assertType(assignment.rightHandSide, 'int');
}
+ test_simpleIdentifier_topGetter_topSetter_fromClass_compound() async {
+ await assertNoErrorsInCode('''
+int get x => 0;
+set x(num _) {}
+
+class A {
+ void f() {
+ x += 2;
+ }
+}
+''');
+
+ var assignment = findNode.assignment('x += 2');
+ assertAssignment(
+ assignment,
+ readElement: findElement.topGet('x'),
+ readType: 'int',
+ writeElement: findElement.topSet('x'),
+ writeType: 'num',
+ operatorElement: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+
+ assertSimpleIdentifier(
+ assignment.leftHandSide,
+ readElement: findElement.topGet('x'),
+ writeElement: findElement.topSet('x'),
+ type: 'num',
+ );
+
+ assertType(assignment.rightHandSide, 'int');
+ }
+
test_simpleIdentifier_topLevelVariable_simple() async {
await assertNoErrorsInCode(r'''
num x = 0;
diff --git a/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart
index 8c17161..865a89e 100644
--- a/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart
@@ -2,8 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
+import 'package:analyzer/src/error/codes.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -18,15 +20,19 @@
@reflectiveTest
class PostfixExpressionResolutionTest extends PubPackageResolutionTest {
- test_dec_localVariable() async {
+ test_dec_simpleIdentifier_parameter_int() async {
await assertNoErrorsInCode(r'''
-f(int x) {
+void f(int x) {
x--;
}
''');
assertPostfixExpression(
findNode.postfix('x--'),
+ readElement: findElement.parameter('x'),
+ readType: 'int',
+ writeElement: findElement.parameter('x'),
+ writeType: 'int',
element: elementMatcher(
numElement.getMethod('-'),
isLegacy: isNullSafetySdkAndLegacyLibrary,
@@ -35,15 +41,258 @@
);
}
- test_inc_double() async {
+ test_inc_indexExpression_instance() async {
await assertNoErrorsInCode(r'''
-f(double x) {
+class A {
+ int operator[](int index) => 0;
+ operator[]=(int index, num _) {}
+}
+
+void f(A a) {
+ a[0]++;
+}
+''');
+
+ assertPostfixExpression(
+ findNode.postfix('a[0]++'),
+ readElement: findElement.method('[]'),
+ readType: 'int',
+ writeElement: findElement.method('[]='),
+ writeType: 'num',
+ element: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+ }
+
+ test_inc_indexExpression_super() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int operator[](int index) => 0;
+ operator[]=(int index, num _) {}
+}
+
+class B extends A {
+ void f(A a) {
+ super[0]++;
+ }
+}
+''');
+
+ assertPostfixExpression(
+ findNode.postfix('[0]++'),
+ readElement: findElement.method('[]'),
+ readType: 'int',
+ writeElement: findElement.method('[]='),
+ writeType: 'num',
+ element: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+ }
+
+ test_inc_indexExpression_this() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int operator[](int index) => 0;
+ operator[]=(int index, num _) {}
+
+ void f() {
+ this[0]++;
+ }
+}
+''');
+
+ assertPostfixExpression(
+ findNode.postfix('[0]++'),
+ readElement: findElement.method('[]'),
+ readType: 'int',
+ writeElement: findElement.method('[]='),
+ writeType: 'num',
+ element: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+ }
+
+ test_inc_notLValue_parenthesized() async {
+ await assertErrorsInCode(r'''
+void f() {
+ (0)++;
+}
+''', [
+ error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 16, 2),
+ ]);
+
+ assertPostfixExpression(
+ findNode.postfix('(0)++'),
+ readElement: null,
+ readType: 'dynamic',
+ writeElement: null,
+ writeType: 'dynamic',
+ element: null,
+ type: 'dynamic',
+ );
+ }
+
+ test_inc_prefixedIdentifier_instance() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int x = 0;
+}
+
+void f(A a) {
+ a.x++;
+}
+''');
+
+ assertPostfixExpression(
+ findNode.postfix('x++'),
+ readElement: findElement.getter('x'),
+ readType: 'int',
+ writeElement: findElement.setter('x'),
+ writeType: 'int',
+ element: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+ }
+
+ test_inc_prefixedIdentifier_topLevel() async {
+ newFile('$testPackageLibPath/a.dart', content: r'''
+int x = 0;
+''');
+ await assertNoErrorsInCode(r'''
+import 'a.dart' as p;
+
+void f() {
+ p.x++;
+}
+''');
+
+ var importFind = findElement.importFind('package:test/a.dart');
+
+ var postfix = findNode.postfix('x++');
+ assertPostfixExpression(
+ postfix,
+ readElement: importFind.topGet('x'),
+ readType: 'int',
+ writeElement: importFind.topSet('x'),
+ writeType: 'int',
+ element: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+
+ var prefixed = postfix.operand as PrefixedIdentifier;
+ assertImportPrefix(prefixed.prefix, importFind.prefix);
+ }
+
+ test_inc_propertyAccess_instance() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int x = 0;
+}
+
+void f() {
+ A().x++;
+}
+''');
+
+ assertPostfixExpression(
+ findNode.postfix('x++'),
+ readElement: findElement.getter('x'),
+ readType: 'int',
+ writeElement: findElement.setter('x'),
+ writeType: 'int',
+ element: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+ }
+
+ test_inc_propertyAccess_super() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ set x(num _) {}
+ int get x => 0;
+}
+
+class B extends A {
+ set x(num _) {}
+ int get x => 0;
+
+ void f() {
+ super.x++;
+ }
+}
+''');
+
+ assertPostfixExpression(
+ findNode.postfix('x++'),
+ readElement: findElement.getter('x', of: 'A'),
+ readType: 'int',
+ writeElement: findElement.setter('x', of: 'A'),
+ writeType: 'num',
+ element: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+ }
+
+ test_inc_propertyAccess_this() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ set x(num _) {}
+ int get x => 0;
+
+ void f() {
+ this.x++;
+ }
+}
+''');
+
+ assertPostfixExpression(
+ findNode.postfix('x++'),
+ readElement: findElement.getter('x'),
+ readType: 'int',
+ writeElement: findElement.setter('x'),
+ writeType: 'num',
+ element: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+ }
+
+ test_inc_simpleIdentifier_parameter_double() async {
+ await assertNoErrorsInCode(r'''
+void f(double x) {
x++;
}
''');
assertPostfixExpression(
findNode.postfix('x++'),
+ readElement: findElement.parameter('x'),
+ readType: 'double',
+ writeElement: findElement.parameter('x'),
+ writeType: 'double',
element: elementMatcher(
doubleElement.getMethod('+'),
isLegacy: isNullSafetySdkAndLegacyLibrary,
@@ -52,15 +301,19 @@
);
}
- test_inc_localVariable() async {
+ test_inc_simpleIdentifier_parameter_int() async {
await assertNoErrorsInCode(r'''
-f(int x) {
+void f(int x) {
x++;
}
''');
assertPostfixExpression(
findNode.postfix('x++'),
+ readElement: findElement.parameter('x'),
+ readType: 'int',
+ writeElement: findElement.parameter('x'),
+ writeType: 'int',
element: elementMatcher(
numElement.getMethod('+'),
isLegacy: isNullSafetySdkAndLegacyLibrary,
@@ -69,15 +322,19 @@
);
}
- test_inc_num() async {
+ test_inc_simpleIdentifier_parameter_num() async {
await assertNoErrorsInCode(r'''
-f(num x) {
+void f(num x) {
x++;
}
''');
assertPostfixExpression(
findNode.postfix('x++'),
+ readElement: findElement.parameter('x'),
+ readType: 'num',
+ writeElement: findElement.parameter('x'),
+ writeType: 'num',
element: elementMatcher(
numElement.getMethod('+'),
isLegacy: isNullSafetySdkAndLegacyLibrary,
@@ -86,45 +343,163 @@
);
}
- test_inc_property_differentTypes() async {
+ test_inc_simpleIdentifier_thisGetter_superSetter() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ set x(num _) {}
+}
+
+class B extends A {
+ int get x => 0;
+ void f() {
+ x++;
+ }
+}
+''');
+
+ var postfix = findNode.postfix('x++');
+ assertPostfixExpression(
+ postfix,
+ readElement: findElement.getter('x'),
+ readType: 'int',
+ writeElement: findElement.setter('x'),
+ writeType: 'num',
+ element: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+
+ assertSimpleIdentifier(
+ postfix.operand,
+ readElement: findElement.getter('x'),
+ writeElement: findElement.setter('x'),
+ type: 'num',
+ );
+ }
+
+ test_inc_simpleIdentifier_topGetter_topSetter() async {
await assertNoErrorsInCode(r'''
int get x => 0;
set x(num _) {}
-f() {
+void f() {
x++;
}
''');
- assertSimpleIdentifier(
- findNode.simple('x++'),
- readElement: findElement.topGet('x'),
- writeElement: findElement.topSet('x'),
- type: 'num',
- );
-
+ var postfix = findNode.postfix('x++');
assertPostfixExpression(
- findNode.postfix('x++'),
+ postfix,
+ readElement: findElement.topGet('x'),
+ readType: 'int',
+ writeElement: findElement.topSet('x'),
+ writeType: 'num',
element: elementMatcher(
numElement.getMethod('+'),
isLegacy: isNullSafetySdkAndLegacyLibrary,
),
type: 'int',
);
+
+ assertSimpleIdentifier(
+ postfix.operand,
+ readElement: findElement.topGet('x'),
+ writeElement: findElement.topSet('x'),
+ type: 'num',
+ );
+ }
+
+ test_inc_simpleIdentifier_topGetter_topSetter_fromClass() async {
+ await assertNoErrorsInCode(r'''
+int get x => 0;
+
+set x(num _) {}
+
+class A {
+ void f() {
+ x++;
+ }
+}
+''');
+
+ var postfix = findNode.postfix('x++');
+ assertPostfixExpression(
+ postfix,
+ readElement: findElement.topGet('x'),
+ readType: 'int',
+ writeElement: findElement.topSet('x'),
+ writeType: 'num',
+ element: elementMatcher(
+ numElement.getMethod('+'),
+ isLegacy: isNullSafetySdkAndLegacyLibrary,
+ ),
+ type: 'int',
+ );
+
+ assertSimpleIdentifier(
+ postfix.operand,
+ readElement: findElement.topGet('x'),
+ writeElement: findElement.topSet('x'),
+ type: 'num',
+ );
+ }
+
+ test_inc_simpleIdentifier_typeLiteral() async {
+ await assertErrorsInCode(r'''
+void f() {
+ int++;
+}
+''', [
+ error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 13, 3),
+ ]);
+
+ assertPostfixExpression(
+ findNode.postfix('int++'),
+ readElement: null,
+ readType: 'dynamic',
+ writeElement: intElement,
+ writeType: 'dynamic',
+ element: null,
+ type: 'dynamic',
+ );
}
}
@reflectiveTest
class PostfixExpressionResolutionWithNullSafetyTest
extends PostfixExpressionResolutionTest with WithNullSafetyMixin {
- test_inc_localVariable_depromote() async {
+ test_inc_propertyAccess_nullShorting() async {
+ await assertNoErrorsInCode(r'''
+class A {
+ int foo = 0;
+}
+
+void f(A? a) {
+ a?.foo++;
+}
+''');
+
+ assertPostfixExpression(
+ findNode.postfix('foo++'),
+ readElement: findElement.getter('foo'),
+ readType: 'int',
+ writeElement: findElement.setter('foo'),
+ writeType: 'int',
+ element: numElement.getMethod('+'),
+ type: 'int?',
+ );
+ }
+
+ test_inc_simpleIdentifier_parameter_depromote() async {
await assertNoErrorsInCode(r'''
class A {
Object operator +(int _) => this;
}
-f(Object x) {
+void f(Object x) {
if (x is A) {
x++;
x; // ref
@@ -136,6 +511,10 @@
assertPostfixExpression(
findNode.postfix('x++'),
+ readElement: findElement.parameter('x'),
+ readType: 'A',
+ writeElement: findElement.parameter('x'),
+ writeType: 'Object',
element: findElement.method('+'),
type: 'A',
);
@@ -143,33 +522,19 @@
assertType(findNode.simple('x; // ref'), 'Object');
}
- test_inc_nullShorting() async {
- await assertNoErrorsInCode(r'''
-class A {
- int foo = 0;
-}
-
-f(A? a) {
- a?.foo++;
-}
-''');
-
- assertPostfixExpression(
- findNode.postfix('foo++'),
- element: numElement.getMethod('+'),
- type: 'int?',
- );
- }
-
test_nullCheck() async {
await assertNoErrorsInCode(r'''
-f(int? x) {
+void f(int? x) {
x!;
}
''');
assertPostfixExpression(
findNode.postfix('x!'),
+ readElement: null,
+ readType: null,
+ writeElement: null,
+ writeType: null,
element: null,
type: 'int',
);
@@ -177,7 +542,7 @@
test_nullCheck_functionExpressionInvocation_rewrite() async {
await assertNoErrorsInCode(r'''
-main(Function f2) {
+void f(Function f2) {
f2(42)!;
}
''');
@@ -185,7 +550,7 @@
test_nullCheck_indexExpression() async {
await assertNoErrorsInCode(r'''
-main(Map<String, int> a) {
+void f(Map<String, int> a) {
int v = a['foo']!;
v;
}
@@ -203,6 +568,10 @@
assertPostfixExpression(
findNode.postfix(']!'),
+ readElement: null,
+ readType: null,
+ writeElement: null,
+ writeType: null,
element: null,
type: 'int',
);
@@ -210,7 +579,7 @@
test_nullCheck_null() async {
await assertNoErrorsInCode('''
-main(Null x) {
+void f(Null x) {
x!;
}
''');
@@ -235,6 +604,10 @@
assertPostfixExpression(
findNode.postfix('f(null)!'),
+ readElement: null,
+ readType: null,
+ writeElement: null,
+ writeType: null,
element: null,
type: 'int',
);
@@ -259,6 +632,10 @@
assertPostfixExpression(
findNode.postfix('super!'),
+ readElement: null,
+ readType: null,
+ writeElement: null,
+ writeType: null,
element: null,
type: 'dynamic',
);
@@ -274,7 +651,7 @@
test_nullCheck_typeParameter() async {
await assertNoErrorsInCode(r'''
-f<T>(T? x) {
+void f<T>(T? x) {
x!;
}
''');
@@ -282,6 +659,10 @@
var postfixExpression = findNode.postfix('x!');
assertPostfixExpression(
postfixExpression,
+ readElement: null,
+ readType: null,
+ writeElement: null,
+ writeType: null,
element: null,
type: 'T',
);
@@ -295,7 +676,7 @@
test_nullCheck_typeParameter_already_promoted() async {
await assertNoErrorsInCode('''
-f<T>(T? x) {
+void f<T>(T? x) {
if (x is num?) {
x!;
}
@@ -305,6 +686,10 @@
var postfixExpression = findNode.postfix('x!');
assertPostfixExpression(
postfixExpression,
+ readElement: null,
+ readType: null,
+ writeElement: null,
+ writeType: null,
element: null,
type: 'T',
);
diff --git a/pkg/analyzer/test/src/dart/resolution/resolution.dart b/pkg/analyzer/test/src/dart/resolution/resolution.dart
index ff64040..9d4bf8d 100644
--- a/pkg/analyzer/test/src/dart/resolution/resolution.dart
+++ b/pkg/analyzer/test/src/dart/resolution/resolution.dart
@@ -103,20 +103,13 @@
@required Object operatorElement,
@required String type,
}) {
- assertElement(node.readElement, readElement);
- if (readType == null) {
- expect(node.readType, isNull);
- } else {
- assertType(node.readType, readType);
- }
-
- assertElement(node.writeElement, writeElement);
- if (writeType == null) {
- expect(node.writeType, isNull);
- } else {
- assertType(node.writeType, writeType);
- }
-
+ assertCompoundAssignment(
+ node,
+ readElement: readElement,
+ readType: readType,
+ writeElement: writeElement,
+ writeType: writeType,
+ );
assertElement(node.staticElement, operatorElement);
assertType(node, type);
}
@@ -156,6 +149,28 @@
assertTypeNull(identifier);
}
+ void assertCompoundAssignment(
+ CompoundAssignmentExpression node, {
+ @required Object readElement,
+ @required String readType,
+ @required Object writeElement,
+ @required String writeType,
+ }) {
+ assertElement(node.readElement, readElement);
+ if (readType == null) {
+ expect(node.readType, isNull);
+ } else {
+ assertType(node.readType, readType);
+ }
+
+ assertElement(node.writeElement, writeElement);
+ if (writeType == null) {
+ expect(node.writeType, isNull);
+ } else {
+ assertType(node.writeType, writeType);
+ }
+ }
+
void assertConstructorElement(
ConstructorElement expected, ConstructorElement actual) {
if (expected is ConstructorMember && actual is ConstructorMember) {
@@ -571,9 +586,20 @@
void assertPostfixExpression(
PostfixExpression node, {
+ @required Object readElement,
+ @required String readType,
+ @required Object writeElement,
+ @required String writeType,
@required Object element,
@required String type,
}) {
+ assertCompoundAssignment(
+ node,
+ readElement: readElement,
+ readType: readType,
+ writeElement: writeElement,
+ writeType: writeType,
+ );
assertElement(node.staticElement, element);
assertType(node, type);
}
diff --git a/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart b/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart
index 0ffba47..01bb301 100644
--- a/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart
@@ -323,6 +323,10 @@
assertPostfixExpression(
findNode.postfix('x++'),
+ readElement: findElement.parameter('x'),
+ readType: 'Never',
+ writeElement: findElement.parameter('x'),
+ writeType: 'Never',
element: null,
type: 'Never',
);
@@ -339,6 +343,10 @@
assertPostfixExpression(
findNode.postfix('x++'),
+ readElement: findElement.parameter('x'),
+ readType: 'Never?',
+ writeElement: findElement.parameter('x'),
+ writeType: 'Never?',
element: null,
type: 'Never?',
);
diff --git a/pkg/analyzer/tool/diagnostics/diagnostics.md b/pkg/analyzer/tool/diagnostics/diagnostics.md
index adfb44f..e0b0db5 100644
--- a/pkg/analyzer/tool/diagnostics/diagnostics.md
+++ b/pkg/analyzer/tool/diagnostics/diagnostics.md
@@ -2364,7 +2364,7 @@
void m() {}
}
f() {
- E(3)[!..!]m();
+ [!E!](3)..m();
}
{% endprettify %}
diff --git a/pkg/dartdev/lib/src/commands/compile.dart b/pkg/dartdev/lib/src/commands/compile.dart
index 4b94bcf..9add920 100644
--- a/pkg/dartdev/lib/src/commands/compile.dart
+++ b/pkg/dartdev/lib/src/commands/compile.dart
@@ -35,8 +35,7 @@
bool checkFile(String sourcePath) {
if (!FileSystemEntity.isFileSync(sourcePath)) {
- stderr.writeln(
- '"$sourcePath" is not a file. See \'--help\' for more information.');
+ stderr.writeln('"$sourcePath" file not found.');
stderr.flush();
return false;
}
@@ -45,7 +44,7 @@
}
class CompileJSCommand extends DartdevCommand<int> {
- CompileJSCommand() : super('js', 'Compile Dart to JavaScript') {
+ CompileJSCommand() : super('js', 'Compile Dart to JavaScript.') {
argParser
..addOption(
commonOptions['outputFile'].flag,
@@ -80,19 +79,20 @@
// We expect a single rest argument; the dart entry point.
if (argResults.rest.length != 1) {
- log.stderr('Missing Dart entry point.');
- printUsage();
- return compileErrorExitCode;
+ // This throws.
+ usageException('Missing Dart entry point.');
}
+
final String sourcePath = argResults.rest[0];
if (!checkFile(sourcePath)) {
- return -1;
+ return 1;
}
VmInteropHandler.run(sdk.dart2jsSnapshot, [
'--libraries-spec=$librariesPath',
...argResults.arguments,
]);
+
return 0;
}
}
@@ -124,10 +124,10 @@
FutureOr<int> run() async {
// We expect a single rest argument; the dart entry point.
if (argResults.rest.length != 1) {
- log.stderr('Missing Dart entry point.');
- printUsage();
- return compileErrorExitCode;
+ // This throws.
+ usageException('Missing Dart entry point.');
}
+
final String sourcePath = argResults.rest[0];
if (!checkFile(sourcePath)) {
return -1;
@@ -175,16 +175,19 @@
)
..addMultiOption('define', abbr: 'D', valueHelp: 'key=value', help: '''
Set values of environment variables. To specify multiple variables, use multiple options or use commas to separate key-value pairs.
-E.g.: dart compile $commandName -Da=1,b=2 main.dart''')
+For example, 'dart compile $commandName -Da=1,b=2 main.dart'.''')
..addFlag('enable-asserts',
negatable: false, help: 'Enable assert statements.')
- ..addOption('packages', abbr: 'p', valueHelp: 'path', help: '''
-Get package locations from the specified file instead of .packages. <path> can be relative or absolute.
-E.g.: dart compile $commandName --packages=/tmp/pkgs main.dart
-''')
+ ..addOption('packages',
+ abbr: 'p',
+ valueHelp: 'path',
+ help:
+ '''Get package locations from the specified file instead of .packages.
+<path> can be relative or absolute.
+For example, 'dart compile $commandName --packages=/tmp/pkgs main.dart'.''')
..addOption('save-debugging-info', abbr: 'S', valueHelp: 'path', help: '''
-Remove debugging information from the output and save it separately to the specified file. <path> can be relative or absolute.
-''');
+Remove debugging information from the output and save it separately to the specified file.
+<path> can be relative or absolute.''');
}
@override
@@ -198,10 +201,10 @@
}
// We expect a single rest argument; the dart entry point.
if (argResults.rest.length != 1) {
- log.stderr('Missing Dart entry point.');
- printUsage();
- return compileErrorExitCode;
+ // This throws.
+ usageException('Missing Dart entry point.');
}
+
final String sourcePath = argResults.rest[0];
if (!checkFile(sourcePath)) {
return -1;
@@ -232,24 +235,24 @@
addSubcommand(CompileJSCommand());
addSubcommand(CompileSnapshotCommand(
commandName: 'jit-snapshot',
- help: 'to a JIT snapshot',
+ help: 'to a JIT snapshot.',
fileExt: 'jit',
formatName: 'app-jit',
));
addSubcommand(CompileSnapshotCommand(
commandName: 'kernel',
- help: 'to a kernel snapshot',
+ help: 'to a kernel snapshot.',
fileExt: 'dill',
formatName: 'kernel',
));
addSubcommand(CompileNativeCommand(
commandName: 'exe',
- help: 'to a self-contained executable',
+ help: 'to a self-contained executable.',
format: 'exe',
));
addSubcommand(CompileNativeCommand(
commandName: 'aot-snapshot',
- help: 'to an AOT snapshot',
+ help: 'to an AOT snapshot.',
format: 'aot',
));
}
diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart
index 4867462..f07c4d8 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart
@@ -77,7 +77,8 @@
}
if (typeof $window.MemoryInfo == "undefined") {
if (typeof $window.performance.memory != "undefined") {
- $window.MemoryInfo = $window.performance.memory.constructor;
+ $window.MemoryInfo = function () {};
+ $window.MemoryInfo.prototype = $window.performance.memory.__proto__;
}
}
if (typeof $window.Geolocation == "undefined") {
diff --git a/tests/co19/co19-co19.status b/tests/co19/co19-co19.status
index 2b045da..c046c23 100644
--- a/tests/co19/co19-co19.status
+++ b/tests/co19/co19-co19.status
@@ -28,7 +28,7 @@
Language/Types/Type_Aliases/built-in_types_t11: Skip # Triple shift is not implemented yet
LanguageFeatures/Constant-update-2018/*: Skip # Not migrated to NNBD
LanguageFeatures/Control-flow-collections/*: Skip # Not migrated to NNBD
-LanguageFeatures/Extension-methods/*: Skip # Not migrated to NNBD
+LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A15_t09: Skip # Triple shift is not implemented yet
LanguageFeatures/Instantiate-to-bound/*: Skip # Not migrated to NNBD
LanguageFeatures/Instantiate-to-bound/class/*: Skip # Not migrated to NNBD
LanguageFeatures/Instantiate-to-bound/class/dynamic/*: Skip # Not migrated to NNBD
@@ -59,42 +59,7 @@
LibTest/html/IFrameElement/*: Skip # Not migrated to NNBD
LibTest/html/Node/*: Skip # Not migrated to NNBD
LibTest/html/Window/*: Skip # Not migrated to NNBD
-LibTest/io/HeaderValue/*: Skip # Not migrated to NNBD
-LibTest/io/HttpClient/*: Skip # Not migrated to NNBD
-LibTest/io/HttpClientBasicCredentials/*: Skip # Not migrated to NNBD
-LibTest/io/HttpClientDigestCredentials/*: Skip # Not migrated to NNBD
-LibTest/io/HttpClientRequest/*: Skip # Not migrated to NNBD
-LibTest/io/HttpClientResponse/*: Skip # Not migrated to NNBD
-LibTest/io/HttpServer/*: Skip # Not migrated to NNBD
-LibTest/io/IOSink/*: Skip # Not migrated to NNBD
-LibTest/io/InternetAddress/*: Skip # Not migrated to NNBD
-LibTest/io/Link/*: Skip # Not migrated to NNBD
-LibTest/io/NetworkInterface/*: Skip # Not migrated to NNBD
-LibTest/io/OSError/*: Skip # Not migrated to NNBD
-LibTest/io/Process/*: Skip # Not migrated to NNBD
-LibTest/io/ProcessInfo/*: Skip # Not migrated to NNBD
-LibTest/io/ProcessResult/*: Skip # Not migrated to NNBD
-LibTest/io/ProcessSignal/*: Skip # Not migrated to NNBD
-LibTest/io/RandomAccessFile/*: Skip # Not migrated to NNBD
-LibTest/io/RawDatagramSocket/*: Skip # Not migrated to NNBD
-LibTest/io/RawSecureServerSocket/*: Skip # Not migrated to NNBD
-LibTest/io/Stdin/*: Skip # Not migrated to NNBD
-LibTest/io/Stdout/*: Skip # Not migrated to NNBD
-LibTest/io/SystemEncoding/*: Skip # Not migrated to NNBD
-LibTest/io/WebSocket/*: Skip # Not migrated to NNBD
-LibTest/io/WebSocketTransformer/*: Skip # Not migrated to NNBD
-LibTest/io/ZLibCodec/*: Skip # Not migrated to NNBD
-LibTest/io/ZLibDecoder/*: Skip # Not migrated to NNBD
-LibTest/io/ZLibEncoder/*: Skip # Not migrated to NNBD
-LibTest/io/certificates/*: Skip # Not migrated to NNBD
-LibTest/io/exit/*: Skip # Not migrated to NNBD
-LibTest/io/exitCode/*: Skip # Not migrated to NNBD
-LibTest/io/gzip/*: Skip # Not migrated to NNBD
-LibTest/io/pid/*: Skip # Not migrated to NNBD
-LibTest/io/sleep/*: Skip # Not migrated to NNBD
-LibTest/io/stderr/*: Skip # Not migrated to NNBD
-LibTest/io/systemEncodingConstant/*: Skip # Not migrated to NNBD
-LibTest/io/zlib/*: Skip # Not migrated to NNBD
+LibTest/io/RawDatagramSocket/*: Skip # https://github.com/dart-lang/co19/issues/195
LibTest/typed_data/*: Skip # Not migrated to NNBD
LibTest/typed_data/ByteBuffer/*: Skip # Not migrated to NNBD
LibTest/typed_data/ByteData/*: Skip # Not migrated to NNBD
diff --git a/tests/co19/co19-kernel.status b/tests/co19/co19-kernel.status
index 7f8f587..d25eeaa 100644
--- a/tests/co19/co19-kernel.status
+++ b/tests/co19/co19-kernel.status
@@ -18,6 +18,155 @@
LanguageFeatures/Constant-update-2018/NewOperators_A01_t06/none: Crash
[ $runtime == dart_precompiled ]
+LibTest/io/Process/kill_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Process/run_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Process/start_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Process/start_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Process/start_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Process/start_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Process/start_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Process/start_A03_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Process/stderr_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Process/stdin_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Process/stdout_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/ProcessSignal/watch_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/ProcessSignal/watch_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A02_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A02_t04: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A03_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A03_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A04_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A04_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A04_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A04_t04: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lockSync_A05_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A01_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A01_t04: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A02_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A03_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A03_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A04_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A04_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A04_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A04_t04: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/lock_A05_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/unlockSync_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/unlockSync_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/unlockSync_A01_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/unlockSync_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/unlock_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/unlock_A01_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/unlock_A01_t04: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RandomAccessFile/unlock_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawDatagramSocket/join_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawDatagramSocket/join_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawDatagramSocket/join_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawDatagramSocket/multicastInterface_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawDatagramSocket/receive_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawDatagramSocket/reduce_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawDatagramSocket/reduce_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawDatagramSocket/reduce_A04_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawSecureServerSocket/first_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawSecureServerSocket/first_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawSecureServerSocket/first_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawSecureServerSocket/isEmpty_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawSecureServerSocket/last_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawSecureServerSocket/length_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawSecureServerSocket/single_A01_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/RawSecureServerSocket/single_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/any_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/any_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/any_A01_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/any_A01_t04: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/any_A01_t05: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/any_A01_t06: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/any_A01_t07: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/any_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/any_A04_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/first_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/first_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/first_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/first_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/first_A03_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/isEmpty_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/isEmpty_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/isEmpty_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/isEmpty_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/last_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/last_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/length_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/length_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readByteSync_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readByteSync_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readByteSync_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readByteSync_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readLineSync_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readLineSync_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readLineSync_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readLineSync_A03_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readLineSync_A03_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readLineSync_A04_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readLineSync_A05_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readLineSync_A05_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/readLineSync_A05_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdin/supportsAnsiEscapes_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/Stdout_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/addError_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/addError_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/addError_A01_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/addError_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/addError_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/addStream_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A02_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A02_t04: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A02_t05: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A02_t06: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A02_t07: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A02_t08: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A02_t09: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/add_A04_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/nonBlocking_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/supportsAnsiEscapes_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeAll_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeAll_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeAll_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeAll_A02_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeAll_A02_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeAll_A02_t05: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeAll_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeCharCode_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeCharCode_A01_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/write_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/write_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/write_A01_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/write_A01_t04: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/write_A01_t05: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/write_A01_t07: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/write_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeln_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeln_A01_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeln_A01_t03: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/Stdout/writeln_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/exit/exit_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/exit/exit_A02_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/exit/exit_A03_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/exit/exit_A03_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/exitCode/exitCode_A01_t01: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/exitCode/exitCode_A03_t02: Skip # https://github.com/dart-lang/issues/926
+LibTest/io/stderr/stderr_A01_t01: Skip # https://github.com/dart-lang/issues/926
LibTest/mirrors/*: SkipByDesign # dart:mirrors is not supported:
[ $runtime == vm ]
diff --git a/tests/language/type_object/first_class_types_literals_test.dart b/tests/language/type_object/first_class_types_literals_test.dart
index 8c761e2..6392b6d 100644
--- a/tests/language/type_object/first_class_types_literals_test.dart
+++ b/tests/language/type_object/first_class_types_literals_test.dart
@@ -57,8 +57,6 @@
// ^
// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_TYPE
// [cfe] Can't assign to a type literal.
- // ^^
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR
Expect.throwsNoSuchMethodError(() => C + 1);
// ^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR
@@ -81,8 +79,6 @@
// [cfe] Can't assign to a type literal.
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_TYPE
- // ^^
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR
Expect.throwsNoSuchMethodError(() => dynamic + 1);
// ^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR
diff --git a/tests/language_2/type_object/first_class_types_literals_test.dart b/tests/language_2/type_object/first_class_types_literals_test.dart
index 8c761e2..6392b6d 100644
--- a/tests/language_2/type_object/first_class_types_literals_test.dart
+++ b/tests/language_2/type_object/first_class_types_literals_test.dart
@@ -57,8 +57,6 @@
// ^
// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_TYPE
// [cfe] Can't assign to a type literal.
- // ^^
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR
Expect.throwsNoSuchMethodError(() => C + 1);
// ^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR
@@ -81,8 +79,6 @@
// [cfe] Can't assign to a type literal.
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_TYPE
- // ^^
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR
Expect.throwsNoSuchMethodError(() => dynamic + 1);
// ^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR
diff --git a/tools/VERSION b/tools/VERSION
index 21f041f..992f0be 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 10
PATCH 0
-PRERELEASE 74
+PRERELEASE 75
PRERELEASE_PATCH 0
\ No newline at end of file