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

Unified Diff: pkg/compiler/lib/src/inferrer/node_tracer.dart

Issue 2967153002: Change MemberTypeInformation.member type to MemberEntity (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/node_tracer.dart
diff --git a/pkg/compiler/lib/src/inferrer/node_tracer.dart b/pkg/compiler/lib/src/inferrer/node_tracer.dart
index ed1a0073c1c5317bc3aa21ca678dc2d17a66068b..0bfbea7443f112acf647506f82928d8ffccc4f56 100644
--- a/pkg/compiler/lib/src/inferrer/node_tracer.dart
+++ b/pkg/compiler/lib/src/inferrer/node_tracer.dart
@@ -431,7 +431,7 @@ abstract class TracerVisitor implements TypeInformationVisitor {
return (name == '[]=');
}
- bool isClosure(Element element) {
+ bool isClosure(MemberEntity element) {
if (!element.isFunction) return false;
/// Creating an instance of a class that implements [Function] also
@@ -442,8 +442,8 @@ abstract class TracerVisitor implements TypeInformationVisitor {
if (element.isInstanceMember && element.name == Identifiers.call) {
return true;
}
- Element outermost = element.outermostEnclosingMemberOrTopLevel;
- return outermost.declaration != element.declaration;
+ ClassEntity cls = element.enclosingClass;
+ return cls != null && cls.isClosure;
}
void visitMemberTypeInformation(MemberTypeInformation info) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698