[FIR IDE] Ensure resolve to CONTRACTS phase in ReturnTypeCalculator
If we want to analyse some function's call, we need to know about its contracts, otherwise resolving the following code would be broken. Computing return type of function is a prerequisite to using it in any sensible way, so it's the best place to resolve it to CONTRACTS KT-50733
This commit is contained in:
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
Module: lib
|
||||
FILE: module_lib_contractFromOtherModule_samePackage.kt
|
||||
package main
|
||||
|
||||
public final fun requireIsTrue(value: R|kotlin/Boolean|): R|kotlin/Unit|
|
||||
[R|Contract description]
|
||||
<
|
||||
Returns(WILDCARD) -> value
|
||||
>
|
||||
{
|
||||
when () {
|
||||
R|<local>/value|.R|kotlin/Boolean.not|() -> {
|
||||
throw R|java/lang/IllegalArgumentException.IllegalArgumentException|()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Module: main
|
||||
FILE: module_main_contractFromOtherModule_samePackage.kt
|
||||
package main
|
||||
|
||||
public final fun test(s: R|kotlin/Any|): R|kotlin/Unit| {
|
||||
R|main/requireIsTrue|((R|<local>/s| is R|kotlin/String|))
|
||||
R|<local>/s|.R|kotlin/String.length|
|
||||
}
|
||||
Reference in New Issue
Block a user