[FE] Don't analyze members with CLASSIFIERS kind filter in AbstractLazyMemberScope

This commit introduces partial support of descriptorKindFilter in
  `AbstractPsiBasedDeclarationProvider`. Without it there may be an error
  in following case:

```
sealed class Base
class Derived : Base()

class Test<out V>(val x: Base) {
    private val y = when (x) {
        is Derived -> null
    }
}
```

Here we start to resolve type of `y`, then go to computation of inheritors
  of sealed class Base, which also may be inside Test, so we need get all
  nested classifiers in Test. But without this filtration we will start
  computing descriptor for `y` again, which leads to ReenteringLazyComputationException

#KT-44316 Fixed
This commit is contained in:
Dmitriy Novozhilov
2021-02-10 12:08:18 +03:00
parent 903defdf30
commit 0c0c53cc2e
7 changed files with 89 additions and 3 deletions
@@ -24391,6 +24391,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
runTest("compiler/testData/diagnostics/tests/sealed/inheritorInDifferentModule.kt");
}
@Test
@TestMetadata("kt44316.kt")
public void testKt44316() throws Exception {
runTest("compiler/testData/diagnostics/tests/sealed/kt44316.kt");
}
@Test
@TestMetadata("Local.kt")
public void testLocal() throws Exception {