Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/contracts/disabledFeature.fir.txt
T
Dmitriy Novozhilov 4c96495eef [FIR] Put new contract syntax under feauture flag
^KT-55171 Fixed
2023-01-31 07:53:09 +00:00

35 lines
1.1 KiB
Plaintext
Vendored

FILE: disabledFeature.kt
public final inline fun <reified T> requreIsInstance(value: R|kotlin/Any|): R|kotlin/Unit|
[R|Contract description]
<
Returns(WILDCARD) -> value is T
>
{
when () {
(R|<local>/value| !is R|T|) -> {
throw R|java/lang/IllegalArgumentException.IllegalArgumentException|()
}
}
}
public final val R|kotlin/Any?|.myLength: R|kotlin/Int?|
public get(): R|kotlin/Int?|
[R|Contract description]
<
>
{
^ (this@R|/myLength| as? R|kotlin/String|)?.{ $subj$.R|kotlin/String.length| }
}
public final fun test_1(x: R|kotlin/Any|): R|kotlin/Unit| {
R|/requreIsInstance|<R|kotlin/String|>(R|<local>/x|)
R|<local>/x|.R|kotlin/String.length|
}
public final fun test_2(x: R|kotlin/Any|): R|kotlin/Unit| {
when () {
!=(R|<local>/x|.R|/myLength|, Null(null)) -> {
R|<local>/x|.<Unresolved name: length>#
}
}
}