Chromium Code Reviews| Index: pkg/analyzer/lib/src/task/strong/info.dart |
| diff --git a/pkg/analyzer/lib/src/task/strong/info.dart b/pkg/analyzer/lib/src/task/strong/info.dart |
| index d9c912600eaab412ce05292c1655c62663fd9cc3..6dd5318be9991042762c9f81c8dab8b6b720d67f 100644 |
| --- a/pkg/analyzer/lib/src/task/strong/info.dart |
| +++ b/pkg/analyzer/lib/src/task/strong/info.dart |
| @@ -129,11 +129,6 @@ abstract class DownCast extends CoercionInfo { |
| // runtime. |
| return new StaticTypeError(rules, expression, toT, reason: reason); |
| } |
| - if (expression is FunctionExpression) { |
| - // fromT should be an exact type - this will almost certainly fail at |
| - // runtime. |
| - return new UninferredClosure(rules, expression, cast); |
| - } |
|
vsm
2016/01/22 22:51:29
Can you try this test with and without your change
Jennifer Messerly
2016/01/22 23:26:07
Without:
[warning] (int x) {return x;} ((int) → nu
vsm
2016/01/22 23:34:14
Should be an error, not warning, right? The runti
Jennifer Messerly
2016/01/22 23:49:52
Hmmm. I did that but it didn't have any effect. It
Jennifer Messerly
2016/01/25 23:40:29
Ah, I think perhaps my rebuild just failed (I was
|
| if (expression is InstanceCreationExpression) { |
| ConstructorElement e = expression.staticElement; |
| if (e == null || !e.isFactory) { |
| @@ -565,23 +560,3 @@ class StaticTypeError extends StaticError { |
| @override |
| String get name => 'STRONG_MODE_STATIC_TYPE_ERROR'; |
| } |
| - |
| -// |
| -// Temporary "casts" of allocation sites - literals, constructor invocations, |
| -// and closures. These should be handled by contextual inference. In most |
| -// cases, inference will be sufficient, though in some it may unmask an actual |
| -// error: e.g., |
| -// List<int> l = [1, 2, 3]; // Inference succeeds |
| -// List<String> l = [1, 2, 3]; // Inference reveals static type error |
| -// We're marking all as warnings for now. |
| -// |
| -// TODO(vsm,leafp): Remove this. |
| -class UninferredClosure extends DownCast { |
| - UninferredClosure(TypeSystem rules, FunctionExpression expression, Cast cast) |
| - : super._internal(rules, expression, cast); |
| - |
| - @override |
| - String get name => 'STRONG_MODE_UNINFERRED_CLOSURE'; |
| - |
| - toErrorCode() => new StaticTypeWarningCode(name, message); |
| -} |