Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: pkg/analyzer/test/generated/resolver_test.dart

Issue 1465303002: Propagate types for import/export closure before resolving. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 3dadae954ae457d7bded0c93d426596945a4409b..4a01839da5d1f094bd79fd2e1f48d175a39d8334 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -12801,96 +12801,6 @@ class TypeOverrideManagerTest extends EngineTestCase {
@reflectiveTest
class TypePropagationTest extends ResolverTestCase {
- void fail_finalPropertyInducingVariable_classMember_instance() {
- addNamedSource(
- "/lib.dart",
- r'''
-class A {
- final v = 0;
-}''');
- String code = r'''
-import 'lib.dart';
-f(A a) {
- return a.v; // marker
-}''';
- _assertTypeOfMarkedExpression(
- code, typeProvider.dynamicType, typeProvider.intType);
- }
-
- void fail_finalPropertyInducingVariable_classMember_instance_inherited() {
- addNamedSource(
- "/lib.dart",
- r'''
-class A {
- final v = 0;
-}''');
- String code = r'''
-import 'lib.dart';
-class B extends A {
- m() {
- return v; // marker
- }
-}''';
- _assertTypeOfMarkedExpression(
- code, typeProvider.dynamicType, typeProvider.intType);
- }
-
- void fail_finalPropertyInducingVariable_classMember_instance_propagatedTarget() {
- addNamedSource(
- "/lib.dart",
- r'''
-class A {
- final v = 0;
-}''');
- String code = r'''
-import 'lib.dart';
-f(p) {
- if (p is A) {
- return p.v; // marker
- }
-}''';
- _assertTypeOfMarkedExpression(
- code, typeProvider.dynamicType, typeProvider.intType);
- }
-
- void fail_finalPropertyInducingVariable_classMember_static() {
- addNamedSource(
- "/lib.dart",
- r'''
-class A {
- static final V = 0;
-}''');
- String code = r'''
-import 'lib.dart';
-f() {
- return A.V; // marker
-}''';
- _assertTypeOfMarkedExpression(
- code, typeProvider.dynamicType, typeProvider.intType);
- }
-
- void fail_finalPropertyInducingVariable_topLevelVaraible_prefixed() {
- addNamedSource("/lib.dart", "final V = 0;");
- String code = r'''
-import 'lib.dart' as p;
-f() {
- var v2 = p.V; // marker prefixed
-}''';
- _assertTypeOfMarkedExpression(
- code, typeProvider.dynamicType, typeProvider.intType);
- }
-
- void fail_finalPropertyInducingVariable_topLevelVaraible_simple() {
- addNamedSource("/lib.dart", "final V = 0;");
- String code = r'''
-import 'lib.dart';
-f() {
- return V; // marker simple
-}''';
- _assertTypeOfMarkedExpression(
- code, typeProvider.dynamicType, typeProvider.intType);
- }
-
void fail_mergePropagatedTypesAtJoinPoint_1() {
// https://code.google.com/p/dart/issues/detail?id=19929
_assertTypeOfMarkedExpression(
@@ -13175,7 +13085,67 @@ main(CanvasElement canvas) {
expect(identifier.propagatedType.name, "CanvasRenderingContext2D");
}
+ void test_finalPropertyInducingVariable_classMember_instance() {
+ // TODO(scheglov) remove after switching to the task model
+ if (!AnalysisEngine.instance.useTaskModel) return;
+ addNamedSource(
+ "/lib.dart",
+ r'''
+class A {
+ final v = 0;
+}''');
+ String code = r'''
+import 'lib.dart';
+f(A a) {
+ return a.v; // marker
+}''';
+ _assertTypeOfMarkedExpression(
+ code, typeProvider.dynamicType, typeProvider.intType);
+ }
+
+ void test_finalPropertyInducingVariable_classMember_instance_inherited() {
+ // TODO(scheglov) remove after switching to the task model
+ if (!AnalysisEngine.instance.useTaskModel) return;
+ addNamedSource(
+ "/lib.dart",
+ r'''
+class A {
+ final v = 0;
+}''');
+ String code = r'''
+import 'lib.dart';
+class B extends A {
+ m() {
+ return v; // marker
+ }
+}''';
+ _assertTypeOfMarkedExpression(
+ code, typeProvider.dynamicType, typeProvider.intType);
+ }
+
+ void test_finalPropertyInducingVariable_classMember_instance_propagatedTarget() {
+ // TODO(scheglov) remove after switching to the task model
+ if (!AnalysisEngine.instance.useTaskModel) return;
+ addNamedSource(
+ "/lib.dart",
+ r'''
+class A {
+ final v = 0;
+}''');
+ String code = r'''
+import 'lib.dart';
+f(p) {
+ if (p is A) {
+ return p.v; // marker
+ }
+}''';
+ _assertTypeOfMarkedExpression(
+ code, typeProvider.dynamicType, typeProvider.intType);
+ }
+
void test_finalPropertyInducingVariable_classMember_instance_unprefixed() {
+ // TODO(scheglov) remove after switching to the task model
+ if (!AnalysisEngine.instance.useTaskModel) return;
String code = r'''
class A {
final v = 0;
@@ -13187,6 +13157,50 @@ class A {
code, typeProvider.dynamicType, typeProvider.intType);
}
+ void test_finalPropertyInducingVariable_classMember_static() {
+ // TODO(scheglov) remove after switching to the task model
+ if (!AnalysisEngine.instance.useTaskModel) return;
+ addNamedSource(
+ "/lib.dart",
+ r'''
+class A {
+ static final V = 0;
+}''');
+ String code = r'''
+import 'lib.dart';
+f() {
+ return A.V; // marker
+}''';
+ _assertTypeOfMarkedExpression(
+ code, typeProvider.dynamicType, typeProvider.intType);
+ }
+
+ void test_finalPropertyInducingVariable_topLevelVariable_prefixed() {
+ // TODO(scheglov) remove after switching to the task model
+ if (!AnalysisEngine.instance.useTaskModel) return;
+ addNamedSource("/lib.dart", "final V = 0;");
+ String code = r'''
+import 'lib.dart' as p;
+f() {
+ var v2 = p.V; // marker prefixed
+}''';
+ _assertTypeOfMarkedExpression(
+ code, typeProvider.dynamicType, typeProvider.intType);
+ }
+
+ void test_finalPropertyInducingVariable_topLevelVariable_simple() {
+ // TODO(scheglov) remove after switching to the task model
+ if (!AnalysisEngine.instance.useTaskModel) return;
+ addNamedSource("/lib.dart", "final V = 0;");
+ String code = r'''
+import 'lib.dart';
+f() {
+ return V; // marker simple
+}''';
+ _assertTypeOfMarkedExpression(
+ code, typeProvider.dynamicType, typeProvider.intType);
+ }
+
void test_forEach() {
String code = r'''
main() {
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698