Skip to content

Commit

Permalink
KSP: Resolved type arguments shouldn't be marked as a type variable (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dstepanov authored Dec 4, 2023
1 parent 05422bf commit 447f723
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal class KotlinTypeArgumentElement(
resolved.resolvedTypeArguments,
visitorContext,
internalArrayDimensions,
true
false
), GenericElement {

private val resolvedTypeAnnotationMetadata: ElementAnnotationMetadata by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1116,13 +1116,13 @@ interface Deserializer<T> {
def deserializerTypeParam = definition.getTypeArguments("test.Deserializer")[0]

then: "The first is a placeholder"
serdeTypeParam.isTypeVariable() //
(serdeTypeParam instanceof GenericPlaceholder)
!serdeTypeParam.isTypeVariable()
!(serdeTypeParam instanceof GenericPlaceholder)
and: "threat resolved placeholder as not a type variable"
serializerTypeParam.isTypeVariable()
(serializerTypeParam instanceof GenericPlaceholder)
deserializerTypeParam.isTypeVariable()
(deserializerTypeParam instanceof GenericPlaceholder)
!serializerTypeParam.isTypeVariable()
!(serializerTypeParam instanceof GenericPlaceholder)
!deserializerTypeParam.isTypeVariable()
!(deserializerTypeParam instanceof GenericPlaceholder)
}

void "test isTypeVariable array"() {
Expand Down Expand Up @@ -1156,15 +1156,15 @@ interface Deserializer<T> {
// Arrays are not resolved as KotlinClassElements or placeholders
then: "The first is a placeholder"
serdeTypeParam.simpleName == "String[]"
serdeTypeParam.isTypeVariable()
(serdeTypeParam instanceof GenericPlaceholder)
!serdeTypeParam.isTypeVariable()
!(serdeTypeParam instanceof GenericPlaceholder)
and: "threat resolved placeholder as not a type variable"
serializerTypeParam.simpleName == "String[]"
serializerTypeParam.isTypeVariable()
(serializerTypeParam instanceof GenericPlaceholder)
!serializerTypeParam.isTypeVariable()
!(serializerTypeParam instanceof GenericPlaceholder)
deserializerTypeParam.simpleName == "String[]"
deserializerTypeParam.isTypeVariable()
(deserializerTypeParam instanceof GenericPlaceholder)
!deserializerTypeParam.isTypeVariable()
!(deserializerTypeParam instanceof GenericPlaceholder)
}

void "test inline class return type"() {
Expand Down

0 comments on commit 447f723

Please sign in to comment.