Modify test data to reflect changes with IntrinsicConstEvaluation
This commit is contained in:
+39
-9
@@ -21152,9 +21152,27 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumConstName.kt")
|
||||
public void testEnumConstName() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName.kt");
|
||||
@TestMetadata("enumConstName_after.kt")
|
||||
public void testEnumConstName_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumConstName_before.kt")
|
||||
public void testEnumConstName_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_after.kt")
|
||||
public void testEquals_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/equals_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_before.kt")
|
||||
public void testEquals_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/equals_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -21170,15 +21188,27 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifConstVal.kt")
|
||||
public void testIfConstVal() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal.kt");
|
||||
@TestMetadata("ifConstVal_after.kt")
|
||||
public void testIfConstVal_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable.kt")
|
||||
public void testKCallable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable.kt");
|
||||
@TestMetadata("ifConstVal_before.kt")
|
||||
public void testIfConstVal_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable_after.kt")
|
||||
public void testKCallable_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable_before.kt")
|
||||
public void testKCallable_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+39
-9
@@ -21152,9 +21152,27 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumConstName.kt")
|
||||
public void testEnumConstName() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName.kt");
|
||||
@TestMetadata("enumConstName_after.kt")
|
||||
public void testEnumConstName_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumConstName_before.kt")
|
||||
public void testEnumConstName_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_after.kt")
|
||||
public void testEquals_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/equals_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_before.kt")
|
||||
public void testEquals_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/equals_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -21170,15 +21188,27 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifConstVal.kt")
|
||||
public void testIfConstVal() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal.kt");
|
||||
@TestMetadata("ifConstVal_after.kt")
|
||||
public void testIfConstVal_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable.kt")
|
||||
public void testKCallable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable.kt");
|
||||
@TestMetadata("ifConstVal_before.kt")
|
||||
public void testIfConstVal_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable_after.kt")
|
||||
public void testKCallable_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable_before.kt")
|
||||
public void testKCallable_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+39
-9
@@ -21158,9 +21158,27 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumConstName.kt")
|
||||
public void testEnumConstName() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName.kt");
|
||||
@TestMetadata("enumConstName_after.kt")
|
||||
public void testEnumConstName_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumConstName_before.kt")
|
||||
public void testEnumConstName_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_after.kt")
|
||||
public void testEquals_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/equals_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_before.kt")
|
||||
public void testEquals_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/equals_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -21176,15 +21194,27 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifConstVal.kt")
|
||||
public void testIfConstVal() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal.kt");
|
||||
@TestMetadata("ifConstVal_after.kt")
|
||||
public void testIfConstVal_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable.kt")
|
||||
public void testKCallable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable.kt");
|
||||
@TestMetadata("ifConstVal_before.kt")
|
||||
public void testIfConstVal_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable_after.kt")
|
||||
public void testKCallable_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable_before.kt")
|
||||
public void testKCallable_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+6
@@ -28334,6 +28334,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/enumRecursiveName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_after.kt")
|
||||
public void testEquals_after() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/equals_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("floatOperations.kt")
|
||||
public void testFloatOperations() throws Exception {
|
||||
|
||||
+6
@@ -28334,6 +28334,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/enumRecursiveName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_after.kt")
|
||||
public void testEquals_after() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/equals_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("floatOperations.kt")
|
||||
public void testFloatOperations() throws Exception {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR, NATIVE
|
||||
// IGNORE_BACKEND_K2: NATIVE
|
||||
// WITH_STDLIB
|
||||
|
||||
const val a = "INT " + 0x8fffffffU
|
||||
|
||||
+4
-6
@@ -26,11 +26,10 @@ const val compareTo2 = trueVal.compareTo(falseVal)
|
||||
const val compareTo3 = falseVal.compareTo(trueVal)
|
||||
const val compareTo4 = falseVal.compareTo(falseVal)
|
||||
|
||||
const val equals1 = trueVal.equals(trueVal)
|
||||
const val equals2 = trueVal.equals(falseVal)
|
||||
const val equals3 = falseVal.equals(trueVal)
|
||||
const val equals4 = falseVal.equals(falseVal)
|
||||
const val equals5 = falseVal.equals(1)
|
||||
const val equals1 = trueVal == trueVal
|
||||
const val equals2 = trueVal == falseVal
|
||||
const val equals3 = falseVal == trueVal
|
||||
const val equals4 = falseVal == falseVal
|
||||
|
||||
const val toString1 = trueVal.toString()
|
||||
const val toString2 = falseVal.toString()
|
||||
@@ -63,7 +62,6 @@ fun box(): String {
|
||||
if (equals2 != false) return "Fail 6.2"
|
||||
if (equals3 != false) return "Fail 6.3"
|
||||
if (equals4 != true) return "Fail 6.4"
|
||||
if (equals5 != false) return "Fail 6.5"
|
||||
|
||||
if (toString1 != "true") return "Fail 7.1"
|
||||
if (toString2 != "false") return "Fail 7.2"
|
||||
|
||||
+4
-6
@@ -81,11 +81,10 @@ const val convert5 = oneVal.toLong()
|
||||
const val convert6 = oneVal.toFloat()
|
||||
const val convert7 = oneVal.toDouble()
|
||||
|
||||
const val equals1 = oneVal.equals(twoVal)
|
||||
const val equals2 = twoVal.equals(twoVal)
|
||||
const val equals3 = threeVal.equals(twoVal)
|
||||
const val equals4 = fourVal.equals(twoVal)
|
||||
const val equals5 = oneVal.equals("1")
|
||||
const val equals1 = oneVal == twoVal
|
||||
const val equals2 = twoVal == twoVal
|
||||
const val equals3 = threeVal == twoVal
|
||||
const val equals4 = fourVal == twoVal
|
||||
|
||||
const val toString1 = oneVal.toString()
|
||||
const val toString2 = twoVal.toString()
|
||||
@@ -162,7 +161,6 @@ fun box(): String {
|
||||
if (equals2 != true) return "Fail 9.2"
|
||||
if (equals3 != false) return "Fail 9.3"
|
||||
if (equals4 != false) return "Fail 9.4"
|
||||
if (equals5 != false) return "Fail 9.5"
|
||||
|
||||
if (toString1 != "1") return "Fail 10.1"
|
||||
if (toString2 != "2") return "Fail 10.2"
|
||||
|
||||
+4
-6
@@ -36,11 +36,10 @@ const val convert5 = oneVal.toLong()
|
||||
const val convert6 = oneVal.toFloat()
|
||||
const val convert7 = oneVal.toDouble()
|
||||
|
||||
const val equals1 = oneVal.equals(twoVal)
|
||||
const val equals2 = twoVal.equals(twoVal)
|
||||
const val equals3 = threeVal.equals(twoVal)
|
||||
const val equals4 = fourVal.equals(twoVal)
|
||||
const val equals5 = oneVal.equals(1)
|
||||
const val equals1 = oneVal == twoVal
|
||||
const val equals2 = twoVal == twoVal
|
||||
const val equals3 = threeVal == twoVal
|
||||
const val equals4 = fourVal == twoVal
|
||||
|
||||
const val toString1 = oneVal.toString()
|
||||
const val toString2 = twoVal.toString()
|
||||
@@ -83,7 +82,6 @@ fun box(): String {
|
||||
if (equals2 != true) return "Fail 6.2"
|
||||
if (equals3 != false) return "Fail 6.3"
|
||||
if (equals4 != false) return "Fail 6.4"
|
||||
if (equals5 != false) return "Fail 6.5"
|
||||
|
||||
if (toString1 != "1") return "Fail 7.1"
|
||||
if (toString2 != "2") return "Fail 7.2"
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
+4
-6
@@ -79,11 +79,10 @@ const val convert3 = oneVal.toLong()
|
||||
const val convert4 = oneVal.toFloat()
|
||||
const val convert5 = oneVal.toDouble()
|
||||
|
||||
const val equals1 = oneVal.equals(twoVal)
|
||||
const val equals2 = twoVal.equals(twoVal)
|
||||
const val equals3 = threeVal.equals(twoVal)
|
||||
const val equals4 = fourVal.equals(twoVal)
|
||||
const val equals5 = oneVal.equals("1")
|
||||
const val equals1 = oneVal == twoVal
|
||||
const val equals2 = twoVal == twoVal
|
||||
const val equals3 = threeVal == twoVal
|
||||
const val equals4 = fourVal == twoVal
|
||||
|
||||
const val toString1 = oneVal.toString()
|
||||
const val toString2 = twoVal.toString()
|
||||
@@ -158,7 +157,6 @@ fun box(): String {
|
||||
if (equals2 != true) return "Fail 9.2"
|
||||
if (equals3 != false) return "Fail 9.3"
|
||||
if (equals4 != false) return "Fail 9.4"
|
||||
if (equals5 != false) return "Fail 9.5"
|
||||
|
||||
if (toString1 != "1.0") return "Fail 10.1"
|
||||
if (toString2 != "2.0") return "Fail 10.2"
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
|
||||
const val trueVal = true
|
||||
const val falseVal = false
|
||||
|
||||
const val charOneVal = '1'
|
||||
const val charTwoVal = '2'
|
||||
const val charThreeVal = '3'
|
||||
const val charFourVal = '4'
|
||||
|
||||
const val byteMinusOneVal = (-1).toByte()
|
||||
const val byteOneVal = 1.toByte()
|
||||
const val byteTwoVal = 2.toByte()
|
||||
const val byteThreeVal = 3.toByte()
|
||||
const val byteFourVal = 4.toByte()
|
||||
|
||||
const val shortMinusOneVal = (-1).toShort()
|
||||
const val shortOneVal = 1.toShort()
|
||||
const val shortTwoVal = 2.toShort()
|
||||
const val shortThreeVal = 3.toShort()
|
||||
const val shortFourVal = 4.toShort()
|
||||
|
||||
const val intMinusOneVal = -1
|
||||
const val intOneVal = 1
|
||||
const val intTwoVal = 2
|
||||
const val intThreeVal = 3
|
||||
const val intFourVal = 4
|
||||
|
||||
const val longMinusOneVal = -1L
|
||||
const val longOneVal = 1L
|
||||
const val longTwoVal = 2L
|
||||
const val longThreeVal = 3L
|
||||
const val longFourVal = 4L
|
||||
|
||||
const val floatMinusOneVal = -1.0f
|
||||
const val floatOneVal = 1.0f
|
||||
const val floatTwoVal = 2.0f
|
||||
const val floatThreeVal = 3.0f
|
||||
const val floatFourVal = 4.0f
|
||||
|
||||
const val doubleMinusOneVal = -1.0
|
||||
const val doubleOneVal = 1.0
|
||||
const val doubleTwoVal = 2.0
|
||||
const val doubleThreeVal = 3.0
|
||||
const val doubleFourVal = 4.0
|
||||
|
||||
const val someStr = "123"
|
||||
const val otherStr = "other"
|
||||
|
||||
const val equalsBoolean1 = trueVal.equals(trueVal)
|
||||
const val equalsBoolean2 = trueVal == falseVal
|
||||
const val equalsBoolean3 = falseVal.equals(1)
|
||||
|
||||
const val equalsChar1 = charOneVal.equals(charTwoVal)
|
||||
const val equalsChar2 = charTwoVal.equals(charTwoVal)
|
||||
const val equalsChar3 = charThreeVal == charTwoVal
|
||||
const val equalsChar4 = charFourVal.equals(1)
|
||||
|
||||
const val equalsByte1 = byteOneVal.equals(byteTwoVal)
|
||||
const val equalsByte2 = byteTwoVal.equals(byteTwoVal)
|
||||
const val equalsByte3 = byteThreeVal == byteTwoVal
|
||||
const val equalsByte4 = byteFourVal.equals(1)
|
||||
|
||||
const val equalsShort1 = shortOneVal.equals(shortTwoVal)
|
||||
const val equalsShort2 = shortTwoVal.equals(shortTwoVal)
|
||||
const val equalsShort3 = shortThreeVal == shortTwoVal
|
||||
const val equalsShort4 = shortFourVal.equals(1)
|
||||
|
||||
const val equalsInt1 = intOneVal.equals(intTwoVal)
|
||||
const val equalsInt2 = intTwoVal.equals(intTwoVal)
|
||||
const val equalsInt3 = intThreeVal == intTwoVal
|
||||
const val equalsInt4 = intFourVal.equals(1)
|
||||
|
||||
const val equalsLong1 = longOneVal.equals(longTwoVal)
|
||||
const val equalsLong2 = longTwoVal.equals(longTwoVal)
|
||||
const val equalsLong3 = longThreeVal == longTwoVal
|
||||
const val equalsLong4 = longFourVal.equals(1)
|
||||
|
||||
const val equalsFloat1 = floatOneVal.equals(floatTwoVal)
|
||||
const val equalsFloat2 = floatTwoVal.equals(floatTwoVal)
|
||||
const val equalsFloat3 = floatThreeVal == floatTwoVal
|
||||
const val equalsFloat4 = floatFourVal.equals(1)
|
||||
|
||||
const val equalsDouble1 = doubleOneVal.equals(doubleTwoVal)
|
||||
const val equalsDouble2 = doubleTwoVal.equals(doubleTwoVal)
|
||||
const val equalsDouble3 = doubleThreeVal == doubleTwoVal
|
||||
const val equalsDouble4 = doubleFourVal.equals(1)
|
||||
|
||||
const val equalsString1 = someStr.equals(otherStr)
|
||||
const val equalsString2 = someStr.equals("123")
|
||||
const val equalsString3 = otherStr == someStr
|
||||
const val equalsString4 = someStr.equals(1)
|
||||
|
||||
fun box(): String {
|
||||
if (equalsBoolean1 != true) return "Fail 1.1"
|
||||
if (equalsBoolean2 != false) return "Fail 1.2"
|
||||
if (equalsBoolean3 != false) return "Fail 1.3"
|
||||
|
||||
if (equalsChar1 != false) return "Fail 2.1"
|
||||
if (equalsChar2 != true) return "Fail 2.2"
|
||||
if (equalsChar3 != false) return "Fail 2.3"
|
||||
if (equalsChar4 != false) return "Fail 2.3"
|
||||
|
||||
if (equalsByte1 != false) return "Fail 3.1"
|
||||
if (equalsByte2 != true) return "Fail 3.2"
|
||||
if (equalsByte3 != false) return "Fail 3.3"
|
||||
if (equalsByte4 != false) return "Fail 3.3"
|
||||
|
||||
if (equalsShort1 != false) return "Fail 4.1"
|
||||
if (equalsShort2 != true) return "Fail 4.2"
|
||||
if (equalsShort3 != false) return "Fail 4.3"
|
||||
if (equalsShort4 != false) return "Fail 4.3"
|
||||
|
||||
if (equalsInt1 != false) return "Fail 5.1"
|
||||
if (equalsInt2 != true) return "Fail 5.2"
|
||||
if (equalsInt3 != false) return "Fail 5.3"
|
||||
if (equalsInt4 != false) return "Fail 5.3"
|
||||
|
||||
if (equalsLong1 != false) return "Fail 6.1"
|
||||
if (equalsLong2 != true) return "Fail 6.2"
|
||||
if (equalsLong3 != false) return "Fail 6.3"
|
||||
if (equalsLong4 != false) return "Fail 6.3"
|
||||
|
||||
if (equalsFloat1 != false) return "Fail 7.1"
|
||||
if (equalsFloat2 != true) return "Fail 7.2"
|
||||
if (equalsFloat3 != false) return "Fail 7.3"
|
||||
if (equalsFloat4 != false) return "Fail 7.3"
|
||||
|
||||
if (equalsDouble1 != false) return "Fail 8.1"
|
||||
if (equalsDouble2 != true) return "Fail 8.2"
|
||||
if (equalsDouble3 != false) return "Fail 8.3"
|
||||
if (equalsDouble4 != false) return "Fail 8.3"
|
||||
|
||||
if (equalsString1 != false) return "Fail 9.1"
|
||||
if (equalsString2 != true) return "Fail 9.2"
|
||||
if (equalsString3 != false) return "Fail 9.3"
|
||||
if (equalsString4 != false) return "Fail 9.3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+4
-6
@@ -79,11 +79,10 @@ const val convert3 = oneVal.toLong()
|
||||
const val convert4 = oneVal.toFloat()
|
||||
const val convert5 = oneVal.toDouble()
|
||||
|
||||
const val equals1 = oneVal.equals(twoVal)
|
||||
const val equals2 = twoVal.equals(twoVal)
|
||||
const val equals3 = threeVal.equals(twoVal)
|
||||
const val equals4 = fourVal.equals(twoVal)
|
||||
const val equals5 = oneVal.equals("1")
|
||||
const val equals1 = oneVal == twoVal
|
||||
const val equals2 = twoVal == twoVal
|
||||
const val equals3 = threeVal == twoVal
|
||||
const val equals4 = fourVal == twoVal
|
||||
|
||||
const val toString1 = oneVal.toString()
|
||||
const val toString2 = twoVal.toString()
|
||||
@@ -158,7 +157,6 @@ fun box(): String {
|
||||
if (equals2 != true) return "Fail 9.2"
|
||||
if (equals3 != false) return "Fail 9.3"
|
||||
if (equals4 != false) return "Fail 9.4"
|
||||
if (equals5 != false) return "Fail 9.5"
|
||||
|
||||
if (toString1 != "1.0") return "Fail 10.1"
|
||||
if (toString2 != "2.0") return "Fail 10.2"
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
|
||||
+4
-6
@@ -81,11 +81,10 @@ const val convert5 = oneVal.toLong()
|
||||
const val convert6 = oneVal.toFloat()
|
||||
const val convert7 = oneVal.toDouble()
|
||||
|
||||
const val equals1 = oneVal.equals(twoVal)
|
||||
const val equals2 = twoVal.equals(twoVal)
|
||||
const val equals3 = threeVal.equals(twoVal)
|
||||
const val equals4 = fourVal.equals(twoVal)
|
||||
const val equals5 = oneVal.equals("1")
|
||||
const val equals1 = oneVal == twoVal
|
||||
const val equals2 = twoVal == twoVal
|
||||
const val equals3 = threeVal == twoVal
|
||||
const val equals4 = fourVal == twoVal
|
||||
|
||||
const val toString1 = oneVal.toString()
|
||||
const val toString2 = twoVal.toString()
|
||||
@@ -162,7 +161,6 @@ fun box(): String {
|
||||
if (equals2 != true) return "Fail 9.2"
|
||||
if (equals3 != false) return "Fail 9.3"
|
||||
if (equals4 != false) return "Fail 9.4"
|
||||
if (equals5 != false) return "Fail 9.5"
|
||||
|
||||
if (toString1 != "1") return "Fail 10.1"
|
||||
if (toString2 != "2") return "Fail 10.2"
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
|
||||
+4
-6
@@ -81,11 +81,10 @@ const val convert5 = oneVal.toLong()
|
||||
const val convert6 = oneVal.toFloat()
|
||||
const val convert7 = oneVal.toDouble()
|
||||
|
||||
const val equals1 = oneVal.equals(twoVal)
|
||||
const val equals2 = twoVal.equals(twoVal)
|
||||
const val equals3 = threeVal.equals(twoVal)
|
||||
const val equals4 = fourVal.equals(twoVal)
|
||||
const val equals5 = oneVal.equals("1")
|
||||
const val equals1 = oneVal == twoVal
|
||||
const val equals2 = twoVal == twoVal
|
||||
const val equals3 = threeVal == twoVal
|
||||
const val equals4 = fourVal == twoVal
|
||||
|
||||
const val toString1 = oneVal.toString()
|
||||
const val toString2 = twoVal.toString()
|
||||
@@ -162,7 +161,6 @@ fun box(): String {
|
||||
if (equals2 != true) return "Fail 9.2"
|
||||
if (equals3 != false) return "Fail 9.3"
|
||||
if (equals4 != false) return "Fail 9.4"
|
||||
if (equals5 != false) return "Fail 9.5"
|
||||
|
||||
if (toString1 != "1") return "Fail 10.1"
|
||||
if (toString2 != "2") return "Fail 10.2"
|
||||
|
||||
+4
-6
@@ -81,11 +81,10 @@ const val convert5 = oneVal.toLong()
|
||||
const val convert6 = oneVal.toFloat()
|
||||
const val convert7 = oneVal.toDouble()
|
||||
|
||||
const val equals1 = oneVal.equals(twoVal)
|
||||
const val equals2 = twoVal.equals(twoVal)
|
||||
const val equals3 = threeVal.equals(twoVal)
|
||||
const val equals4 = fourVal.equals(twoVal)
|
||||
const val equals5 = oneVal.equals("1")
|
||||
const val equals1 = oneVal == twoVal
|
||||
const val equals2 = twoVal == twoVal
|
||||
const val equals3 = threeVal == twoVal
|
||||
const val equals4 = fourVal == twoVal
|
||||
|
||||
const val toString1 = oneVal.toString()
|
||||
const val toString2 = twoVal.toString()
|
||||
@@ -162,7 +161,6 @@ fun box(): String {
|
||||
if (equals2 != true) return "Fail 9.2"
|
||||
if (equals3 != false) return "Fail 9.3"
|
||||
if (equals4 != false) return "Fail 9.4"
|
||||
if (equals5 != false) return "Fail 9.5"
|
||||
|
||||
if (toString1 != "1") return "Fail 10.1"
|
||||
if (toString2 != "2") return "Fail 10.2"
|
||||
|
||||
+3
-7
@@ -18,11 +18,9 @@ const val compareTo1 = someStr.compareTo("123")
|
||||
const val compareTo2 = someStr.compareTo(otherStr)
|
||||
const val compareTo3 = otherStr.compareTo(someStr)
|
||||
|
||||
const val equals1 = someStr.equals("123")
|
||||
const val equals2 = someStr.equals(otherStr)
|
||||
const val equals3 = otherStr.equals(someStr)
|
||||
const val equals4 = someStr.equals(oneVal)
|
||||
const val equals5 = someStr.equals(1)
|
||||
const val equals1 = someStr == "123"
|
||||
const val equals2 = someStr == otherStr
|
||||
const val equals3 = otherStr == someStr
|
||||
|
||||
const val toString1 = someStr.toString()
|
||||
|
||||
@@ -43,8 +41,6 @@ fun box(): String {
|
||||
if (equals1 != true) return "Fail 5.1"
|
||||
if (equals2 != false) return "Fail 5.2"
|
||||
if (equals3 != false) return "Fail 5.3"
|
||||
if (equals4 != false) return "Fail 5.4"
|
||||
if (equals5 != false) return "Fail 5.5"
|
||||
|
||||
if (toString1 != "123") return "Fail 6.1"
|
||||
return "OK"
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package
|
||||
|
||||
public const val name1: kotlin.String
|
||||
public const val name2: kotlin.String
|
||||
public const val name3: kotlin.String
|
||||
public const val name4: kotlin.String
|
||||
|
||||
public final enum class EnumClass : kotlin.Enum<EnumClass> {
|
||||
enum entry OK
|
||||
|
||||
enum entry VALUE
|
||||
|
||||
enum entry anotherValue
|
||||
|
||||
enum entry WITH_UNDERSCORE
|
||||
|
||||
private constructor EnumClass()
|
||||
@kotlin.internal.IntrinsicConstEvaluation public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: EnumClass): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<EnumClass!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ val entries: kotlin.enums.EnumEntries<EnumClass>
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): EnumClass
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<EnumClass>
|
||||
}
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
|
||||
enum class EnumClass {
|
||||
OK, VALUE, anotherValue, WITH_UNDERSCORE
|
||||
}
|
||||
@@ -5,4 +7,4 @@ enum class EnumClass {
|
||||
const val name1 = EnumClass.OK.name
|
||||
const val name2 = EnumClass.VALUE.name
|
||||
const val name3 = EnumClass.anotherValue.name
|
||||
const val name4 = EnumClass.WITH_UNDERSCORE.name
|
||||
const val name4 = EnumClass.WITH_UNDERSCORE.name
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
|
||||
enum class EnumClass {
|
||||
OK, VALUE, anotherValue, WITH_UNDERSCORE
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -IntrinsicConstEvaluation
|
||||
|
||||
enum class EnumClass {
|
||||
OK, VALUE, anotherValue, WITH_UNDERSCORE
|
||||
}
|
||||
|
||||
const val name1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>EnumClass.OK.name<!>
|
||||
const val name2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>EnumClass.VALUE.name<!>
|
||||
const val name3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>EnumClass.anotherValue.name<!>
|
||||
const val name4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>EnumClass.WITH_UNDERSCORE.name<!>
|
||||
@@ -0,0 +1,46 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
|
||||
const val equalsBoolean1 = true.equals(true)
|
||||
const val equalsBoolean2 = false != true
|
||||
const val equalsBoolean3 = false.equals(1)
|
||||
const val equalsBoolean4 = <!EQUALITY_NOT_APPLICABLE_WARNING!>false == 1<!>
|
||||
|
||||
const val equalsChar1 = '1'.equals('2')
|
||||
const val equalsChar2 = '2' == '2'
|
||||
const val equalsChar3 = '1'.equals(1)
|
||||
const val equalsChar4 = <!EQUALITY_NOT_APPLICABLE_WARNING!>'1' == 1<!>
|
||||
|
||||
const val equalsByte1 = 1.toByte().equals(2.toByte())
|
||||
const val equalsByte2 = 2.toByte() == 2.toByte()
|
||||
const val equalsByte3 = 1.toByte().equals("1")
|
||||
const val equalsByte4 = <!EQUALITY_NOT_APPLICABLE!>1.toByte() == "1"<!>
|
||||
|
||||
const val equalsShort1 = 1.toShort().equals(2.toShort())
|
||||
const val equalsShort2 = 2.toShort() == 2.toShort()
|
||||
const val equalsShort3 = 1.toShort().equals("1")
|
||||
const val equalsShort4 = <!EQUALITY_NOT_APPLICABLE!>1.toShort() == "1"<!>
|
||||
|
||||
const val equalsInt1 = 1.equals(2)
|
||||
const val equalsInt2 = 2 == 2
|
||||
const val equalsInt3 = 1.equals("1")
|
||||
const val equalsInt4 = <!EQUALITY_NOT_APPLICABLE!>1 == "1"<!>
|
||||
|
||||
const val equalsLong1 = 1L.equals(2L)
|
||||
const val equalsLong2 = 2L == 2L
|
||||
const val equalsLong3 = 1L.equals("1")
|
||||
const val equalsLong4 = <!EQUALITY_NOT_APPLICABLE!>1L == "1"<!>
|
||||
|
||||
const val equalsFloat1 = 1.0f.equals(2.0f)
|
||||
const val equalsFloat2 = 2.0f == 2.0f
|
||||
const val equalsFloat3 = 1.0f.equals("1")
|
||||
const val equalsFloat4 = <!EQUALITY_NOT_APPLICABLE!>1.0f == "1"<!>
|
||||
|
||||
const val equalsDoable1 = 1.0.equals(2.0)
|
||||
const val equalsDoable2 = 2.0 == 2.0
|
||||
const val equalsDoable3 = 1.0.equals("1")
|
||||
const val equalsDoable4 = <!EQUALITY_NOT_APPLICABLE!>1.0 == "1"<!>
|
||||
|
||||
const val equalsString1 = "someStr".equals("123")
|
||||
const val equalsString2 = "someStr" == "otherStr"
|
||||
const val equalsString3 = "someStr".equals(1)
|
||||
const val equalsString4 = <!EQUALITY_NOT_APPLICABLE!>"someStr" == 1<!>
|
||||
@@ -0,0 +1,46 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
|
||||
const val equalsBoolean1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>true.equals(true)<!>
|
||||
const val equalsBoolean2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>false != true<!>
|
||||
const val equalsBoolean3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>false.equals(1)<!>
|
||||
const val equalsBoolean4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>false == 1<!>
|
||||
|
||||
const val equalsChar1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>'1'.equals('2')<!>
|
||||
const val equalsChar2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>'2' == '2'<!>
|
||||
const val equalsChar3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>'1'.equals(1)<!>
|
||||
const val equalsChar4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>'1' == 1<!>
|
||||
|
||||
const val equalsByte1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toByte().equals(2.toByte())<!>
|
||||
const val equalsByte2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2.toByte() == 2.toByte()<!>
|
||||
const val equalsByte3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toByte().equals("1")<!>
|
||||
const val equalsByte4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1.toByte() == "1"<!>
|
||||
|
||||
const val equalsShort1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toShort().equals(2.toShort())<!>
|
||||
const val equalsShort2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2.toShort() == 2.toShort()<!>
|
||||
const val equalsShort3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toShort().equals("1")<!>
|
||||
const val equalsShort4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1.toShort() == "1"<!>
|
||||
|
||||
const val equalsInt1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.equals(2)<!>
|
||||
const val equalsInt2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2 == 2<!>
|
||||
const val equalsInt3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.equals("1")<!>
|
||||
const val equalsInt4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1 == "1"<!>
|
||||
|
||||
const val equalsLong1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1L.equals(2L)<!>
|
||||
const val equalsLong2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2L == 2L<!>
|
||||
const val equalsLong3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1L.equals("1")<!>
|
||||
const val equalsLong4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1L == "1"<!>
|
||||
|
||||
const val equalsFloat1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0f.equals(2.0f)<!>
|
||||
const val equalsFloat2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2.0f == 2.0f<!>
|
||||
const val equalsFloat3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0f.equals("1")<!>
|
||||
const val equalsFloat4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1.0f == "1"<!>
|
||||
|
||||
const val equalsDoable1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0.equals(2.0)<!>
|
||||
const val equalsDoable2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2.0 == 2.0<!>
|
||||
const val equalsDoable3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0.equals("1")<!>
|
||||
const val equalsDoable4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1.0 == "1"<!>
|
||||
|
||||
const val equalsString1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"someStr".equals("123")<!>
|
||||
const val equalsString2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"someStr" == "otherStr"<!>
|
||||
const val equalsString3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"someStr".equals(1)<!>
|
||||
const val equalsString4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>"someStr" == 1<!>
|
||||
@@ -0,0 +1,46 @@
|
||||
// !LANGUAGE: -IntrinsicConstEvaluation
|
||||
|
||||
const val equalsBoolean1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>true.equals(true)<!>
|
||||
const val equalsBoolean2 = false != true
|
||||
const val equalsBoolean3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>false.equals(1)<!>
|
||||
const val equalsBoolean4 = <!EQUALITY_NOT_APPLICABLE_WARNING!>false == 1<!>
|
||||
|
||||
const val equalsChar1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>'1'.equals('2')<!>
|
||||
const val equalsChar2 = '2' == '2'
|
||||
const val equalsChar3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>'1'.equals(1)<!>
|
||||
const val equalsChar4 = <!EQUALITY_NOT_APPLICABLE_WARNING!>'1' == 1<!>
|
||||
|
||||
const val equalsByte1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toByte().equals(2.toByte())<!>
|
||||
const val equalsByte2 = 2.toByte() == 2.toByte()
|
||||
const val equalsByte3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toByte().equals("1")<!>
|
||||
const val equalsByte4 = <!EQUALITY_NOT_APPLICABLE!>1.toByte() == "1"<!>
|
||||
|
||||
const val equalsShort1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toShort().equals(2.toShort())<!>
|
||||
const val equalsShort2 = 2.toShort() == 2.toShort()
|
||||
const val equalsShort3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toShort().equals("1")<!>
|
||||
const val equalsShort4 = <!EQUALITY_NOT_APPLICABLE!>1.toShort() == "1"<!>
|
||||
|
||||
const val equalsInt1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.equals(2)<!>
|
||||
const val equalsInt2 = 2 == 2
|
||||
const val equalsInt3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.equals("1")<!>
|
||||
const val equalsInt4 = <!EQUALITY_NOT_APPLICABLE!>1 == "1"<!>
|
||||
|
||||
const val equalsLong1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1L.equals(2L)<!>
|
||||
const val equalsLong2 = 2L == 2L
|
||||
const val equalsLong3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1L.equals("1")<!>
|
||||
const val equalsLong4 = <!EQUALITY_NOT_APPLICABLE!>1L == "1"<!>
|
||||
|
||||
const val equalsFloat1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0f.equals(2.0f)<!>
|
||||
const val equalsFloat2 = 2.0f == 2.0f
|
||||
const val equalsFloat3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0f.equals("1")<!>
|
||||
const val equalsFloat4 = <!EQUALITY_NOT_APPLICABLE!>1.0f == "1"<!>
|
||||
|
||||
const val equalsDoable1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0.equals(2.0)<!>
|
||||
const val equalsDoable2 = 2.0 == 2.0
|
||||
const val equalsDoable3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0.equals("1")<!>
|
||||
const val equalsDoable4 = <!EQUALITY_NOT_APPLICABLE!>1.0 == "1"<!>
|
||||
|
||||
const val equalsString1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"someStr".equals("123")<!>
|
||||
const val equalsString2 = "someStr" == "otherStr"
|
||||
const val equalsString3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"someStr".equals(1)<!>
|
||||
const val equalsString4 = <!EQUALITY_NOT_APPLICABLE!>"someStr" == 1<!>
|
||||
@@ -0,0 +1,46 @@
|
||||
// !LANGUAGE: -IntrinsicConstEvaluation
|
||||
|
||||
const val equalsBoolean1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>true.equals(true)<!>
|
||||
const val equalsBoolean2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>false != true<!>
|
||||
const val equalsBoolean3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>false.equals(1)<!>
|
||||
const val equalsBoolean4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>false == 1<!>
|
||||
|
||||
const val equalsChar1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>'1'.equals('2')<!>
|
||||
const val equalsChar2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>'2' == '2'<!>
|
||||
const val equalsChar3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>'1'.equals(1)<!>
|
||||
const val equalsChar4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>'1' == 1<!>
|
||||
|
||||
const val equalsByte1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toByte().equals(2.toByte())<!>
|
||||
const val equalsByte2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2.toByte() == 2.toByte()<!>
|
||||
const val equalsByte3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toByte().equals("1")<!>
|
||||
const val equalsByte4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1.toByte() == "1"<!>
|
||||
|
||||
const val equalsShort1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toShort().equals(2.toShort())<!>
|
||||
const val equalsShort2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2.toShort() == 2.toShort()<!>
|
||||
const val equalsShort3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toShort().equals("1")<!>
|
||||
const val equalsShort4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1.toShort() == "1"<!>
|
||||
|
||||
const val equalsInt1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.equals(2)<!>
|
||||
const val equalsInt2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2 == 2<!>
|
||||
const val equalsInt3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.equals("1")<!>
|
||||
const val equalsInt4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1 == "1"<!>
|
||||
|
||||
const val equalsLong1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1L.equals(2L)<!>
|
||||
const val equalsLong2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2L == 2L<!>
|
||||
const val equalsLong3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1L.equals("1")<!>
|
||||
const val equalsLong4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1L == "1"<!>
|
||||
|
||||
const val equalsFloat1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0f.equals(2.0f)<!>
|
||||
const val equalsFloat2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2.0f == 2.0f<!>
|
||||
const val equalsFloat3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0f.equals("1")<!>
|
||||
const val equalsFloat4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1.0f == "1"<!>
|
||||
|
||||
const val equalsDoable1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0.equals(2.0)<!>
|
||||
const val equalsDoable2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2.0 == 2.0<!>
|
||||
const val equalsDoable3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0.equals("1")<!>
|
||||
const val equalsDoable4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1.0 == "1"<!>
|
||||
|
||||
const val equalsString1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"someStr".equals("123")<!>
|
||||
const val equalsString2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"someStr" == "otherStr"<!>
|
||||
const val equalsString3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"someStr".equals(1)<!>
|
||||
const val equalsString4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>"someStr" == 1<!>
|
||||
@@ -1,13 +0,0 @@
|
||||
package
|
||||
|
||||
public const val condition: kotlin.String
|
||||
public const val errorBranch: kotlin.Boolean
|
||||
public const val errorConstIf: kotlin.Int
|
||||
public const val flag: kotlin.Boolean = true
|
||||
public const val multibranchIf: kotlin.Int
|
||||
public val nonConstFlag: kotlin.Boolean = true
|
||||
public const val value: kotlin.Int = 10
|
||||
public const val withWhen: kotlin.String
|
||||
public const val withWhen2: kotlin.String
|
||||
public const val withWhen3: kotlin.String
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
|
||||
const val flag = true
|
||||
const val value = 10
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
|
||||
const val flag = true
|
||||
const val value = 10
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -IntrinsicConstEvaluation
|
||||
|
||||
const val flag = true
|
||||
const val value = 10
|
||||
|
||||
const val condition = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>if (flag) "True" else "Error"<!>
|
||||
const val withWhen = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>when (flag) {
|
||||
true -> "True"
|
||||
else -> "Error"
|
||||
}<!>
|
||||
const val withWhen2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>when {
|
||||
flag == true -> "True"
|
||||
else -> "Error"
|
||||
}<!>
|
||||
const val withWhen3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>when(value) {
|
||||
10 -> "1"
|
||||
100 -> "2"
|
||||
else -> "3"
|
||||
}<!>
|
||||
const val multibranchIf = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>if (value == 100) 1 else if (value == 1000) 2 else 3<!>
|
||||
|
||||
val nonConstFlag = true
|
||||
const val errorConstIf = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>if (nonConstFlag) 1 else 2<!>
|
||||
const val errorBranch = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>if (flag) nonConstFlag else false<!>
|
||||
@@ -1,22 +0,0 @@
|
||||
package
|
||||
|
||||
public const val anotherPropName: kotlin.String
|
||||
public const val barName: kotlin.String
|
||||
public const val className: kotlin.String
|
||||
public const val errorAccess: kotlin.String
|
||||
public const val errorPlus: kotlin.String
|
||||
public const val fooName: kotlin.String
|
||||
public const val lengthPropName: kotlin.String
|
||||
public const val propName: kotlin.String
|
||||
public const val stringClassName: kotlin.String
|
||||
|
||||
public final class SomeClassWithName {
|
||||
public constructor SomeClassWithName(/*0*/ property: kotlin.Int)
|
||||
public final val anotherProperty: kotlin.String = ""
|
||||
public final val property: kotlin.Int
|
||||
public final fun bar(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Double): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
|
||||
class SomeClassWithName(val property: Int) {
|
||||
val anotherProperty: String = ""
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||
|
||||
class SomeClassWithName(val property: Int) {
|
||||
val anotherProperty: String = ""
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -IntrinsicConstEvaluation
|
||||
|
||||
class SomeClassWithName(val property: Int) {
|
||||
val anotherProperty: String = ""
|
||||
|
||||
fun foo() {}
|
||||
fun bar(a: Int, b: Double): String = ""
|
||||
}
|
||||
|
||||
const val className = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>::SomeClassWithName.name<!>
|
||||
const val propName = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>SomeClassWithName::property.name<!>
|
||||
const val anotherPropName = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>SomeClassWithName::anotherProperty.name<!>
|
||||
const val fooName = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>SomeClassWithName::foo.name<!>
|
||||
const val barName = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>SomeClassWithName::bar.name<!>
|
||||
|
||||
const val stringClassName = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>::String.name<!>
|
||||
const val lengthPropName = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>String::length.name<!>
|
||||
|
||||
const val errorAccess = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>SomeClassWithName(1)::property.name<!>
|
||||
const val errorPlus = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"" + SomeClassWithName(1)::property<!>
|
||||
Generated
+39
-9
@@ -21158,9 +21158,27 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumConstName.kt")
|
||||
public void testEnumConstName() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName.kt");
|
||||
@TestMetadata("enumConstName_after.kt")
|
||||
public void testEnumConstName_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumConstName_before.kt")
|
||||
public void testEnumConstName_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/enumConstName_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_after.kt")
|
||||
public void testEquals_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/equals_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_before.kt")
|
||||
public void testEquals_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/equals_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -21176,15 +21194,27 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifConstVal.kt")
|
||||
public void testIfConstVal() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal.kt");
|
||||
@TestMetadata("ifConstVal_after.kt")
|
||||
public void testIfConstVal_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable.kt")
|
||||
public void testKCallable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable.kt");
|
||||
@TestMetadata("ifConstVal_before.kt")
|
||||
public void testIfConstVal_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/ifConstVal_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable_after.kt")
|
||||
public void testKCallable_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kCallable_before.kt")
|
||||
public void testKCallable_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/modifiers/const/kCallable_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+6
@@ -28334,6 +28334,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/enumRecursiveName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_after.kt")
|
||||
public void testEquals_after() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/equals_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("floatOperations.kt")
|
||||
public void testFloatOperations() throws Exception {
|
||||
|
||||
+6
@@ -28334,6 +28334,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/enumRecursiveName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals_after.kt")
|
||||
public void testEquals_after() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/involvesIrInterpreter/dumpIrAndCheck/equals_after.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("floatOperations.kt")
|
||||
public void testFloatOperations() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user