File tree Expand file tree Collapse file tree
src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/resolved
src/main/kotlin/com/google/devtools/ksp/processor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import com.google.devtools.ksp.impl.symbol.kotlin.Restorable
2424import com.google.devtools.ksp.impl.symbol.kotlin.annotations
2525import com.google.devtools.ksp.symbol.*
2626import org.jetbrains.kotlin.analysis.api.types.KaStarTypeProjection
27+ import org.jetbrains.kotlin.analysis.api.types.KaType
2728import org.jetbrains.kotlin.analysis.api.types.KaTypeArgumentWithVariance
2829import org.jetbrains.kotlin.analysis.api.types.KaTypeProjection
2930
@@ -50,12 +51,16 @@ class KSTypeArgumentResolvedImpl private constructor(
5051 }
5152 }
5253
54+ private val kaType: KaType ? by lazy {
55+ ktTypeProjection.type?.abbreviation ? : ktTypeProjection.type
56+ }
57+
5358 override val type: KSTypeReference ? by lazy {
54- ktTypeProjection.type ?.let { KSTypeReferenceResolvedImpl .getCached(it, this @KSTypeArgumentResolvedImpl) }
59+ kaType ?.let { KSTypeReferenceResolvedImpl .getCached(it, this @KSTypeArgumentResolvedImpl) }
5560 }
5661
5762 override val annotations: Sequence <KSAnnotation > by lazy {
58- ktTypeProjection.type ?.annotations(this ) ? : emptySequence()
63+ kaType ?.annotations(this ) ? : emptySequence()
5964 }
6065
6166 override val origin: Origin = parent?.origin ? : Origin .SYNTHETIC
Original file line number Diff line number Diff line change 3131// myList_b_String : MyList_B_String = MyList_B<String> = MyList<R> = List<T>
3232// myListOfAlias : MyListOfAlias = List<@JvmSuppressWildcards A>
3333// myListOfAliasInLib : MyListOfAliasInLib = List<@JvmSuppressWildcards AInLib>
34+ // viewBinderProviders : Map<Class<BaseViewHolder>, @JvmSuppressWildcards Provider<BaseEmbedViewBinder>>
35+ // nested1 : MyList<ListOfInt> = List<T>
36+ // nested2 : List<ListOfInt>
3437// END
3538
3639// MODULE: module1
@@ -65,3 +68,13 @@ val myList_String: MyList_String = TODO()
6568val myList_b_String: MyList_B_String = TODO ()
6669val myListOfAlias: MyListOfAlias = TODO ()
6770val myListOfAliasInLib: MyListOfAliasInLib = TODO ()
71+
72+ interface BaseViewHolder
73+ interface SpaceshipEmbedModel
74+ interface Provider <T >
75+ interface ViewBinder <T1 , T2 >
76+ typealias BaseEmbedViewBinder = ViewBinder <out BaseViewHolder , out SpaceshipEmbedModel >
77+
78+ val viewBinderProviders: Map <Class <out BaseViewHolder >, @JvmSuppressWildcards Provider <BaseEmbedViewBinder >> = TODO ()
79+ val nested1: MyList <ListOfInt >
80+ val nested2: List <ListOfInt >
Original file line number Diff line number Diff line change @@ -78,8 +78,12 @@ open class TypeAliasProcessor : AbstractTestProcessor() {
7878 append(declaration.simpleName.asString())
7979 if (arguments.isNotEmpty()) {
8080 append(" <" )
81- arguments.map {
82- it.type?.resolve()?.toSignature() ? : " <error>"
81+ arguments.mapIndexed { i, arg ->
82+ val s = arg.type?.resolve()?.toSignature() ? : " <error>"
83+ if (i < arguments.size - 1 )
84+ s + " , "
85+ else
86+ s
8387 }.forEach(this ::append)
8488 append(" >" )
8589 }
Original file line number Diff line number Diff line change 3131// myList_b_String : MyList_B_String = MyList_B<String> = MyList<R> = List<T>
3232// myListOfAlias : MyListOfAlias = List<A>
3333// myListOfAliasInLib : MyListOfAliasInLib = List<@JvmSuppressWildcards AInLib>
34+ // viewBinderProviders : Map<Class<BaseViewHolder>, @JvmSuppressWildcards Provider<BaseEmbedViewBinder>>
35+ // nested1 : MyList<ListOfInt> = List<T>
36+ // nested2 : List<ListOfInt>
3437// END
3538
3639// MODULE: module1
@@ -66,3 +69,13 @@ val myList_b_String: MyList_B_String = TODO()
6669// FIXME: type annotation is missing
6770val myListOfAlias: MyListOfAlias = TODO ()
6871val myListOfAliasInLib: MyListOfAliasInLib = TODO ()
72+
73+ interface BaseViewHolder
74+ interface SpaceshipEmbedModel
75+ interface Provider <T >
76+ interface ViewBinder <T1 , T2 >
77+ typealias BaseEmbedViewBinder = ViewBinder <out BaseViewHolder , out SpaceshipEmbedModel >
78+
79+ val viewBinderProviders: Map <Class <out BaseViewHolder >, @JvmSuppressWildcards Provider <BaseEmbedViewBinder >> = TODO ()
80+ val nested1: MyList <ListOfInt >
81+ val nested2: List <ListOfInt >
You can’t perform that action at this time.
0 commit comments