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

Side by Side Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 1700403002: fixes #25793, make strong checker tests sane (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // TODO(jmesserly): this file needs to be refactored, it's a port from 5 // TODO(jmesserly): this file needs to be refactored, it's a port from
6 // package:dev_compiler's tests 6 // package:dev_compiler's tests
7 /// General type checking tests 7 /// General type checking tests
8 library analyzer.test.src.task.strong.checker_test; 8 library analyzer.test.src.task.strong.checker_test;
9 9
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 15 matching lines...) Expand all
26 26
27 class SplayTreeMap<K, V> { 27 class SplayTreeMap<K, V> {
28 Comparator<K> _comparator; 28 Comparator<K> _comparator;
29 _Predicate _validKey; 29 _Predicate _validKey;
30 30
31 // TODO(rnystrom): Initializing _comparator should have a cast, since 31 // TODO(rnystrom): Initializing _comparator should have a cast, since
32 // K may not always be Comparable. It doesn't currently get one 32 // K may not always be Comparable. It doesn't currently get one
33 // because we're using the spec's LUB on function types, which isn't 33 // because we're using the spec's LUB on function types, which isn't
34 // sound. 34 // sound.
35 SplayTreeMap([int compare(K key1, K key2), 35 SplayTreeMap([int compare(K key1, K key2),
36 bool isValidKey(potentialKey)]) { 36 bool isValidKey(potentialKey)])
37 : _comparator = (compare == null) ? Comparable.compare : compare, 37 : _comparator = (compare == null) ? Comparable.compare : compare,
38 _validKey = (isValidKey != null) ? isValidKey : ((v) => true); 38 _validKey = (isValidKey != null) ? isValidKey : ((v) => true) {
39 _Predicate<Object> v = /*warning:DOWN_CAST_COMPOSITE*/(isValidKey ! = null) 39 _Predicate<Object> v = /*warning:DOWN_CAST_COMPOSITE*/(isValidKey != null)
40 ? isValidKey : (/*info:INFERRED_TYPE_CLOSURE */(_) => true); 40 ? isValidKey : (/*info:INFERRED_TYPE_CLOSURE */(_) => true);
41 41
42 v = (isValidKey != null) 42 v = (isValidKey != null)
43 ? v : (/*info:INFERRED_TYPE_CLOSURE*/(_) => true); 43 ? v : (/*info:INFERRED_TYPE_CLOSURE*/(_) => true);
44 } 44 }
45 } 45 }
46 void main() { 46 void main() {
47 Object obj = 42; 47 Object obj = 42;
48 dynamic dyn = 42; 48 dynamic dyn = 42;
49 int i = 42; 49 int i = 42;
50 50
51 // Check the boolean conversion of the condition. 51 // Check the boolean conversion of the condition.
52 print((/*severe:STATIC_TYPE_ERROR*/i) ? false : true); 52 print((/*severe:STATIC_TYPE_ERROR*/i) ? false : true);
53 print((/*info:DOWN_CAST_IMPLICIT*/obj) ? false : true); 53 print((/*info:DOWN_CAST_IMPLICIT*/obj) ? false : true);
54 print((/*info:DYNAMIC_CAST*/dyn) ? false : true); 54 print((/*info:DYNAMIC_CAST*/dyn) ? false : true);
55 } 55 }
56 '''); 56 ''');
57 }); 57 });
58 58
59 test('if/for/do/while statements use boolean conversion', () { 59 test('if/for/do/while statements use boolean conversion', () {
60 checkFile(''' 60 checkFile('''
61 main() { 61 main() {
62 dynamic d = 42; 62 dynamic dyn = 42;
63 Object obj = 42; 63 Object obj = 42;
64 int i = 42; 64 int i = 42;
65 bool b = false; 65 bool b = false;
66 66
67 if (b) {} 67 if (b) {}
68 if (/*info:DYNAMIC_CAST*/dyn) {} 68 if (/*info:DYNAMIC_CAST*/dyn) {}
69 if (/*info:DOWN_CAST_IMPLICIT*/obj) {} 69 if (/*info:DOWN_CAST_IMPLICIT*/obj) {}
70 if (/*severe:STATIC_TYPE_ERROR*/i) {} 70 if (/*severe:STATIC_TYPE_ERROR*/i) {}
71 71
72 while (b) {} 72 while (b) {}
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 double y; 126 double y;
127 x = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3); 127 x = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3);
128 y = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3); 128 y = /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/f(3);
129 (/*info:DYNAMIC_INVOKE*/f(3.0)); 129 (/*info:DYNAMIC_INVOKE*/f(3.0));
130 } 130 }
131 { 131 {
132 dynamic g = new B(); 132 dynamic g = new B();
133 (/*info:DYNAMIC_INVOKE*/g.call(32.0)); 133 (/*info:DYNAMIC_INVOKE*/g.call(32.0));
134 (/*info:DYNAMIC_INVOKE*/g.col(42.0)); 134 (/*info:DYNAMIC_INVOKE*/g.col(42.0));
135 (/*info:DYNAMIC_INVOKE*/g.foo(42.0)); 135 (/*info:DYNAMIC_INVOKE*/g.foo(42.0));
136 (/*info:DYNAMIC_INVOKE*/g.x); 136 (/*info:DYNAMIC_INVOKE*/g./*info:UNDEFINED_GETTER*/x);
137 A f = new B(); 137 A f = new B();
138 f.call(32.0); 138 f.call(32.0);
139 (/*info:DYNAMIC_INVOKE*/f.col(42.0)); 139 (/*info:DYNAMIC_INVOKE*/f.col(42.0));
140 (/*info:DYNAMIC_INVOKE*/f.foo(42.0)); 140 (/*info:DYNAMIC_INVOKE*/f.foo(42.0));
141 (/*info:DYNAMIC_INVOKE*/f.x); 141 (/*info:DYNAMIC_INVOKE*/f./*warning:UNDEFINED_GETTER*/x);
142 } 142 }
143 } 143 }
144 '''); 144 ''');
145 }); 145 });
146 146
147 test('conversion and dynamic invoke', () { 147 test('conversion and dynamic invoke', () {
148 addFile( 148 addFile(
149 ''' 149 '''
150 dynamic toString = (int x) => x + 42; 150 dynamic toString = (int x) => x + 42;
151 dynamic hashCode = "hello"; 151 dynamic hashCode = "hello";
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 StrFun f4 = foo; 196 StrFun f4 = foo;
197 f4("hello"); 197 f4("hello");
198 a.baz1("hello"); 198 a.baz1("hello");
199 var b1 = a.baz1; 199 var b1 = a.baz1;
200 (/*info:DYNAMIC_INVOKE*/b1("hello")); 200 (/*info:DYNAMIC_INVOKE*/b1("hello"));
201 A.baz2("hello"); 201 A.baz2("hello");
202 var b2 = A.baz2; 202 var b2 = A.baz2;
203 (/*info:DYNAMIC_INVOKE*/b2("hello")); 203 (/*info:DYNAMIC_INVOKE*/b2("hello"));
204 204
205 dynamic a1 = new B(); 205 dynamic a1 = new B();
206 (/*info:DYNAMIC_INVOKE*/a1.x); 206 (/*info:DYNAMIC_INVOKE*/a1./*info:UNDEFINED_GETTER*/x);
207 a1.toString(); 207 a1.toString();
208 (/*info:DYNAMIC_INVOKE*/a1.toString(42)); 208 (/*info:DYNAMIC_INVOKE*/a1.toString(42));
209 var toStringClosure = a1.toString; 209 var toStringClosure = a1.toString;
210 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure()); 210 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure());
211 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure(42)); 211 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure(42));
212 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure("hello")); 212 (/*info:DYNAMIC_INVOKE*/a1.toStringClosure("hello"));
213 a1.hashCode; 213 a1.hashCode;
214 214
215 dynamic toString = () => null; 215 dynamic toString = () => null;
216 (/*info:DYNAMIC_INVOKE*/toString()); 216 (/*info:DYNAMIC_INVOKE*/toString());
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 void main() { 256 void main() {
257 A a = new A.c2(/*info:DOWN_CAST_IMPLICIT*/z, /*severe:STATIC_TYPE_ERROR */z); 257 A a = new A.c2(/*info:DOWN_CAST_IMPLICIT*/z, /*severe:STATIC_TYPE_ERROR */z);
258 var b = new B.c2(/*severe:STATIC_TYPE_ERROR*/"hello", /*info:DOWN_CAST_ IMPLICIT*/obj); 258 var b = new B.c2(/*severe:STATIC_TYPE_ERROR*/"hello", /*info:DOWN_CAST_ IMPLICIT*/obj);
259 } 259 }
260 '''); 260 ''');
261 }); 261 });
262 262
263 test('Unbound variable', () { 263 test('Unbound variable', () {
264 checkFile(''' 264 checkFile('''
265 void main() { 265 void main() {
266 dynamic y = /*pass should be severe:STATIC_TYPE_ERROR*/unboundVariable; 266 dynamic y = /*warning:UNDEFINED_IDENTIFIER should be error*/unboundVari able;
267 } 267 }
268 '''); 268 ''');
269 }); 269 });
270 270
271 test('Unbound type name', () { 271 test('Unbound type name', () {
272 checkFile(''' 272 checkFile('''
273 void main() { 273 void main() {
274 /*pass should be severe:STATIC_TYPE_ERROR*/AToB y; 274 /*warning:UNDEFINED_CLASS should be error*/AToB y;
275 } 275 }
276 '''); 276 ''');
277 }); 277 });
278 278
279 // Regression test for https://github.com/dart-lang/sdk/issues/25069 279 // Regression test for https://github.com/dart-lang/sdk/issues/25069
280 test('Void subtyping', () { 280 test('Void subtyping', () {
281 checkFile(''' 281 checkFile('''
282 typedef int Foo(); 282 typedef int Foo();
283 void foo() {} 283 void foo() {}
284 void main () { 284 void main () {
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 r = /*severe:STATIC_TYPE_ERROR*/nn; 1003 r = /*severe:STATIC_TYPE_ERROR*/nn;
1004 r = /*severe:STATIC_TYPE_ERROR*/nnn; 1004 r = /*severe:STATIC_TYPE_ERROR*/nnn;
1005 1005
1006 o = /*warning:DOWN_CAST_COMPOSITE*/r; 1006 o = /*warning:DOWN_CAST_COMPOSITE*/r;
1007 o = o; 1007 o = o;
1008 o = /*severe:STATIC_TYPE_ERROR*/n; 1008 o = /*severe:STATIC_TYPE_ERROR*/n;
1009 o = /*severe:STATIC_TYPE_ERROR*/rr; 1009 o = /*severe:STATIC_TYPE_ERROR*/rr;
1010 o = /*severe:STATIC_TYPE_ERROR*/ro; 1010 o = /*severe:STATIC_TYPE_ERROR*/ro;
1011 o = /*severe:STATIC_TYPE_ERROR*/rn; 1011 o = /*severe:STATIC_TYPE_ERROR*/rn;
1012 o = oo; 1012 o = oo;
1013 o = /*severe:STATIC_TYPE_ERROR*/nn 1013 o = /*severe:STATIC_TYPE_ERROR*/nn;
1014 o = /*severe:STATIC_TYPE_ERROR*/nnn; 1014 o = /*severe:STATIC_TYPE_ERROR*/nnn;
1015 1015
1016 n = /*severe:STATIC_TYPE_ERROR*/r; 1016 n = /*severe:STATIC_TYPE_ERROR*/r;
1017 n = /*severe:STATIC_TYPE_ERROR*/o; 1017 n = /*severe:STATIC_TYPE_ERROR*/o;
1018 n = n; 1018 n = n;
1019 n = /*severe:STATIC_TYPE_ERROR*/rr; 1019 n = /*severe:STATIC_TYPE_ERROR*/rr;
1020 n = /*severe:STATIC_TYPE_ERROR*/ro; 1020 n = /*severe:STATIC_TYPE_ERROR*/ro;
1021 n = /*severe:STATIC_TYPE_ERROR*/rn; 1021 n = /*severe:STATIC_TYPE_ERROR*/rn;
1022 n = /*severe:STATIC_TYPE_ERROR*/oo; 1022 n = /*severe:STATIC_TYPE_ERROR*/oo;
1023 n = nn; 1023 n = nn;
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 class B extends A { 1379 class B extends A {
1380 B() : super(/*severe:STATIC_TYPE_ERROR*/3); 1380 B() : super(/*severe:STATIC_TYPE_ERROR*/3);
1381 } 1381 }
1382 '''); 1382 ''');
1383 }); 1383 });
1384 1384
1385 test('factory constructor downcast', () { 1385 test('factory constructor downcast', () {
1386 checkFile(r''' 1386 checkFile(r'''
1387 class Animal { 1387 class Animal {
1388 Animal(); 1388 Animal();
1389 factory Animal.cat() => return new Cat(); 1389 factory Animal.cat() => new Cat();
1390 } 1390 }
1391 1391
1392 class Cat extends Animal {} 1392 class Cat extends Animal {}
1393 1393
1394 void main() { 1394 void main() {
1395 Cat c = /*info:ASSIGNMENT_CAST*/new Animal.cat(); 1395 Cat c = /*info:ASSIGNMENT_CAST*/new Animal.cat();
1396 c = /*severe:STATIC_TYPE_ERROR*/new Animal(); 1396 c = /*severe:STATIC_TYPE_ERROR*/new Animal();
1397 }'''); 1397 }''');
1398 }); 1398 });
1399 1399
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 } 1649 }
1650 '''); 1650 ''');
1651 }); 1651 });
1652 1652
1653 test('generic function wrong number of arguments', () { 1653 test('generic function wrong number of arguments', () {
1654 checkFile(r''' 1654 checkFile(r'''
1655 /*=T*/ foo/*<T>*/(/*=T*/ x, /*=T*/ y) => x; 1655 /*=T*/ foo/*<T>*/(/*=T*/ x, /*=T*/ y) => x;
1656 /*=T*/ bar/*<T>*/({/*=T*/ x, /*=T*/ y}) => x; 1656 /*=T*/ bar/*<T>*/({/*=T*/ x, /*=T*/ y}) => x;
1657 1657
1658 main() { 1658 main() {
1659 // resolving thses shouldn't crash. 1659 String x;
1660 foo(1, 2, 3); 1660 // resolving these shouldn't crash.
1661 String x = foo('1', '2', '3'); 1661 foo/*warning:EXTRA_POSITIONAL_ARGUMENTS*/(1, 2, 3);
1662 foo(1); 1662 x = foo/*warning:EXTRA_POSITIONAL_ARGUMENTS*/('1', '2', '3');
1663 String x = foo('1'); 1663 foo/*warning:NOT_ENOUGH_REQUIRED_ARGUMENTS*/(1);
1664 x = /*severe:STATIC_TYPE_ERROR*/foo(1, 2, 3); 1664 x = foo/*warning:NOT_ENOUGH_REQUIRED_ARGUMENTS*/('1');
1665 x = /*severe:STATIC_TYPE_ERROR*/foo(1); 1665 x = /*severe:STATIC_TYPE_ERROR*/foo/*warning:EXTRA_POSITIONAL_ARGUME NTS*/(1, 2, 3);
1666 x = /*severe:STATIC_TYPE_ERROR*/foo/*warning:NOT_ENOUGH_REQUIRED_ARG UMENTS*/(1);
1666 1667
1667 // named arguments 1668 // named arguments
1668 bar(y: 1, x: 2, z: 3); 1669 bar(y: 1, x: 2, /*warning:UNDEFINED_NAMED_PARAMETER*/z: 3);
1669 String x = bar(z: '1', x: '2', y: '3'); 1670 x = bar(/*warning:UNDEFINED_NAMED_PARAMETER*/z: '1', x: '2', y: '3') ;
1670 bar(y: 1); 1671 bar(y: 1);
1671 x = bar(x: '1', z: 42); 1672 x = bar(x: '1', /*warning:UNDEFINED_NAMED_PARAMETER*/z: 42);
1672 x = /*severe:STATIC_TYPE_ERROR*/bar(y: 1, x: 2, z: 3); 1673 x = /*severe:STATIC_TYPE_ERROR*/bar(y: 1, x: 2, /*warning:UNDEFINED_ NAMED_PARAMETER*/z: 3);
1673 x = /*severe:STATIC_TYPE_ERROR*/bar(x: 1); 1674 x = /*severe:STATIC_TYPE_ERROR*/bar(x: 1);
1674 } 1675 }
1675 '''); 1676 ''');
1676 }); 1677 });
1677 1678
1678 test('type promotion from dynamic', () { 1679 test('type promotion from dynamic', () {
1679 checkFile(r''' 1680 checkFile(r'''
1680 f() { 1681 f() {
1681 dynamic x; 1682 dynamic x;
1682 if (x is int) { 1683 if (x is int) {
(...skipping 18 matching lines...) Expand all
1701 A operator +(int x) {} 1702 A operator +(int x) {}
1702 A operator -(int x) {} 1703 A operator -(int x) {}
1703 A operator -() {} 1704 A operator -() {}
1704 } 1705 }
1705 1706
1706 foo() => new A(); 1707 foo() => new A();
1707 1708
1708 test() { 1709 test() {
1709 A a = new A(); 1710 A a = new A();
1710 var c = foo(); 1711 var c = foo();
1712 dynamic d;
1711 1713
1712 ~a; 1714 ~a;
1713 (/*info:DYNAMIC_INVOKE*/~d); 1715 (/*info:DYNAMIC_INVOKE*/~d);
1714 1716
1715 !/*severe:STATIC_TYPE_ERROR*/a; 1717 !/*severe:STATIC_TYPE_ERROR*/a;
1716 !/*info:DYNAMIC_CAST*/d; 1718 !/*info:DYNAMIC_CAST*/d;
1717 1719
1718 -a; 1720 -a;
1719 (/*info:DYNAMIC_INVOKE*/-d); 1721 (/*info:DYNAMIC_INVOKE*/-d);
1720 1722
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 a ^= b; 1884 a ^= b;
1883 a |= b; 1885 a |= b;
1884 (/*info:DYNAMIC_INVOKE*/c += b); 1886 (/*info:DYNAMIC_INVOKE*/c += b);
1885 1887
1886 var d = new D(); 1888 var d = new D();
1887 a[b] += d; 1889 a[b] += d;
1888 a[/*info:DYNAMIC_CAST*/c] += d; 1890 a[/*info:DYNAMIC_CAST*/c] += d;
1889 a[/*severe:STATIC_TYPE_ERROR*/z] += d; 1891 a[/*severe:STATIC_TYPE_ERROR*/z] += d;
1890 a[b] += /*info:DYNAMIC_CAST*/c; 1892 a[b] += /*info:DYNAMIC_CAST*/c;
1891 a[b] += /*severe:STATIC_TYPE_ERROR*/z; 1893 a[b] += /*severe:STATIC_TYPE_ERROR*/z;
1892 (/*info:DYNAMIC_INVOKE*/(/*info:DYNAMIC_INVOKE*/c[b]) += d); 1894 /*info:DYNAMIC_INVOKE,info:DYNAMIC_INVOKE*/c[b] += d;
1893 } 1895 }
1894 '''); 1896 ''');
1895 }); 1897 });
1896 1898
1897 test('super call placement', () { 1899 test('super call placement', () {
1898 checkFile(''' 1900 checkFile('''
1899 class Base { 1901 class Base {
1900 var x; 1902 var x;
1901 Base() : x = print('Base.1') { print('Base.2'); } 1903 Base() : x = print('Base.1') { print('Base.2'); }
1902 } 1904 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 int j = i + 1; 1943 int j = i + 1;
1942 } 1944 }
1943 } 1945 }
1944 '''); 1946 ''');
1945 }); 1947 });
1946 1948
1947 test('loadLibrary', () { 1949 test('loadLibrary', () {
1948 addFile('''library lib1;''', name: '/lib1.dart'); 1950 addFile('''library lib1;''', name: '/lib1.dart');
1949 checkFile(r''' 1951 checkFile(r'''
1950 import 'lib1.dart' deferred as lib1; 1952 import 'lib1.dart' deferred as lib1;
1953 import 'dart:async' show Future;
1951 main() { 1954 main() {
1952 Future f = lib1.loadLibrary(); 1955 Future f = lib1.loadLibrary();
1953 }'''); 1956 }''');
1954 }); 1957 });
1955 1958
1956 group('invalid overrides', () { 1959 group('invalid overrides', () {
1957 test('child override', () { 1960 test('child override', () {
1958 checkFile(''' 1961 checkFile('''
1959 class A {} 1962 class A {}
1960 class B {} 1963 class B {}
1961 1964
1962 class Base { 1965 class Base {
1963 A f; 1966 A f;
1964 } 1967 }
1965 1968
1966 class T1 extends Base { 1969 class T1 extends Base {
1967 /*severe:INVALID_FIELD_OVERRIDE,severe:INVALID_METHOD_OVERRIDE*/B get f => null; 1970 /*severe:INVALID_METHOD_OVERRIDE,severe:INVALID_FIELD_OVERRIDE*/B get f => null;
1968 } 1971 }
1969 1972
1970 class T2 extends Base { 1973 class T2 extends Base {
1971 /*severe:INVALID_FIELD_OVERRIDE,severe:INVALID_METHOD_OVERRIDE*/se t f(B b) => null; 1974 /*severe:INVALID_METHOD_OVERRIDE,severe:INVALID_FIELD_OVERRIDE*/se t f(B b) => null;
1972 } 1975 }
1973 1976
1974 class T3 extends Base { 1977 class T3 extends Base {
1975 /*severe:INVALID_FIELD_OVERRIDE,severe:INVALID_METHOD_OVERRIDE*/fi nal B f; 1978 /*severe:INVALID_FIELD_OVERRIDE,severe:INVALID_METHOD_OVERRIDE*/fi nal B f;
1976 } 1979 }
1977 class T4 extends Base { 1980 class T4 extends Base {
1978 // two: one for the getter one for the setter. 1981 // two: one for the getter one for the setter.
1979 /*severe:INVALID_FIELD_OVERRIDE,severe:INVALID_METHOD_OVERRIDE,sev ere:INVALID_METHOD_OVERRIDE*/B f; 1982 /*severe:INVALID_FIELD_OVERRIDE,severe:INVALID_METHOD_OVERRIDE,sev ere:INVALID_METHOD_OVERRIDE*/B f;
1980 } 1983 }
1981 1984
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
2794 2797
2795 baz1() sync* { yield* (/*info:DYNAMIC_CAST*/x); } 2798 baz1() sync* { yield* (/*info:DYNAMIC_CAST*/x); }
2796 Iterable baz2() sync* { yield* (/*info:DYNAMIC_CAST*/x); } 2799 Iterable baz2() sync* { yield* (/*info:DYNAMIC_CAST*/x); }
2797 Iterable<int> baz3() sync* { yield* (/*warning:DOWN_CAST_COMPOSITE*/x); } 2800 Iterable<int> baz3() sync* { yield* (/*warning:DOWN_CAST_COMPOSITE*/x); }
2798 Iterable<int> baz4() sync* { yield* new Iterable<int>(); } 2801 Iterable<int> baz4() sync* { yield* new Iterable<int>(); }
2799 Iterable<int> baz5() sync* { yield* (/*info:INFERRED_TYPE_ALLOCATION*/ne w Iterable()); } 2802 Iterable<int> baz5() sync* { yield* (/*info:INFERRED_TYPE_ALLOCATION*/ne w Iterable()); }
2800 '''); 2803 ''');
2801 }); 2804 });
2802 }); 2805 });
2803 } 2806 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/context/mock_sdk.dart ('k') | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698