Index: lib/src/checker/resolver.dart |
diff --git a/lib/src/checker/resolver.dart b/lib/src/checker/resolver.dart |
index 5ca4c20dae54e941ea7a27f42d784f9624524cd3..4095a9e1136ca8db63e15bbe627f86ac4d7e103f 100644 |
--- a/lib/src/checker/resolver.dart |
+++ b/lib/src/checker/resolver.dart |
@@ -363,7 +363,17 @@ class RestrictedStaticTypeAnalyzer extends StaticTypeAnalyzer { |
visitMethodInvocation(MethodInvocation node) { |
// TODO(sigmund): follow up with analyzer team - why is this needed? |
visitSimpleIdentifier(node.methodName); |
- return super.visitMethodInvocation(node); |
+ super.visitMethodInvocation(node); |
+ |
+ // Fix types for JS builtin calls. |
+ // Analyzer has already computed them in the call above, we just need to |
+ // save it as the method's static return type. |
+ var e = node.methodName.staticElement; |
+ if (e is FunctionElement && |
+ e.library.name == '_foreign_helper' && |
+ e.name == 'JS') { |
+ node.staticType = node.propagatedType; |
vsm
2015/02/27 17:20:05
We haven't been using propagatedType so far - not
Jennifer Messerly
2015/02/27 18:27:07
Analyzer is doing exactly the right logic:
https:/
vsm
2015/02/27 18:39:31
I agree, it's doing the right logic right now. I'
Jennifer Messerly
2015/02/27 18:48:09
I'm super confused :|
soundness -- what does that
vsm
2015/02/27 18:58:02
Sorry for belaboring the point. :-) Here's anoth
Jennifer Messerly
2015/02/27 19:24:48
ah, gotcha. yeah I see how someone could misunders
|
+ } |
} |
// Review note: no longer need to override visitFunctionExpression, this is |