KT-16436 Incorrect primitive constants handling
Expression '1.unaryMinus()' is resolved as Int::unaryMinus call with Int receiver. However, this expression is implicitly coerced to a different integral type (Byte, Short, Long) based on results of constant evaluation. Introduce IMPLICIT_INTEGER_COERCION type operator to handle such cases. TODO: should we use it for simple constant expressions like '1' and '-1'?
This commit is contained in:
@@ -545,6 +545,12 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("primitivesImplicitConversions.kt")
|
||||
public void testPrimitivesImplicitConversions() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/expressions/primitivesImplicitConversions.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("references.kt")
|
||||
public void testReferences() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/expressions/references.kt");
|
||||
|
||||
Reference in New Issue
Block a user