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

Side by Side Diff: test/checker/checker_test.dart

Issue 1298893003: Enable is and as checks on non-ground types (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Minor fixes Created 5 years, 4 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 /// General type checking tests 5 /// General type checking tests
6 library dev_compiler.test.checker_test; 6 library dev_compiler.test.checker_test;
7 7
8 import 'package:test/test.dart'; 8 import 'package:test/test.dart';
9 9
10 import '../testing.dart'; 10 import '../testing.dart';
(...skipping 2498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2509 typedef II2D(int x, int y); 2509 typedef II2D(int x, int y);
2510 typedef DI2D(x, int y); 2510 typedef DI2D(x, int y);
2511 typedef ID2D(int x, y); 2511 typedef ID2D(int x, y);
2512 typedef DD2D(x, y); 2512 typedef DD2D(x, y);
2513 2513
2514 int foo(int x) => x; 2514 int foo(int x) => x;
2515 int bar(int x, int y) => x + y; 2515 int bar(int x, int y) => x + y;
2516 2516
2517 void main() { 2517 void main() {
2518 bool b; 2518 bool b;
2519 b = /*severe:InvalidRuntimeCheckError*/foo is I2I; 2519 b = /*info:NonGroundTypeCheckInfo*/foo is I2I;
2520 b = /*severe:InvalidRuntimeCheckError*/foo is D2I; 2520 b = /*info:NonGroundTypeCheckInfo*/foo is D2I;
2521 b = /*severe:InvalidRuntimeCheckError*/foo is I2D; 2521 b = /*info:NonGroundTypeCheckInfo*/foo is I2D;
2522 b = foo is D2D; 2522 b = foo is D2D;
2523 2523
2524 b = /*severe:InvalidRuntimeCheckError*/bar is II2I; 2524 b = /*info:NonGroundTypeCheckInfo*/bar is II2I;
2525 b = /*severe:InvalidRuntimeCheckError*/bar is DI2I; 2525 b = /*info:NonGroundTypeCheckInfo*/bar is DI2I;
2526 b = /*severe:InvalidRuntimeCheckError*/bar is ID2I; 2526 b = /*info:NonGroundTypeCheckInfo*/bar is ID2I;
2527 b = /*severe:InvalidRuntimeCheckError*/bar is II2D; 2527 b = /*info:NonGroundTypeCheckInfo*/bar is II2D;
2528 b = /*severe:InvalidRuntimeCheckError*/bar is DD2I; 2528 b = /*info:NonGroundTypeCheckInfo*/bar is DD2I;
2529 b = /*severe:InvalidRuntimeCheckError*/bar is DI2D; 2529 b = /*info:NonGroundTypeCheckInfo*/bar is DI2D;
2530 b = /*severe:InvalidRuntimeCheckError*/bar is ID2D; 2530 b = /*info:NonGroundTypeCheckInfo*/bar is ID2D;
2531 b = bar is DD2D; 2531 b = bar is DD2D;
2532 2532
2533 // For as, the validity of checks is deferred to runtime. 2533 // For as, the validity of checks is deferred to runtime.
2534 Function f; 2534 Function f;
2535 f = foo as I2I; 2535 f = foo as I2I;
2536 f = foo as D2I; 2536 f = foo as D2I;
2537 f = foo as I2D; 2537 f = foo as I2D;
2538 f = foo as D2D; 2538 f = foo as D2D;
2539 2539
2540 f = bar as II2I; 2540 f = bar as II2I;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2665 // Types other than int and double are not accepted. 2665 // Types other than int and double are not accepted.
2666 printInt( 2666 printInt(
2667 /*warning:DownCastImplicit*/min( 2667 /*warning:DownCastImplicit*/min(
2668 /*severe:StaticTypeError*/"hi", 2668 /*severe:StaticTypeError*/"hi",
2669 /*severe:StaticTypeError*/"there")); 2669 /*severe:StaticTypeError*/"there"));
2670 } 2670 }
2671 ''' 2671 '''
2672 }); 2672 });
2673 }); 2673 });
2674 } 2674 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698