Fix CCE in generated code that happens when comparing boxed chars
The problem was that when obtaining char from the wrapper, codegen used int as expected type that led to a ClassCastException: java.lang.Character cannot be cast to java.lang.Number The solution is using coercion to chars, it's still correct, because of implicit widening coercion in JVM from C to I #KT-15105 Fixed
This commit is contained in:
@@ -785,6 +785,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compareBoxedChars.kt")
|
||||
public void testCompareBoxedChars() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/binaryOp/compareBoxedChars.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compareWithBoxedDouble.kt")
|
||||
public void testCompareWithBoxedDouble() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/binaryOp/compareWithBoxedDouble.kt");
|
||||
|
||||
Reference in New Issue
Block a user