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

Unified Diff: lib/type_checker.dart

Issue 2466373002: Type check untyped == calls specially. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | testcases/strong-mode/escape.baseline.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/type_checker.dart
diff --git a/lib/type_checker.dart b/lib/type_checker.dart
index 4ebc31a15403c772a9eecd313a7cba81d915c031..ab47f6e328aead936a0dcab8cba10bcd766081cd 100644
--- a/lib/type_checker.dart
+++ b/lib/type_checker.dart
@@ -461,9 +461,14 @@ class TypeCheckingVisitor
var target = node.interfaceTarget;
if (target == null) {
var receiver = visitExpression(node.receiver);
- return (node.name.name == 'call' && receiver is FunctionType)
- ? handleFunctionCall(node, receiver, node.arguments)
- : handleDynamicCall(receiver, node.arguments);
+ if (node.name.name == '==') {
+ visitExpression(node.arguments.positional.single);
+ return environment.boolType;
ahe 2016/11/01 16:52:24 I don't see how you know that you can return bool
asgerf 2016/11/01 17:07:33 In strong mode (which is what we are checking), op
+ }
+ if (node.name.name == 'call' && receiver is FunctionType) {
+ return handleFunctionCall(node, receiver, node.arguments);
+ }
+ return handleDynamicCall(receiver, node.arguments);
} else if (environment.isOverloadedArithmeticOperator(target)) {
assert(node.arguments.positional.length == 1);
var receiver = visitExpression(node.receiver);
« no previous file with comments | « no previous file | testcases/strong-mode/escape.baseline.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698