Reverted modification in TypeTransformingVisitor in "Renamed & moved AllInjectorsGenerator".
It was not relevant to that commit: it was squashed accidentally during interactive rebasing.
This commit is contained in:
+2
-6
@@ -124,9 +124,9 @@ class TypeTransformingVisitor extends JetVisitor<JetType, Void> {
|
|||||||
TypeProjection argument = arguments.get(i);
|
TypeProjection argument = arguments.get(i);
|
||||||
JetType alternativeType = computeType(argumentAlternativeTypeElement, argument.getType(), originalToAltTypeParameters);
|
JetType alternativeType = computeType(argumentAlternativeTypeElement, argument.getType(), originalToAltTypeParameters);
|
||||||
Variance variance = argument.getProjectionKind();
|
Variance variance = argument.getProjectionKind();
|
||||||
Variance altVariance;
|
|
||||||
if (type instanceof JetUserType) {
|
if (type instanceof JetUserType) {
|
||||||
JetTypeProjection typeProjection = ((JetUserType) type).getTypeArguments().get(i);
|
JetTypeProjection typeProjection = ((JetUserType) type).getTypeArguments().get(i);
|
||||||
|
Variance altVariance = Variance.INVARIANT;
|
||||||
switch (typeProjection.getProjectionKind()) {
|
switch (typeProjection.getProjectionKind()) {
|
||||||
case IN:
|
case IN:
|
||||||
altVariance = Variance.IN_VARIANCE;
|
altVariance = Variance.IN_VARIANCE;
|
||||||
@@ -137,16 +137,12 @@ class TypeTransformingVisitor extends JetVisitor<JetType, Void> {
|
|||||||
case STAR:
|
case STAR:
|
||||||
throw new AlternativeSignatureMismatchException("Star projection is not available in alternative signatures");
|
throw new AlternativeSignatureMismatchException("Star projection is not available in alternative signatures");
|
||||||
default:
|
default:
|
||||||
altVariance = Variance.INVARIANT;
|
|
||||||
}
|
}
|
||||||
if (altVariance != variance && variance != Variance.INVARIANT) {
|
if (altVariance != variance && variance != Variance.INVARIANT) {
|
||||||
throw new AlternativeSignatureMismatchException("Variance mismatch, actual: %s, in alternative signature: %s", variance, altVariance);
|
throw new AlternativeSignatureMismatchException("Variance mismatch, actual: %s, in alternative signature: %s", variance, altVariance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
altArguments.add(new TypeProjection(variance, alternativeType));
|
||||||
altVariance = variance;
|
|
||||||
}
|
|
||||||
altArguments.add(new TypeProjection(altVariance, alternativeType));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TypeConstructor typeConstructor;
|
TypeConstructor typeConstructor;
|
||||||
|
|||||||
Reference in New Issue
Block a user