TypeProjection interface extracted

This commit is contained in:
Andrey Breslav
2013-09-28 12:02:21 +02:00
parent b98ec9f56b
commit 3960426698
35 changed files with 167 additions and 115 deletions
@@ -1026,7 +1026,7 @@ public class CreateFunctionFromUsageFix extends CreateFromUsageFixBase {
for (TypeProjection projection : type.getArguments()) {
TypeParameterDescriptor typeParameter = typeParameters.get(i);
JetType newArgument = substituteType(projection.getType(), substitution, typeParameter.getVariance());
newArguments.add(new TypeProjection(Variance.INVARIANT, newArgument));
newArguments.add(new TypeProjectionImpl(Variance.INVARIANT, newArgument));
i++;
}
return new JetTypeImpl(type.getAnnotations(), type.getConstructor(),
@@ -1354,7 +1354,7 @@ public class CreateFunctionFromUsageFix extends CreateFromUsageFixBase {
JetType[] returnJetTypeParameterTypes = guessTypesForExpression(variableExpr, context);
if (returnJetTypeParameterTypes.length != 1) return null;
TypeProjection returnJetTypeParameterType = new TypeProjection(returnJetTypeParameterTypes[0]);
TypeProjection returnJetTypeParameterType = new TypeProjectionImpl(returnJetTypeParameterTypes[0]);
List<TypeProjection> returnJetTypeArguments = Collections.singletonList(returnJetTypeParameterType);
returnJetType = new JetTypeImpl(returnJetType.getAnnotations(), returnJetType.getConstructor(), returnJetType.isNullable(),
returnJetTypeArguments, returnJetType.getMemberScope());