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

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

Issue 1507933002: Refactor strong mode to remove duplicate TypeRules (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 test.src.task.strong.checker_test; 8 library test.src.task.strong.checker_test;
9 9
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 A.c1(p): this.x = /*info:DOWN_CAST_IMPLICIT*/z, this.y = /*info:DYNAMIC_ CAST*/p; 240 A.c1(p): this.x = /*info:DOWN_CAST_IMPLICIT*/z, this.y = /*info:DYNAMIC_ CAST*/p;
241 241
242 A.c2(this.x, this.y); 242 A.c2(this.x, this.y);
243 243
244 A.c3(/*severe:INVALID_PARAMETER_DECLARATION*/num this.x, String this.y); 244 A.c3(/*severe:INVALID_PARAMETER_DECLARATION*/num this.x, String this.y);
245 } 245 }
246 246
247 class B extends A { 247 class B extends A {
248 B() : super(/*severe:STATIC_TYPE_ERROR*/"hello"); 248 B() : super(/*severe:STATIC_TYPE_ERROR*/"hello");
249 249
250 B.c2(int x, String y) : super.c2(/*severe:STATIC_TYPE_ERROR*/y, 250 B.c2(int x, String y) : super.c2(/*severe:STATIC_TYPE_ERROR*/y,
251 /*severe:STATIC_TYPE_ERROR*/x); 251 /*severe:STATIC_TYPE_ERROR*/x);
252 252
253 B.c3(num x, Object y) : super.c3(x, /*info:DOWN_CAST_IMPLICIT*/y); 253 B.c3(num x, Object y) : super.c3(x, /*info:DOWN_CAST_IMPLICIT*/y);
254 } 254 }
255 255
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 '''
(...skipping 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after
2426 2426
2427 baz1() sync* { yield* (/*info:DYNAMIC_CAST*/x); } 2427 baz1() sync* { yield* (/*info:DYNAMIC_CAST*/x); }
2428 Iterable baz2() sync* { yield* (/*info:DYNAMIC_CAST*/x); } 2428 Iterable baz2() sync* { yield* (/*info:DYNAMIC_CAST*/x); }
2429 Iterable<int> baz3() sync* { yield* (/*warning:DOWN_CAST_COMPOSITE*/x); } 2429 Iterable<int> baz3() sync* { yield* (/*warning:DOWN_CAST_COMPOSITE*/x); }
2430 Iterable<int> baz4() sync* { yield* new Iterable<int>(); } 2430 Iterable<int> baz4() sync* { yield* new Iterable<int>(); }
2431 Iterable<int> baz5() sync* { yield* (/*info:INFERRED_TYPE_ALLOCATION*/ne w Iterable()); } 2431 Iterable<int> baz5() sync* { yield* (/*info:INFERRED_TYPE_ALLOCATION*/ne w Iterable()); }
2432 ''' 2432 '''
2433 }); 2433 });
2434 }); 2434 });
2435 } 2435 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/rules.dart ('k') | pkg/analyzer/test/src/task/strong/strong_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698