New J2K: do not add star projection type for raw class literal expression
#KT-15791 fixed
This commit is contained in:
@@ -81,12 +81,12 @@ class TypeMappingConversion(val context: NewJ2kConverterContext) : RecursiveAppl
|
||||
|
||||
private fun JKType.fixRawType(typeElement: JKTypeElement) =
|
||||
when (typeElement.parent) {
|
||||
is JKClassLiteralExpression -> this
|
||||
is JKKtIsExpression ->
|
||||
addTypeParametersToRawProjectionType(JKStarProjectionTypeImpl())
|
||||
.updateNullability(Nullability.NotNull)
|
||||
is JKTypeCastExpression ->
|
||||
addTypeParametersToRawProjectionType(JKStarProjectionTypeImpl())
|
||||
|
||||
else ->
|
||||
addTypeParametersToRawProjectionType(
|
||||
JKStarProjectionTypeImpl()
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import java.util.*;
|
||||
|
||||
class A {
|
||||
public static void main(String[] args) {
|
||||
List.class.isAssignableFrom(ArrayList.class);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import java.util.ArrayList
|
||||
|
||||
internal object A {
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
List::class.java.isAssignableFrom(ArrayList::class.java)
|
||||
}
|
||||
}
|
||||
+5
@@ -2676,6 +2676,11 @@ public class NewJavaToKotlinConverterSingleFileTestGenerated extends AbstractNew
|
||||
runTest("nj2k/testData/newJ2k/issues/kt-14248.java");
|
||||
}
|
||||
|
||||
@TestMetadata("kt-15791.java")
|
||||
public void testKt_15791() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/issues/kt-15791.java");
|
||||
}
|
||||
|
||||
@TestMetadata("kt-16662.java")
|
||||
public void testKt_16662() throws Exception {
|
||||
runTest("nj2k/testData/newJ2k/issues/kt-16662.java");
|
||||
|
||||
Reference in New Issue
Block a user