From 4374c065377cda0ca6ec9d6abc594d5418c7d450 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 18 Sep 2020 11:05:44 +0300 Subject: [PATCH] [FIR] Approximate all integer literals which resolved in independent mode #KT-42016 --- .../arguments/operatorsOverLiterals.kt | 22 ++++++++-------- .../arguments/operatorsOverLiterals.txt | 22 ++++++++-------- .../resolve/delegatingConstructorCall.kt | 6 ++--- .../resolve/delegatingConstructorCall.txt | 6 ++--- .../FirDeclarationsResolveTransformer.kt | 4 ++- .../FirExpressionsResolveTransformer.kt | 15 ++--------- .../binaryExpressionCast.kt | 4 +-- .../labeledExpressionCast.kt | 4 +-- .../codegen/box/evaluate/intrinsics.kt | 1 - .../specialNames/propertyMetadataCache.fir.kt | 4 +-- .../evaluate/binaryMinusDepOnExpType.fir.kt | 8 +++--- .../evaluate/numberBinaryOperations.fir.kt | 26 +++++++++++++++++++ .../tests/evaluate/numberBinaryOperations.kt | 3 +-- .../numberBinaryOperationsCall.fir.kt | 26 +++++++++++++++++++ .../evaluate/numberBinaryOperationsCall.kt | 3 +-- .../numberBinaryOperationsInfixCall.fir.kt | 26 +++++++++---------- .../commonSystem/iltInsideSeveralCalls.kt | 4 +-- .../operatorRem/numberRemConversions.fir.kt | 8 +++--- ...genericConstructorCallWithTypeArguments.kt | 2 +- .../primitivesImplicitConversions.fir.txt | 6 ++--- .../testData/ir/irText/stubs/simple.fir.txt | 12 --------- compiler/testData/ir/irText/stubs/simple.kt | 1 + 22 files changed, 121 insertions(+), 92 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.fir.kt create mode 100644 compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt delete mode 100644 compiler/testData/ir/irText/stubs/simple.fir.txt diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt index 3c9920026f5..5309319fed2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt @@ -31,33 +31,33 @@ fun test_3() { fun takeByte(b: Byte) {} fun test_4() { - takeByte(1 + 1) + takeByte(1 + 1) takeByte(1 + 127) - takeByte(1 - 1) + takeByte(1 - 1) takeByte(-100 - 100) - takeByte(10 * 10) + takeByte(10 * 10) takeByte(100 * 100) taleByte(10 / 10) - takeByte(100 % 10) - takeByte(1000 % 10) - takeByte(1000 and 100) + takeByte(100 % 10) + takeByte(1000 % 10) + takeByte(1000 and 100) takeByte(128 and 511) - takeByte(100 or 100) + takeByte(100 or 100) takeByte(1000 or 0) - takeByte(511 xor 511) + takeByte(511 xor 511) takeByte(512 xor 511) } fun test_5() { takeByte(-1) takeByte(+1) - takeByte(1.inv()) + takeByte(1.inv()) } fun test_6() { takeByte(run { 127 + 1 }) takeByte(1 + run { 1 }) - takeByte(run { 1 + 1 }) + takeByte(run { 1 + 1 }) 1 + 1 run { 1 } 1 + run { 1 } @@ -66,4 +66,4 @@ fun test_6() { fun test_7(d: Double) { val x1 = 1 + d val x2 = d + 1 -} \ No newline at end of file +} diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.txt index 3121b69dafb..6879a2928fe 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.txt @@ -29,37 +29,37 @@ FILE: operatorsOverLiterals.kt public final fun takeByte(b: R|kotlin/Byte|): R|kotlin/Unit| { } public final fun test_4(): R|kotlin/Unit| { - R|/takeByte|(Byte(1).R|kotlin/Byte.plus|(Byte(1))) + #(Int(1).R|kotlin/Int.plus|(Int(1))) #(Int(1).R|kotlin/Int.plus|(Int(127))) - R|/takeByte|(Byte(1).R|kotlin/Byte.minus|(Byte(1))) + #(Int(1).R|kotlin/Int.minus|(Int(1))) #(Int(-100).R|kotlin/Int.minus|(Int(100))) - R|/takeByte|(Byte(10).R|kotlin/Byte.times|(Byte(10))) + #(Int(10).R|kotlin/Int.times|(Int(10))) #(Int(100).R|kotlin/Int.times|(Int(100))) #(Int(10).R|kotlin/Int.div|(Int(10))) - R|/takeByte|(Byte(100).R|kotlin/Byte.rem|(Byte(10))) - R|/takeByte|(Int(1000).R|kotlin/Int.rem|(Byte(10))) - R|/takeByte|(Int(1000).R|/and|(Byte(100))) + #(Int(100).R|kotlin/Int.rem|(Int(10))) + #(Int(1000).R|kotlin/Int.rem|(Int(10))) + #(Int(1000).R|kotlin/Int.and|(Int(100))) #(Int(128).R|kotlin/Int.and|(Int(511))) - R|/takeByte|(Byte(100).R|/or|(Byte(100))) + #(Int(100).R|kotlin/Int.or|(Int(100))) #(Int(1000).R|kotlin/Int.or|(Int(0))) - R|/takeByte|(Int(511).R|kotlin/Int.xor|(Int(511))) + #(Int(511).R|kotlin/Int.xor|(Int(511))) #(Int(512).R|kotlin/Int.xor|(Int(511))) } public final fun test_5(): R|kotlin/Unit| { R|/takeByte|(Byte(-1)) R|/takeByte|(Byte(1)) - R|/takeByte|(Byte(1).R|/inv|()) + #(Int(1).R|kotlin/Int.inv|()) } public final fun test_6(): R|kotlin/Unit| { #(R|kotlin/run|( = run@fun (): R|kotlin/Int| { ^ Int(127).R|kotlin/Int.plus|(Int(1)) } )) - #(Int(1).R|/plus|(R|kotlin/run|( = run@fun (): R|kotlin/Int| { + #(Int(1).R|kotlin/Int.plus|(R|kotlin/run|( = run@fun (): R|kotlin/Int| { ^ Int(1) } ))) - R|/takeByte|(R|kotlin/run|( = run@fun (): R|kotlin/Byte| { + #(R|kotlin/run|( = run@fun (): R|kotlin/Int| { ^ Int(1).R|kotlin/Int.plus|(Int(1)) } )) diff --git a/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt b/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt index f38568a6589..5d6d63eb1a1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt @@ -16,12 +16,12 @@ class B3_3 : A3("", true) class B3_4 : A3("", Unit) open class A4(val x: Byte) -class B4 : A4( 1 + 1) +class B4 : A4( 1 + 1) open class A5 { constructor(x: Byte) constructor(x: Short) } -class B5_1 : A5(1 + 1) -class B5_2 : A5(100 * 2) +class B5_1 : A5(1 + 1) +class B5_2 : A5(100 * 2) diff --git a/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.txt b/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.txt index c78301b6fc7..7d5fc2c3992 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.txt @@ -77,7 +77,7 @@ FILE: delegatingConstructorCall.kt } public final class B4 : R|A4| { public constructor(): R|B4| { - super(Byte(1).R|kotlin/Byte.plus|(Byte(1))) + super(Int(1).R|kotlin/Int.plus|(Int(1))) } } @@ -93,13 +93,13 @@ FILE: delegatingConstructorCall.kt } public final class B5_1 : R|A5| { public constructor(): R|B5_1| { - super(Short(1).R|kotlin/Short.plus|(Short(1))) + super(Int(1).R|kotlin/Int.plus|(Int(1))) } } public final class B5_2 : R|A5| { public constructor(): R|B5_2| { - super(Short(100).R|kotlin/Short.times|(Short(2))) + super(Int(100).R|kotlin/Int.times|(Int(2))) } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt index 6788a35c7ed..e93f9d78fe5 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt @@ -251,7 +251,9 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor } (delegateProvider as? FirFunctionCall)?.let { dataFlowAnalyzer.dropSubgraphFromCall(it) } - return wrappedDelegateExpression.expression.transform(transformer, ResolutionMode.ContextDependent) + return wrappedDelegateExpression.expression + .transformSingle(transformer, ResolutionMode.ContextDependent) + .transform(integerLiteralTypeApproximator, null) } finally { dataFlowAnalyzer.exitDelegateExpression() } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt index 7591789a52f..e3fa222aa48 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt @@ -714,20 +714,9 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform FirConstKind.IntegerLiteral, FirConstKind.UnsignedIntegerLiteral -> { val integerLiteralType = ConeIntegerLiteralTypeImpl(constExpression.value as Long, isUnsigned = kind == FirConstKind.UnsignedIntegerLiteral) - val expectedType = data.expectedType?.coneTypeSafe() - if (expectedType != null) { - val approximatedType = integerLiteralType.getApproximatedType(expectedType) + if (data.expectedType != null) { + val approximatedType = integerLiteralType.getApproximatedType(data.expectedType?.coneTypeSafe()) val newConstKind = approximatedType.toConstKind() - if (newConstKind == null) { - @Suppress("UNCHECKED_CAST") - constExpression.replaceKind(FirConstKind.Int as FirConstKind) - dataFlowAnalyzer.exitConstExpression(constExpression as FirConstExpression<*>) - constExpression.resultType = buildErrorTypeRef { - source = constExpression.source - diagnostic = ConeTypeMismatchError(expectedType, integerLiteralType.getApproximatedType()) - } - return constExpression.compose() - } @Suppress("UNCHECKED_CAST") constExpression.replaceKind(newConstKind as FirConstKind) approximatedType diff --git a/compiler/testData/codegen/box/casts/literalExpressionAsGenericArgument/binaryExpressionCast.kt b/compiler/testData/codegen/box/casts/literalExpressionAsGenericArgument/binaryExpressionCast.kt index 8f18303c58c..c235f2ffb0f 100644 --- a/compiler/testData/codegen/box/casts/literalExpressionAsGenericArgument/binaryExpressionCast.kt +++ b/compiler/testData/codegen/box/casts/literalExpressionAsGenericArgument/binaryExpressionCast.kt @@ -1,7 +1,7 @@ class Box(val value: T) fun box() : String { - val b = Box(2 * 3) + val b = Box(2l * 3) val expected: Long? = 6L return if (b.value == expected) "OK" else "fail" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/casts/literalExpressionAsGenericArgument/labeledExpressionCast.kt b/compiler/testData/codegen/box/casts/literalExpressionAsGenericArgument/labeledExpressionCast.kt index 229afac35f9..2ddefc8a5be 100644 --- a/compiler/testData/codegen/box/casts/literalExpressionAsGenericArgument/labeledExpressionCast.kt +++ b/compiler/testData/codegen/box/casts/literalExpressionAsGenericArgument/labeledExpressionCast.kt @@ -1,7 +1,7 @@ class Box(val value: T) fun box() : String { - val b = Box(x@ (1 + 2)) + val b = Box(x@ (1l + 2)) val expected: Long? = 3L return if (b.value == expected) "OK" else "fail" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/evaluate/intrinsics.kt b/compiler/testData/codegen/box/evaluate/intrinsics.kt index 01dd26a5e6a..de082796984 100644 --- a/compiler/testData/codegen/box/evaluate/intrinsics.kt +++ b/compiler/testData/codegen/box/evaluate/intrinsics.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.fir.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.fir.kt index d032e8e90e3..55e41e660c7 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.fir.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.fir.kt @@ -5,9 +5,9 @@ import kotlin.reflect.KProperty operator fun Any.getValue(x: Any?, y: Any): Any = null!! class C { - val x by 1 + val x by 1 val `$$delegatedProperties`: Array> = null!! } -val x by 1 +val x by 1 val `$$delegatedProperties`: Array> = null!! diff --git a/compiler/testData/diagnostics/tests/evaluate/binaryMinusDepOnExpType.fir.kt b/compiler/testData/diagnostics/tests/evaluate/binaryMinusDepOnExpType.fir.kt index fdf5c00a2af..1d66c2651bb 100644 --- a/compiler/testData/diagnostics/tests/evaluate/binaryMinusDepOnExpType.fir.kt +++ b/compiler/testData/diagnostics/tests/evaluate/binaryMinusDepOnExpType.fir.kt @@ -10,21 +10,21 @@ fun test() { fooInt(1 - 1.toLong()) fooInt(1 - 1.toShort()) - fooByte(1 - 1) + fooByte(1 - 1) fooByte(1 - 1.toInt()) fooByte(1 - 1.toByte()) fooByte(1 - 1.toLong()) fooByte(1 - 1.toShort()) - fooLong(1 - 1) + fooLong(1 - 1) fooLong(1 - 1.toInt()) fooLong(1 - 1.toByte()) fooLong(1 - 1.toLong()) fooLong(1 - 1.toShort()) - fooShort(1 - 1) + fooShort(1 - 1) fooShort(1 - 1.toInt()) fooShort(1 - 1.toByte()) fooShort(1 - 1.toLong()) fooShort(1 - 1.toShort()) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.fir.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.fir.kt new file mode 100644 index 00000000000..698a000dfc9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.fir.kt @@ -0,0 +1,26 @@ +fun fooInt(p: Int) = p +fun fooLong(p: Long) = p +fun fooByte(p: Byte) = p +fun fooShort(p: Short) = p + +fun test() { + fooInt(1 + 1) + fooByte(1 + 1) + fooLong(1 + 1) + fooShort(1 + 1) + + fooInt(1 * 1) + fooByte(1 * 1) + fooLong(1 * 1) + fooShort(1 * 1) + + fooInt(1 / 1) + fooByte(1 / 1) + fooLong(1 / 1) + fooShort(1 / 1) + + fooInt(1 % 1) + fooByte(1 % 1) + fooLong(1 % 1) + fooShort(1 % 1) +} diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.kt index 9ecda100ac5..1b7e3a9f8fe 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL fun fooInt(p: Int) = p fun fooLong(p: Long) = p fun fooByte(p: Byte) = p @@ -24,4 +23,4 @@ fun test() { fooByte(1 % 1) fooLong(1 % 1) fooShort(1 % 1) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt new file mode 100644 index 00000000000..4b970d3fd07 --- /dev/null +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt @@ -0,0 +1,26 @@ +fun fooInt(p: Int) = p +fun fooLong(p: Long) = p +fun fooByte(p: Byte) = p +fun fooShort(p: Short) = p + +fun test() { + fooInt(1.plus(1)) + fooByte(1.plus(1)) + fooLong(1.plus(1)) + fooShort(1.plus(1)) + + fooInt(1.times(1)) + fooByte(1.times(1)) + fooLong(1.times(1)) + fooShort(1.times(1)) + + fooInt(1.div(1)) + fooByte(1.div(1)) + fooLong(1.div(1)) + fooShort(1.div(1)) + + fooInt(1.rem(1)) + fooByte(1.rem(1)) + fooLong(1.rem(1)) + fooShort(1.rem(1)) +} diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt index cc87f6049ae..bec6e1a879f 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL fun fooInt(p: Int) = p fun fooLong(p: Long) = p fun fooByte(p: Byte) = p @@ -24,4 +23,4 @@ fun test() { fooByte(1.rem(1)) fooLong(1.rem(1)) fooShort(1.rem(1)) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.fir.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.fir.kt index 31771b3cc59..ae38cf02081 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.fir.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsInfixCall.fir.kt @@ -5,22 +5,22 @@ fun fooShort(p: Short) = p fun test() { fooInt(1 plus 1) - fooByte(1 plus 1) - fooLong(1 plus 1) - fooShort(1 plus 1) + fooByte(1 plus 1) + fooLong(1 plus 1) + fooShort(1 plus 1) fooInt(1 times 1) - fooByte(1 times 1) - fooLong(1 times 1) - fooShort(1 times 1) + fooByte(1 times 1) + fooLong(1 times 1) + fooShort(1 times 1) fooInt(1 div 1) - fooByte(1 div 1) - fooLong(1 div 1) - fooShort(1 div 1) + fooByte(1 div 1) + fooLong(1 div 1) + fooShort(1 div 1) fooInt(1 rem 1) - fooByte(1 rem 1) - fooLong(1 rem 1) - fooShort(1 rem 1) -} \ No newline at end of file + fooByte(1 rem 1) + fooLong(1 rem 1) + fooShort(1 rem 1) +} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/iltInsideSeveralCalls.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/iltInsideSeveralCalls.kt index 7be3dd8acae..6b2ac49ad75 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/iltInsideSeveralCalls.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/iltInsideSeveralCalls.kt @@ -5,9 +5,9 @@ fun consumeLongAndMaterialize(x: Long): T = null as T fun consumeAny(x: Any) = x fun main() { - consumeAny(consumeLongAndMaterialize(3 * 1000)) + consumeAny(consumeLongAndMaterialize(3l * 1000)) if (true) { - consumeLongAndMaterialize(3 * 1000) + consumeLongAndMaterialize(3l * 1000) } else true } diff --git a/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.fir.kt b/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.fir.kt index 9ba8553cda5..c0f7356621d 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.fir.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.fir.kt @@ -7,9 +7,9 @@ fun fooShort(p: Short) = p fun test() { fooInt(1 % 1) - fooByte(1 % 1) - fooLong(1 % 1) - fooShort(1 % 1) + fooByte(1 % 1) + fooLong(1 % 1) + fooShort(1 % 1) } -public operator fun Int.rem(other: Int): Int = 0 \ No newline at end of file +public operator fun Int.rem(other: Int): Int = 0 diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt index 08d10e002d0..9ce0bac5f58 100644 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt @@ -1,4 +1,4 @@ -fun testSimple() = Box(2 * 3) +fun testSimple() = Box(2l * 3) inline fun testArray(n: Int, crossinline block: () -> T): Array { return Array(n) { block() } diff --git a/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt index 26c0858a453..37e765acb2c 100644 --- a/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt +++ b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt @@ -29,7 +29,7 @@ FILE fqName: fileName:/primitivesImplicitConversions.kt PROPERTY name:test4 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Long visibility:private [final,static] EXPRESSION_BODY - CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Long origin=null + CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CONST Int type=kotlin.Int value=42 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] @@ -39,7 +39,7 @@ FILE fqName: fileName:/primitivesImplicitConversions.kt PROPERTY name:test5 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Short visibility:private [final,static] EXPRESSION_BODY - CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Short origin=null + CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CONST Int type=kotlin.Int value=42 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Short correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val] @@ -49,7 +49,7 @@ FILE fqName: fileName:/primitivesImplicitConversions.kt PROPERTY name:test6 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Byte visibility:private [final,static] EXPRESSION_BODY - CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Byte origin=null + CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CONST Int type=kotlin.Int value=42 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Byte correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] diff --git a/compiler/testData/ir/irText/stubs/simple.fir.txt b/compiler/testData/ir/irText/stubs/simple.fir.txt deleted file mode 100644 index 90756a8215f..00000000000 --- a/compiler/testData/ir/irText/stubs/simple.fir.txt +++ /dev/null @@ -1,12 +0,0 @@ -FILE fqName: fileName:/simple.kt - PROPERTY name:test visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Int visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CONST Int type=kotlin.Int value=2 - other: CONST Int type=kotlin.Int value=2 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/stubs/simple.kt b/compiler/testData/ir/irText/stubs/simple.kt index 3de5bfcc2db..0178645a003 100644 --- a/compiler/testData/ir/irText/stubs/simple.kt +++ b/compiler/testData/ir/irText/stubs/simple.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DUMP_DEPENDENCIES val test = 2 + 2 \ No newline at end of file