K2: handle type parameter vs nested class conflict in body resolve properly

This commit does two things:
- prioritize type parameter scopes against static scopes in body resolve
(effectively it's a revert of KT-58028 fix)
- consider type parameters as inapplicable callable, so during callable
resolve we can go up the tower and still resolve to static scope

This allows both KT-58028 and KT-63377 to work properly
#KT-63377 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-11-22 18:19:35 +01:00
committed by Space Team
parent 4e938d852c
commit 83cfcc30c6
25 changed files with 86 additions and 73 deletions
@@ -12,13 +12,13 @@ Tower Data Context:
Element 5
Scope: FirExplicitSimpleImportingScope
Element 6
Scope: FirMemberTypeParameterScope
Classifiers:
FirTypeParameterSymbol F
Element 7
Scope: FirNestedClassifierScopeImpl
Classifiers:
FirRegularClassSymbol public final inner class Bar<B, Outer(F)> : R|kotlin/Any|
Element 7
Scope: FirMemberTypeParameterScope
Classifiers:
FirTypeParameterSymbol F
Element 8
Implicit receiver:
FirRegularClassSymbol public final class Foo<F> : R|kotlin/Any|
@@ -12,13 +12,13 @@ Tower Data Context:
Element 5
Scope: FirExplicitSimpleImportingScope
Element 6
Scope: FirMemberTypeParameterScope
Classifiers:
FirTypeParameterSymbol MyParam
Element 7
Scope: FirNestedClassifierScopeImpl
Classifiers:
FirRegularClassSymbol public final inner class Inner<T : R|MyParam|, Outer(MyParam)> : R|kotlin/Any|
Element 7
Scope: FirMemberTypeParameterScope
Classifiers:
FirTypeParameterSymbol MyParam
Element 8
Implicit receiver:
FirRegularClassSymbol public final class Outer<MyParam> : R|kotlin/Any|
@@ -12,13 +12,13 @@ Tower Data Context:
Element 5
Scope: FirExplicitSimpleImportingScope
Element 6
Scope: FirMemberTypeParameterScope
Classifiers:
FirTypeParameterSymbol MyParam
Element 7
Scope: FirNestedClassifierScopeImpl
Classifiers:
FirRegularClassSymbol public final inner class Inner<Outer(MyParam)> : R|kotlin/Any|
Element 7
Scope: FirMemberTypeParameterScope
Classifiers:
FirTypeParameterSymbol MyParam
Element 8
Implicit receiver:
FirRegularClassSymbol public final class Outer<MyParam> : R|kotlin/Any|
@@ -12,13 +12,13 @@ Tower Data Context:
Element 5
Scope: FirExplicitSimpleImportingScope
Element 6
Scope: FirMemberTypeParameterScope
Classifiers:
FirTypeParameterSymbol MyParam
Element 7
Scope: FirNestedClassifierScopeImpl
Classifiers:
FirRegularClassSymbol public final class Nested<T : <ERROR TYPE REF: Symbol not found for MyParam>> : R|kotlin/Any|
Element 7
Scope: FirMemberTypeParameterScope
Classifiers:
FirTypeParameterSymbol MyParam
Element 8
Implicit receiver:
FirRegularClassSymbol public final class Outer<MyParam> : R|kotlin/Any|