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

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

Issue 2965223002: Change inference element invariants (Closed)
Patch Set: Updated cf. comments 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 | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 74f42cd74e23751bf14f0aea09fc9b4db44af3ba..a7a98423f4323ea313f5677ae4fbeda0cd5d5c12 100644
--- a/pkg/compiler/lib/src/inferrer/type_system.dart
+++ b/pkg/compiler/lib/src/inferrer/type_system.dart
@@ -338,19 +338,20 @@ class TypeSystem {
ParameterTypeInformation getInferredTypeOfParameter(
ParameterElement parameter) {
- parameter = parameter.implementation;
+ assert(parameter.isImplementation);
ParameterTypeInformation createTypeInformation() {
- if (parameter.functionDeclaration.isLocal) {
- LocalFunctionElement localFunction = parameter.functionDeclaration;
+ FunctionTypedElement function = parameter.functionDeclaration.declaration;
+ if (function.isLocal) {
+ LocalFunctionElement localFunction = function;
MethodElement callMethod = localFunction.callMethod;
return new ParameterTypeInformation.localFunction(
getInferredTypeOfMember(callMethod),
parameter,
parameter.type,
callMethod);
- } else if (parameter.functionDeclaration.isInstanceMember) {
- MethodElement method = parameter.functionDeclaration;
+ } else if (function.isInstanceMember) {
+ MethodElement method = function;
return new ParameterTypeInformation.instanceMember(
getInferredTypeOfMember(method),
parameter,
@@ -358,7 +359,7 @@ class TypeSystem {
method,
new ParameterAssignments());
} else {
- MethodElement method = parameter.functionDeclaration;
+ MethodElement method = function;
return new ParameterTypeInformation.static(
getInferredTypeOfMember(method), parameter, parameter.type, method,
// TODO(johnniwinther): Is this still valid now that initializing
@@ -375,7 +376,7 @@ class TypeSystem {
}
MemberTypeInformation getInferredTypeOfMember(MemberElement member) {
- member = member.implementation;
+ assert(member.isDeclaration);
return memberTypeInformations.putIfAbsent(member, () {
MemberTypeInformation typeInformation;
if (member.isField) {
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698