b2041e0927
There are many complications with the current design of passing data from within in-place lambdas to surrounding code. Solving these complications will involve more time to investigation than is available within the K2 release. So we are disabling passing type statement information from lambdas for the time being until more time can be devoted to a more complete solution. ^KT-60958 Fixed ^KT-63530 Fixed
160 lines
6.7 KiB
Plaintext
Vendored
160 lines
6.7 KiB
Plaintext
Vendored
FILE: flowFromTwoInplaceLambdas.kt
|
|
public final fun <T> n(): R|T?| {
|
|
^n Null(null)
|
|
}
|
|
@R|kotlin/OptIn|(markerClass = vararg(<getClass>(Q|kotlin/contracts/ExperimentalContracts|))) public final fun <T> run2(x: R|() -> T|, y: R|() -> T|): R|kotlin/Unit|
|
|
[R|Contract description]
|
|
<
|
|
CallsInPlace(x, EXACTLY_ONCE)
|
|
CallsInPlace(y, EXACTLY_ONCE)
|
|
>
|
|
{
|
|
{
|
|
R|kotlin/contracts/contract|(<L> = contract@fun R|kotlin/contracts/ContractBuilder|.<anonymous>(): R|kotlin/Unit| <inline=Inline, kind=UNKNOWN> {
|
|
this@R|special/anonymous|.R|kotlin/contracts/ContractBuilder.callsInPlace|<R|T|>(R|<local>/x|, Q|kotlin/contracts/InvocationKind|.R|kotlin/contracts/InvocationKind.EXACTLY_ONCE|)
|
|
this@R|special/anonymous|.R|kotlin/contracts/ContractBuilder.callsInPlace|<R|T|>(R|<local>/y|, Q|kotlin/contracts/InvocationKind|.R|kotlin/contracts/InvocationKind.EXACTLY_ONCE|)
|
|
}
|
|
)
|
|
}
|
|
|
|
R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|T|>|()
|
|
R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|T|>|()
|
|
}
|
|
public final fun test1(x: R|kotlin/String?|): R|kotlin/Unit| {
|
|
lvar p: R|kotlin/String?| = R|<local>/x|
|
|
when () {
|
|
!=(R|<local>/p|, Null(null)) -> {
|
|
R|/run2|<R|kotlin/Int?|>(run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
R|<local>/p| = Null(null)
|
|
^ R|/n|<R|kotlin/Int?|>()
|
|
}
|
|
, run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
R|<local>/p|.R|kotlin/String.length<Inapplicable(UNSTABLE_SMARTCAST): kotlin/String.length>#|
|
|
^ Int(123)
|
|
}
|
|
)
|
|
R|<local>/p|.R|kotlin/String.length<Inapplicable(UNSAFE_CALL): kotlin/String.length>#|
|
|
}
|
|
}
|
|
|
|
}
|
|
public final fun test1_tail(x: R|kotlin/String?|): R|kotlin/Unit| {
|
|
lvar p: R|kotlin/String?| = R|<local>/x|
|
|
when () {
|
|
!=(R|<local>/p|, Null(null)) -> {
|
|
R|/run2|<R|kotlin/Int?|>(run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
R|<local>/p| = Null(null)
|
|
^ R|/n|<R|kotlin/Int?|>()
|
|
}
|
|
, <L> = run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
R|<local>/p|.R|kotlin/String.length<Inapplicable(UNSTABLE_SMARTCAST): kotlin/String.length>#|
|
|
^ Int(123)
|
|
}
|
|
)
|
|
R|<local>/p|.R|kotlin/String.length<Inapplicable(UNSAFE_CALL): kotlin/String.length>#|
|
|
}
|
|
}
|
|
|
|
}
|
|
public final fun test2(x: R|kotlin/Any?|): R|kotlin/Unit| {
|
|
lvar p: R|kotlin/Any?| = R|<local>/x|
|
|
R|<local>/p|.<Unresolved name: length>#
|
|
R|/run2|<R|kotlin/Int?|>(run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
R|<local>/p| = Null(null)
|
|
^ R|/n|<R|kotlin/Int?|>()
|
|
}
|
|
, run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
(R|<local>/p| as R|kotlin/String|)
|
|
^ Int(123)
|
|
}
|
|
)
|
|
R|<local>/p|.<Unresolved name: length>#
|
|
R|<local>/p|?.{ $subj$.<Unresolved name: length># }
|
|
}
|
|
public final fun test3(x: R|kotlin/Any?|): R|kotlin/Unit| {
|
|
lvar p: R|kotlin/Any?| = R|<local>/x|
|
|
R|<local>/p|.<Unresolved name: length>#
|
|
R|/run2|<R|kotlin/Int?|>(run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
R|<local>/p| = Null(null)
|
|
^ R|/n|<R|kotlin/Int?|>()
|
|
}
|
|
, run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
R|<local>/p| = String()
|
|
^ Int(123)
|
|
}
|
|
)
|
|
R|<local>/p|.<Unresolved name: length>#
|
|
R|<local>/p|?.{ $subj$.<Unresolved name: length># }
|
|
}
|
|
public abstract interface I1 : R|kotlin/Any| {
|
|
public abstract val x: R|kotlin/Int|
|
|
public get(): R|kotlin/Int|
|
|
|
|
}
|
|
public abstract interface I2 : R|kotlin/Any| {
|
|
public abstract val y: R|kotlin/Int|
|
|
public get(): R|kotlin/Int|
|
|
|
|
}
|
|
public final fun test4(x: R|kotlin/Any?|): R|kotlin/Unit| {
|
|
R|<local>/x|.<Unresolved name: x>#
|
|
R|<local>/x|.<Unresolved name: y>#
|
|
R|/run2|<R|kotlin/Int?|>(run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
(R|<local>/x| as R|I1|)
|
|
R|<local>/x|.<Unresolved name: y>#
|
|
^ R|/n|<R|kotlin/Int?|>()
|
|
}
|
|
, run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
(R|<local>/x| as R|I2|)
|
|
R|<local>/x|.<Unresolved name: x>#
|
|
^ Int(123)
|
|
}
|
|
)
|
|
R|<local>/x|.<Unresolved name: x>#
|
|
R|<local>/x|.<Unresolved name: y>#
|
|
}
|
|
public final fun test5(x: R|kotlin/Any?|, q: R|kotlin/String?|): R|kotlin/Unit| {
|
|
lvar p: R|kotlin/Any?| = R|<local>/x|
|
|
R|<local>/p|.<Unresolved name: length>#
|
|
R|/run2|<R|kotlin/Int?|>(run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
(R|<local>/p| as R|kotlin/Int|)
|
|
^ Int(123)
|
|
}
|
|
, run2@fun <anonymous>(): R|kotlin/Int?| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
R|<local>/p| = R|<local>/q|
|
|
^ R|/n|<R|kotlin/Int?|>()
|
|
}
|
|
)
|
|
R|<local>/p|.<Unresolved name: length>#
|
|
R|<local>/p|?.{ $subj$.<Unresolved name: length># }
|
|
}
|
|
public final fun test6(): R|kotlin/Unit| {
|
|
lval x: R|kotlin/String|
|
|
R|/run2|<R|kotlin/Int|>(run2@fun <anonymous>(): R|kotlin/Int| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
R|<local>/x| = String()
|
|
^ R|<local>/x|.R|kotlin/String.length|
|
|
}
|
|
, run2@fun <anonymous>(): R|kotlin/Int| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
^ R|<local>/x|.R|kotlin/String.length|
|
|
}
|
|
)
|
|
R|<local>/x|.R|kotlin/String.length|
|
|
}
|
|
public final fun test7(): R|kotlin/Unit| {
|
|
lval x: R|kotlin/Any?| = String()
|
|
lval y: R|kotlin/Any?|
|
|
R|/run2|<R|kotlin/Unit|>(run2@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
R|<local>/y| = R|<local>/x|
|
|
}
|
|
, run2@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline, kind=EXACTLY_ONCE> {
|
|
^@run2 Unit
|
|
}
|
|
)
|
|
when () {
|
|
(R|<local>/y| is R|kotlin/String|) -> {
|
|
R|<local>/x|.R|kotlin/String.length|
|
|
}
|
|
}
|
|
|
|
}
|