Skip to content

Commit 96006b7

Browse files
committed
[FIR] Properly handle captured type parameters in callable reference resolution
^KT-68350 Fixed
1 parent 0239292 commit 96006b7

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/FirDoubleColonExpressionResolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class FirDoubleColonExpressionResolver(private val session: FirSession) {
152152
// We currently only support local classes with captured type parameters from non-classes
153153
// (i.e. local class in generic function).
154154
// TODO(KT-66344) Support inner classes
155-
val typeParameter = firClassLikeDeclaration.typeParameters[0]
155+
val typeParameter = firClassLikeDeclaration.typeParameters[index]
156156
if (firClassLikeDeclaration.isLocal && typeParameter is FirOuterClassTypeParameterRef && typeParameter.symbol.containingDeclarationSymbol !is FirClassSymbol) {
157157
typeParameter.symbol.defaultType
158158
} else {

compiler/testData/diagnostics/tests/callableReference/generic/localClassWithCapturedTypeParameters.fir.kt

Lines changed: 0 additions & 9 deletions
This file was deleted.

compiler/testData/diagnostics/tests/callableReference/generic/localClassWithCapturedTypeParameters.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// FIR_IDENTICAL
12
// WITH_STDLIB
23
// ISSUE: KT-68350
34

0 commit comments

Comments
 (0)