fix java.lang.Number type mapping to jet.Number (KT-2376)
This commit is contained in:
@@ -1051,7 +1051,8 @@ public class JetTypeMapper {
|
||||
return JvmPrimitiveType.getByWrapperClass(className) != null
|
||||
|| className.getFqName().getFqName().equals("java.lang.String")
|
||||
|| className.getFqName().getFqName().equals("java.lang.CharSequence")
|
||||
|| className.getFqName().getFqName().equals("java.lang.Object");
|
||||
|| className.getFqName().getFqName().equals("java.lang.Object")
|
||||
|| className.getFqName().getFqName().equals("java.lang.Number");
|
||||
}
|
||||
|
||||
public boolean isGenericsArray(JetType type) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package test
|
||||
import java.util.*
|
||||
|
||||
public open class WrongTypeVariance : Object() {
|
||||
public open fun copy(p0 : List<out java.lang.Number?>?, p1 : List<in java.lang.Number?>?) : List<java.lang.Number?>? {
|
||||
public open fun copy(p0 : List<out jet.Number?>?, p1 : List<in jet.Number?>?) : List<jet.Number?>? {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ namespace test
|
||||
|
||||
public open class test.WrongTypeVariance : java.lang.Object {
|
||||
public final /*constructor*/ fun <init>(): test.WrongTypeVariance
|
||||
public open fun copy(/*0*/ p0: java.util.List<out java.lang.Number?>?, /*1*/ p1: java.util.List<in java.lang.Number?>?): java.util.List<java.lang.Number?>?
|
||||
public open fun copy(/*0*/ p0: java.util.List<out jet.Number?>?, /*1*/ p1: java.util.List<in jet.Number?>?): java.util.List<jet.Number?>?
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
fun number(): java.lang.Number = throw Exception()
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace test
|
||||
|
||||
internal final fun number(): java.lang.Number
|
||||
+5
@@ -701,6 +701,11 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/type/jlIntegerQ.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("jlNumber.kt")
|
||||
public void testJlNumber() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/type/jlNumber.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("jlObject.kt")
|
||||
public void testJlObject() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/readKotlinBinaryClass/type/jlObject.kt");
|
||||
|
||||
@@ -96,7 +96,7 @@ public class JetSignatureReader {
|
||||
pos = end + 1;
|
||||
|
||||
c = signature.charAt(pos);
|
||||
if (c == 'L' || c == '[' || c == 'T' || c == '?') {
|
||||
if (c == 'L' || c == 'M' || c == '[' || c == 'T' || c == '?') {
|
||||
pos = parseType(signature, pos, parameterVisitor.visitClassBound());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user