Force type calculation for local function if it should be inferred
It helps to catch TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM errors because they appear after return type calculation began #KT-6271 Fixed #KT-3272 Obsolete
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// See KT-6271
|
||||
fun foo() {
|
||||
fun fact(n: Int) = {
|
||||
if (n > 0) {
|
||||
<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>fact(n - 1)<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>*<!> n
|
||||
}
|
||||
else {
|
||||
1
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user