Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include type arguments in reference elements's referencedName/toString #1737

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -47,7 +47,14 @@ class KSClassifierReferenceImpl private constructor(val ktUserType: KtUserType)
}

override fun referencedName(): String {
return ktUserType.referencedName ?: ""
val typeArgs = typeArguments
return if (typeArgs.isEmpty()) {
ktUserType.referencedName ?: ""
} else {
ktUserType.referencedName + typeArgs.joinToString(prefix = "<", postfix = ">") {
it.type?.toString() ?: "*"
}
}
}

override val qualifier: KSClassifierReference? by lazy {
Expand Down
2 changes: 1 addition & 1 deletion test-utils/testData/api/referenceElement.kt
Expand Up @@ -19,7 +19,7 @@
// TEST PROCESSOR: ReferenceElementProcessor
// EXPECTED:
// KSClassifierReferenceImpl: Qualifier of B is A
// KSClassifierReferenceImpl: Qualifier of C is A
// KSClassifierReferenceImpl: Qualifier of C<Int> is A<String>
// KSClassifierReferenceImpl: Qualifier of Int is null
// KSClassifierReferenceImpl: Qualifier of String is null
// KSClassifierReferenceDescriptorImpl: Qualifier of Int is null
Expand Down