Skip to content

Commit

Permalink
add Any to unbounded type parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
neetopia committed Aug 17, 2023
1 parent ff047fe commit 0f6084f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
package com.google.devtools.ksp.impl.symbol.kotlin

import com.google.devtools.ksp.KSObjectCache
import com.google.devtools.ksp.impl.ResolverAAImpl
import com.google.devtools.ksp.processing.impl.KSNameImpl
import com.google.devtools.ksp.processing.impl.KSTypeReferenceSyntheticImpl
import com.google.devtools.ksp.symbol.*
import org.jetbrains.kotlin.analysis.api.symbols.KtTypeParameterSymbol

Expand Down Expand Up @@ -48,6 +50,10 @@ class KSTypeParameterImpl private constructor(internal val ktTypeParameterSymbol
override val bounds: Sequence<KSTypeReference> by lazy {
ktTypeParameterSymbol.upperBounds.asSequence().mapIndexed { index, type ->
KSTypeReferenceImpl.getCached(type, this@KSTypeParameterImpl, index)
}.ifEmpty {
sequenceOf(
KSTypeReferenceSyntheticImpl.getCached(ResolverAAImpl.instance.builtIns.anyType.makeNullable(), this)
)
}
}

Expand Down

0 comments on commit 0f6084f

Please sign in to comment.