419f54259c
Previously helpers from checkType.kt was in special package, and
if directive was enabled then test runner (`AbstractDiagnosticTest`)
injected additional imports to test files and removed them after test
was completed.
It's very hard to support such behavior in new test infrastructure so
there was a decision about changing `CHECK_TYPE`:
1. All helpers from `checkType.kt` now stays in default package
2. `CHECK_TYPE` only adds `checkType.kt` to set of analyzed files
and don't modify their content
For test which are written in default package (most of tests actually)
there are no changes. On the other hand if there is a test where dev
want to use checkType functions in testfile with some package then he
should explicitly import functions which he needed (`checkSubtype`,
`checkType`, `_`)
71 lines
3.3 KiB
Plaintext
Vendored
71 lines
3.3 KiB
Plaintext
Vendored
FILE: lambdaArgInScopeFunction.kt
|
|
public final class KotlinClass : R|kotlin/Comparable<KotlinClass>| {
|
|
public constructor(name: R|kotlin/String|): R|KotlinClass| {
|
|
super<R|kotlin/Any|>()
|
|
}
|
|
|
|
private final val name: R|kotlin/String| = R|<local>/name|
|
|
private get(): R|kotlin/String|
|
|
|
|
public final override operator fun compareTo(that: R|KotlinClass|): R|kotlin/Int| {
|
|
^compareTo this@R|/KotlinClass|.R|/KotlinClass.name|.R|kotlin/String.compareTo|(R|<local>/that|.R|/KotlinClass.name|)
|
|
}
|
|
|
|
}
|
|
public final fun case1(kotlinClass: R|KotlinClass?|): R|kotlin/Unit| {
|
|
lval value: R|KotlinClass?| = R|<local>/kotlinClass|?.{ $subj$.R|kotlin/let|<R|KotlinClass|, R|KotlinClass|>(<L> = let@fun <anonymous>(it: R|KotlinClass|): R|KotlinClass| <kind=EXACTLY_ONCE> {
|
|
^ R|<local>/it|
|
|
}
|
|
) }
|
|
R|<local>/value|.R|/checkType|<R|KotlinClass?|>(<L> = checkType@fun R|CheckTypeInv<KotlinClass?>|.<anonymous>(): R|kotlin/Unit| {
|
|
this@R|special/anonymous|.R|/_|<R|KotlinClass?|>()
|
|
}
|
|
)
|
|
lval lambda: R|() -> KotlinClass| = R|<local>/kotlinClass|?.{ $subj$.R|kotlin/let|<R|KotlinClass|, R|() -> KotlinClass|>(<L> = let@fun <anonymous>(it: R|KotlinClass|): R|() -> KotlinClass| <kind=EXACTLY_ONCE> {
|
|
^ let@fun <anonymous>(): R|KotlinClass| {
|
|
^ R|<local>/it|
|
|
}
|
|
|
|
}
|
|
) }
|
|
R|<local>/lambda|.R|/checkType|<R|() -> KotlinClass|>(<L> = checkType@fun R|CheckTypeInv<kotlin/Function0<KotlinClass>?>|.<anonymous>(): R|kotlin/Unit| {
|
|
this@R|special/anonymous|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /_>#<R|(kotlin/Unit) -> KotlinClass?|>()
|
|
}
|
|
)
|
|
}
|
|
public final fun case2(kotlinClass: R|KotlinClass|): R|kotlin/Unit| {
|
|
lval value: R|KotlinClass| = R|<local>/kotlinClass|.R|kotlin/let|<R|KotlinClass|, R|KotlinClass|>(<L> = let@fun <anonymous>(it: R|KotlinClass|): R|KotlinClass| <kind=EXACTLY_ONCE> {
|
|
^ R|<local>/it|
|
|
}
|
|
)
|
|
R|<local>/value|.R|/checkType|<R|KotlinClass|>(<L> = checkType@fun R|CheckTypeInv<KotlinClass>|.<anonymous>(): R|kotlin/Unit| {
|
|
this@R|special/anonymous|.R|/_|<R|KotlinClass|>()
|
|
}
|
|
)
|
|
lval lambda: R|() -> KotlinClass| = R|<local>/kotlinClass|.R|kotlin/let|<R|KotlinClass|, R|() -> KotlinClass|>(<L> = let@fun <anonymous>(it: R|KotlinClass|): R|() -> KotlinClass| <kind=EXACTLY_ONCE> {
|
|
^ let@fun <anonymous>(): R|KotlinClass| {
|
|
^ R|<local>/it|
|
|
}
|
|
|
|
}
|
|
)
|
|
R|<local>/lambda|.R|/checkType|<R|() -> KotlinClass|>(<L> = checkType@fun R|CheckTypeInv<kotlin/Function0<KotlinClass>>|.<anonymous>(): R|kotlin/Unit| {
|
|
this@R|special/anonymous|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /_>#<R|(kotlin/Unit) -> KotlinClass?|>()
|
|
}
|
|
)
|
|
}
|
|
FILE: CHECK_TYPE.kt
|
|
public final fun <T> checkSubtype(t: R|T|): R|T| {
|
|
^checkSubtype R|<local>/t|
|
|
}
|
|
public final class CheckTypeInv<T> : R|kotlin/Any| {
|
|
public constructor<T>(): R|CheckTypeInv<T>| {
|
|
super<R|kotlin/Any|>()
|
|
}
|
|
|
|
}
|
|
public final fun <E> R|CheckTypeInv<E>|._(): R|kotlin/Unit| {
|
|
}
|
|
public final infix fun <T> R|T|.checkType(f: R|CheckTypeInv<T>.() -> kotlin/Unit|): R|kotlin/Unit| {
|
|
}
|