[FIR] Register type related extensions in libraries sessions

^KT-57140
This commit is contained in:
Dmitriy Novozhilov
2023-03-21 17:09:28 +02:00
committed by Space Team
parent 01fc84ee3a
commit 8ca7b32577
13 changed files with 61 additions and 22 deletions
@@ -11,13 +11,13 @@ FILE: dependencyWithoutAttributePlugin.kt
R|org/jetbrains/kotlin/fir/plugin/consumePositiveInt|(R|<local>/someInt|)
}
public final fun test_2(): R|kotlin/Unit| {
lval x: R|@R|org/jetbrains/kotlin/fir/plugin/Positive|() kotlin/Int| = R|org/jetbrains/kotlin/fir/plugin/producePositiveInt|()
lval x: R|@Positive kotlin/Int| = R|org/jetbrains/kotlin/fir/plugin/producePositiveInt|()
R|/takePositive|(R|<local>/x|)
R|/takeNegative|(R|<local>/x|)
R|/takeAny|(R|<local>/x|)
}
public final fun test_3(): R|kotlin/Unit| {
lval x: R|@R|org/jetbrains/kotlin/fir/plugin/Positive|() kotlin/Int| = R|org/jetbrains/kotlin/fir/plugin/produceBoxedPositiveInt|().R|SubstitutionOverride<org/jetbrains/kotlin/fir/plugin/Box.value: R|@R|org/jetbrains/kotlin/fir/plugin/Positive|() kotlin/Int|>|
lval x: R|@Positive kotlin/Int| = R|org/jetbrains/kotlin/fir/plugin/produceBoxedPositiveInt|().R|SubstitutionOverride<org/jetbrains/kotlin/fir/plugin/Box.value: R|@Positive kotlin/Int|>|
R|/takePositive|(R|<local>/x|)
R|/takeNegative|(R|<local>/x|)
R|/takeAny|(R|<local>/x|)
@@ -10,20 +10,20 @@ fun test_1(
someInt: Int
) {
consumePositiveInt(positiveInt)
consumePositiveInt(negativeInt) // should be error
consumePositiveInt(someInt) // should be error
consumePositiveInt(<!ILLEGAL_NUMBER_SIGN!>negativeInt<!>) // should be error
consumePositiveInt(<!ILLEGAL_NUMBER_SIGN!>someInt<!>) // should be error
}
fun test_2() {
val x = producePositiveInt()
takePositive(<!ILLEGAL_NUMBER_SIGN!>x<!>)
takePositive(x)
takeNegative(<!ILLEGAL_NUMBER_SIGN!>x<!>) // should be error
takeAny(x)
}
fun test_3() {
val x = produceBoxedPositiveInt().value
takePositive(<!ILLEGAL_NUMBER_SIGN!>x<!>)
takePositive(x)
takeNegative(<!ILLEGAL_NUMBER_SIGN!>x<!>) // should be error
takeAny(x)
}