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 0dbe196a6f71b54c81b75e8481380261c507c4eb..03589b3bcfd093a069ac7b69596aa73f8eaa0ada 100644 |
--- a/pkg/compiler/lib/src/inferrer/type_system.dart |
+++ b/pkg/compiler/lib/src/inferrer/type_system.dart |
@@ -290,8 +290,7 @@ class TypeSystem { |
* [isNullable] indicates whether the annotation implies a null |
* type. |
*/ |
- TypeInformation narrowType( |
- TypeInformation type, DartType annotation, |
+ TypeInformation narrowType(TypeInformation type, DartType annotation, |
{bool isNullable: true}) { |
if (annotation.treatAsDynamic) return type; |
if (annotation.isVoid) return type; |
@@ -346,9 +345,7 @@ class TypeSystem { |
LocalFunctionElement localFunction = parameter.functionDeclaration; |
MethodElement callMethod = localFunction.callMethod; |
return new ParameterTypeInformation.localFunction( |
- getInferredTypeOfMember(callMethod), |
- parameter, |
- callMethod); |
+ getInferredTypeOfMember(callMethod), parameter, callMethod); |
} else if (parameter.functionDeclaration.isInstanceMember) { |
MethodElement method = parameter.functionDeclaration; |
return new ParameterTypeInformation.instanceMember( |
@@ -373,7 +370,23 @@ class TypeSystem { |
MemberTypeInformation getInferredTypeOfMember(MemberElement member) { |
member = member.implementation; |
return memberTypeInformations.putIfAbsent(member, () { |
- MemberTypeInformation typeInformation = new MemberTypeInformation(member); |
+ MemberTypeInformation typeInformation; |
+ if (member.isField) { |
+ typeInformation = new FieldTypeInformation(member); |
+ } else if (member.isGetter) { |
+ typeInformation = new GetterTypeInformation(member); |
+ } else if (member.isSetter) { |
+ typeInformation = new SetterTypeInformation(member); |
+ } else if (member.isFunction) { |
+ typeInformation = new MethodTypeInformation(member); |
+ } else { |
+ ConstructorElement constructor = member; |
+ if (constructor.isFactoryConstructor) { |
+ typeInformation = new FactoryConstructorTypeInformation(member); |
+ } else { |
+ typeInformation = new GenerativeConstructorTypeInformation(member); |
+ } |
+ } |
_orderedTypeInformations.add(typeInformation); |
return typeInformation; |
}); |