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

Unified Diff: lib/src/info.dart

Issue 1396993002: housecleaning: remove nonnullableTypes (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 2 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
Index: lib/src/info.dart
diff --git a/lib/src/info.dart b/lib/src/info.dart
index 295028d01a3d18d56126e2092456f85d0fdc2f5e..c48fb361141ed613cf52708daabc374962ad5b42 100644
--- a/lib/src/info.dart
+++ b/lib/src/info.dart
@@ -222,15 +222,8 @@ abstract class DownCast extends CoercionInfo {
// Handle null call specially.
if (expression is NullLiteral) {
- if (rules.isNonNullableType(toT)) {
- reason = "null is invalid as a $toT";
- return new StaticTypeError(rules, expression, toT, reason: reason);
- } else {
- // We should only get here if some coercion is required.
- assert(rules.maybeNonNullableType(toT));
- // TODO(vsm): Create a NullCast for this once we revisit nonnullability.
- return new DownCastImplicit(rules, expression, cast);
- }
+ // TODO(vsm): Create a NullCast for this once we revisit nonnullability.
+ return new DownCastImplicit(rules, expression, cast);
}
// Inference "casts":
« lib/src/checker/rules.dart ('K') | « lib/src/compiler.dart ('k') | lib/strong_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698