KT-6698 Bad class file when using a star-projection on a Java's recursive generic parameter
#KT-6698 Fixed
This commit is contained in:
@@ -146,6 +146,12 @@ public class BothSignatureWriter {
|
||||
generic = true;
|
||||
}
|
||||
|
||||
public void writeUnboundedWildcard() {
|
||||
signatureVisitor().visitTypeArgument();
|
||||
|
||||
generic = true;
|
||||
}
|
||||
|
||||
public void writeTypeArgumentEnd() {
|
||||
pop();
|
||||
}
|
||||
|
||||
@@ -396,17 +396,22 @@ public class JetTypeMapper {
|
||||
for (TypeParameterDescriptor parameter : jetType.getConstructor().getParameters()) {
|
||||
TypeProjection argument = arguments.get(parameter.getIndex());
|
||||
|
||||
Variance projectionKind = projectionsAllowed
|
||||
? getEffectiveVariance(
|
||||
parameter.getVariance(),
|
||||
argument.getProjectionKind(),
|
||||
howThisTypeIsUsed
|
||||
)
|
||||
: Variance.INVARIANT;
|
||||
signatureVisitor.writeTypeArgument(projectionKind);
|
||||
if (projectionsAllowed && argument.isStarProjection()) {
|
||||
signatureVisitor.writeUnboundedWildcard();
|
||||
}
|
||||
else {
|
||||
Variance projectionKind = projectionsAllowed
|
||||
? getEffectiveVariance(
|
||||
parameter.getVariance(),
|
||||
argument.getProjectionKind(),
|
||||
howThisTypeIsUsed
|
||||
)
|
||||
: Variance.INVARIANT;
|
||||
signatureVisitor.writeTypeArgument(projectionKind);
|
||||
|
||||
mapType(argument.getType(), signatureVisitor, JetTypeMapperMode.TYPE_PARAMETER);
|
||||
signatureVisitor.writeTypeArgumentEnd();
|
||||
mapType(argument.getType(), signatureVisitor, JetTypeMapperMode.TYPE_PARAMETER);
|
||||
signatureVisitor.writeTypeArgumentEnd();
|
||||
}
|
||||
}
|
||||
signatureVisitor.writeClassEnd();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user