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

Unified Diff: test/checker/checker_test.dart

Issue 997143003: Fix for conditional expressions (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Add test case Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/checker/resolver.dart ('k') | test/codegen/expect/dart/_internal.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/checker/checker_test.dart
diff --git a/test/checker/checker_test.dart b/test/checker/checker_test.dart
index 30995002972b9f56a08a69cbd33a9a3fc7ff7bb9..c26bbf3bf7c2fbda7ff40926005a8375f9155ff7 100644
--- a/test/checker/checker_test.dart
+++ b/test/checker/checker_test.dart
@@ -1548,6 +1548,20 @@ main() {
testChecker({'/main.dart': mk("info:DownCast")}, allowConstCasts: true);
});
+ test('casts in conditionals', () {
+ testChecker({
+ '/main.dart': '''
+ main() {
+ bool b = true;
+ num x = b ? 1 : 2.3;
+ int y = /*info:DownCast*/b ? 1 : 2.3;
+ String z = !b ? "hello" : null;
+ z = b ? null : "hello";
+ }
+ '''
+ });
+ });
+
test('redirecting constructor', () {
testChecker({
'/main.dart': '''
« no previous file with comments | « lib/src/checker/resolver.dart ('k') | test/codegen/expect/dart/_internal.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698