Skip to content

Commit

Permalink
Handle flexible type in asMemberOf
Browse files Browse the repository at this point in the history
  • Loading branch information
ting-yuan committed Sep 19, 2024
1 parent 7699b6e commit 9faf216
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -606,11 +606,13 @@ internal fun KaValueParameterSymbol.getDefaultValue(): KaAnnotationValue? {

@OptIn(KaExperimentalApi::class)
internal fun fillInDeepSubstitutor(context: KaType, substitutorBuilder: KaSubstitutorBuilder) {
if (context !is KaClassType) {
return
val unwrappedType = when (context) {
is KaClassType -> context
is KaFlexibleType -> context.lowerBound as? KaClassType ?: return
else -> return
}
val parameters = context.symbol.typeParameters
val arguments = context.typeArguments
val parameters = unwrappedType.symbol.typeParameters
val arguments = unwrappedType.typeArguments
if (parameters.size != arguments.size) {
throw IllegalStateException("invalid substitution for $context")
}
Expand Down

0 comments on commit 9faf216

Please sign in to comment.