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

Unified Diff: lib/src/checker/rules.dart

Issue 1395643004: remove most of the StrongOptions (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: rebase 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
« no previous file with comments | « lib/src/checker/resolver.dart ('k') | lib/strong_mode.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/checker/rules.dart
diff --git a/lib/src/checker/rules.dart b/lib/src/checker/rules.dart
index 78825d586a4c6c39a19ee5dde8d852886760b794..7cbe12d31d1468e24c69389c7375300ae0a00858 100644
--- a/lib/src/checker/rules.dart
+++ b/lib/src/checker/rules.dart
@@ -404,7 +404,7 @@ class RestrictedRules extends TypeRules {
// are likely to succeed. The canonical example is List<dynamic> and
// Iterable<T> for some concrete T (e.g. Object). These are unrelated
// in the restricted system, but List<dynamic> <: Iterable<T> in dart.
- if (options.relaxedCasts && fromT.isAssignableTo(toT)) {
+ if (fromT.isAssignableTo(toT)) {
return Coercion.cast(fromT, toT);
}
return Coercion.error();
@@ -416,12 +416,12 @@ class RestrictedRules extends TypeRules {
if (c is Identity) return null;
if (c is CoercionError) return new StaticTypeError(this, expr, toT);
var reason = null;
- if (options.inferDownwards) {
- var errors = <String>[];
- var ok = inferrer.inferExpression(expr, toT, errors);
- if (ok) return InferredType.create(this, expr, toT);
- reason = (errors.isNotEmpty) ? errors.first : null;
- }
+
+ var errors = <String>[];
+ var ok = inferrer.inferExpression(expr, toT, errors);
+ if (ok) return InferredType.create(this, expr, toT);
+ reason = (errors.isNotEmpty) ? errors.first : null;
+
if (c is Cast) return DownCast.create(this, expr, c, reason: reason);
assert(false);
return null;
« no previous file with comments | « lib/src/checker/resolver.dart ('k') | lib/strong_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698