Skip to content

Commit

Permalink
Use abbreviatedType explicitly
Browse files Browse the repository at this point in the history
now that AA expand types.
  • Loading branch information
ting-yuan committed Jun 25, 2024
1 parent 3f6b549 commit 82c69dc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,6 @@ class KotlinSymbolProcessing(
createPackagePartProvider,
)

// kotlinCoreProjectEnvironment.project.apply {
// registerService(
// KotlinPsiDeclarationProviderFactory::class.java,
// KotlinStaticPsiDeclarationProviderFactory(this)
// )
// }
//
project.registerService(
LLFirLibrarySymbolProviderFactory::class.java,
LLFirStandaloneLibrarySymbolProviderFactory::class.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ class KSTypeAliasImpl private constructor(private val ktTypeAliasSymbol: KtTypeA
}

override val type: KSTypeReference by lazy {
KSTypeReferenceResolvedImpl.getCached(ktTypeAliasSymbol.expandedType, this)
KSTypeReferenceResolvedImpl.getCached(
ktTypeAliasSymbol.expandedType.let { it.abbreviatedType ?: it },
this
)
}

override val simpleName: KSName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class KSTypeReferenceImpl(

// Remember to recordLookup if the usage is beyond a type reference.
private val ktType: KtType by lazy {
analyze { ktTypeReference.getKtType() }
analyze {
ktTypeReference.getKtType().let { it.abbreviatedType ?: it }
}
}
override val element: KSReferenceElement? by lazy {
var typeElement = ktTypeReference.typeElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ fun ClassId.toKSName() = KSNameImpl.getCached(asSingleFqName().toString())
// or kotlin functional type (in the case of Java functional type).
internal fun KtClassLikeSymbol.shouldMapToKotlinForAssignabilityCheck(): Boolean {
return this.origin == KtSymbolOrigin.JAVA_SOURCE ||
this.origin == KtSymbolOrigin.JAVA_LIBRARY ||
this.classIdIfNonLocal?.packageFqName?.asString() == "kotlin.jvm.functions"
}

Expand Down

0 comments on commit 82c69dc

Please sign in to comment.