[LL FIR] KT-55339 Fix supertype collection in LL FIR supertype resolver

- LL FIR didn't report a `RECURSIVE_TYPEALIAS_EXPANSION` error on `F2`
  in `recursive.fir.kt`. While the resolver correctly associates `F2`
  with a cyclic error supertype in the supertype computation session,
  that error supertype was never assigned to `F2`.
- Why? `F2`'s supertype is a function type, so the supertype's
  `classLikeDeclaration` in `collect` is `Function1`, which has no
  containing file. Thus, the `Function1` was simply skipped, without
  adding `F2` to the designators to which supertypes are later applied
  via `apply`.
- The fix takes supertypes without containing files into account by
  crawling their type arguments, which possibly leads the collector to
  further designations, such as `F2`, which is reachable via the
  function type's type arguments.

^KT-55339 fixed
This commit is contained in:
Marco Pennekamp
2022-12-15 15:47:23 +01:00
committed by teamcity
parent 2cdcdce6ed
commit 34a1569375
3 changed files with 58 additions and 31 deletions
@@ -1,4 +1,3 @@
// FIR_IDE_IGNORE
typealias R = <!RECURSIVE_TYPEALIAS_EXPANSION!>R<!>
typealias L = <!RECURSIVE_TYPEALIAS_EXPANSION!>List<L><!>
@@ -1,4 +1,3 @@
// FIR_IDE_IGNORE
typealias R = <!RECURSIVE_TYPEALIAS_EXPANSION!>R<!>
typealias L = <!RECURSIVE_TYPEALIAS_EXPANSION!>List<L><!>