[LL FIR] KT-55327 Use body resolve return type calculator for locals

- LL FIR uses `ReturnTypeCalculatorWithJump` by default because it
  cannot guarantee that the implicit types of non-local functions
  referenced in a function `f` have been resolved during body resolve
  of `f`.
- However, if `ReturnTypeCalculatorWithJump` encountered a local
  function, it tried to resolve its return type even during body
  resolve of that same local function. The fix delegates to
  `ReturnTypeCalculatorForFullBodyResolve`, which should be used for
  local declarations.

^KT-55327 fixed
^KT-55324 fixed
This commit is contained in:
Marco Pennekamp
2022-12-08 20:17:44 +01:00
parent 28759a3ac3
commit 2cdcdce6ed
11 changed files with 10 additions and 12 deletions
@@ -1,4 +1,3 @@
// FIR_IDE_IGNORE
// See KT-6271
fun foo() {
fun fact(n: Int) = {
@@ -1,4 +1,3 @@
// FIR_IDE_IGNORE
// See KT-6271
fun foo() {
fun fact(n: Int) = {
@@ -1,4 +1,3 @@
// FIR_IDE_IGNORE
fun foo() {
fun bar() = (fun() = bar())
}
@@ -1,4 +1,3 @@
// FIR_IDE_IGNORE
fun foo() {
fun bar() = (fun() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!><!DEBUG_INFO_MISSING_UNRESOLVED!>bar<!>()<!>)
}
@@ -1,4 +1,3 @@
// FIR_IDE_IGNORE
fun foo() {
fun bar() = {
bar()
@@ -1,4 +1,3 @@
// FIR_IDE_IGNORE
fun foo() {
fun bar() = {
<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!><!DEBUG_INFO_MISSING_UNRESOLVED!>bar<!>()<!>
@@ -1,4 +1,3 @@
// FIR_IDE_IGNORE
fun foo() {
fun bar1() = bar1()
@@ -1,4 +1,3 @@
// FIR_IDE_IGNORE
fun foo() {
fun bar1() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!><!DEBUG_INFO_MISSING_UNRESOLVED!>bar1<!>()<!>