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

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

Issue 2968743002: Use .callMethod instead of LocalFunctionElement as key in inference (Closed)
Patch Set: Created 3 years, 6 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
Index: pkg/compiler/lib/src/inferrer/type_system.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_system.dart b/pkg/compiler/lib/src/inferrer/type_system.dart
index 14703c1350f02ec762c726136467e61454f2c683..4a0240ad3af7d546bed068a40899aa05bc3161b0 100644
--- a/pkg/compiler/lib/src/inferrer/type_system.dart
+++ b/pkg/compiler/lib/src/inferrer/type_system.dart
@@ -331,14 +331,9 @@ class TypeSystem {
}
@deprecated
- ElementTypeInformation getInferredTypeOfLocalFunction(
- LocalFunctionElement element) {
- return _getInferredTypeOf(element);
- }
-
- @deprecated
ElementTypeInformation _getInferredTypeOf(Element element) {
element = element.implementation;
+ assert(element.isParameter || element is MemberElement);
return typeInformations[element] ??=
new ElementTypeInformation(element, this);
}
@@ -353,18 +348,9 @@ class TypeSystem {
});
}
- String getInferredSignatureOfLocalFunction(LocalFunctionElement function) {
- return _getInferredSignatureOf(
- getInferredTypeOfLocalFunction(function), function);
- }
-
String getInferredSignatureOfMethod(MethodElement function) {
- return _getInferredSignatureOf(getInferredTypeOfMember(function), function);
- }
-
- String _getInferredSignatureOf(
- ElementTypeInformation info, FunctionElement function) {
- FunctionElement impl = function.implementation;
+ ElementTypeInformation info = getInferredTypeOfMember(function);
+ MethodElement impl = function.implementation;
FunctionSignature signature = impl.functionSignature;
var res = "";
signature.forEachParameter((Element parameter) {
@@ -424,18 +410,9 @@ class TypeSystem {
new ListTypeInformation(currentMember, mask, element, length);
}
- /// Creates a [TypeInformation] object for the local function [element] of
- /// a function expression or local function declaration used as a closure.
- TypeInformation allocateClosureForLocalFunction(
- ast.Node node, LocalFunctionElement element) {
- TypeInformation result =
- new LocalFunctionClosureTypeInformation(currentMember, node, element);
- allocatedClosures.add(result);
- return result;
- }
-
- /// Creates a [TypeInformation] object for the closurization of a static or
- /// top-level method [element] used a function constant.
+ /// Creates a [TypeInformation] object either for the closurization of a
+ /// static or top-level method [element] used as a function constant or for
+ /// the synthesized 'call' method [element] created for a local function.
TypeInformation allocateClosureForMethod(
Siggi Cherem (dart-lang) 2017/06/30 18:13:54 allocateClosure (remove forMethod now?)
Johnni Winther 2017/06/30 19:02:02 Done.
ast.Node node, MethodElement element) {
TypeInformation result =

Powered by Google App Engine
This is Rietveld 408576698