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

Unified Diff: test/runtime/dart_runtime_test.dart

Issue 977613002: Make int and double nullable by default (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: actually upload changes Created 5 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 side-by-side diff with in-line comments
Download patch
« lib/src/codegen/js_codegen.dart ('K') | « test/dart_codegen/expect/core/uri.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runtime/dart_runtime_test.dart
diff --git a/test/runtime/dart_runtime_test.dart b/test/runtime/dart_runtime_test.dart
index f890f2be6f71db51ee9056938f21b6863eb30217..9b2576248b437f39013c778af589c20e945221ab 100644
--- a/test/runtime/dart_runtime_test.dart
+++ b/test/runtime/dart_runtime_test.dart
@@ -6,8 +6,12 @@
import 'dart:collection';
import 'dart:mirrors';
import 'package:unittest/unittest.dart';
+import 'package:dev_compiler/config.dart';
import 'package:dev_compiler/runtime/dart_runtime.dart';
+final bool intIsNonNullable = TypeOptions.NONNULLABLE_TYPES.contains('int');
+final bool doubleIsNonNullable = TypeOptions.NONNULLABLE_TYPES.contains('double');
+
class A {
int x;
}
@@ -91,7 +95,11 @@ void main() {
checkType(5, String, false);
expect(cast(5, int), equals(5));
- expect(() => cast(null, int), throws);
+ if (intIsNonNullable) {
+ expect(() => cast(null, int), throws);
+ } else {
+ expect(cast(null, int), equals(null));
+ }
});
test('dynamic', () {
« lib/src/codegen/js_codegen.dart ('K') | « test/dart_codegen/expect/core/uri.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698