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

[Analysis API] Handle ConeFlexibleType when parsing to KaAnnotationValue #5341

Open
wants to merge 1 commit into
base: master
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ internal object FirAnnotationValueConverter {
}

is FirGetClassCall -> {
val coneType = getTargetType()?.fullyExpandedType(session)
val coneType = getTargetType()?.fullyExpandedType(session)?.lowerBoundIfFlexible()

if (coneType is ConeClassLikeType && coneType !is ConeErrorType) {
val classId = coneType.lookupTag.classId
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
KaNamedClassSymbol:
annotations: []
classId: JavaClass
classKind: CLASS
companionObject: null
compilerVisibility: Unknown
contextReceivers: []
isActual: false
isData: false
isExpect: false
isExternal: false
isFun: false
isInline: false
isInner: false
location: TOP_LEVEL
modality: OPEN
name: JavaClass
origin: JAVA_SOURCE
superTypes: [
KaUsualClassType:
annotations: []
typeArguments: []
type: kotlin/Any
]
typeParameters: []
visibility: UNKNOWN
getContainingFileSymbol: null
getContainingModule: KaSourceModule "Sources of main"
annotationApplicableTargets: null
deprecationStatus: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// MODULE: main
// FILE: JavaClass.java
import java.lang.annotation.*;

@Target(ElementType.TYPE_USE)
@interface MyAnnotation {
Class<?> typeParam();
}
class JavaClass extends @MyAnnotation(typeParam = String.class) Object {}

// FILE: main.kt
fun test() {
val x: J<caret>avaClass = TODO()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open class JavaClass
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
KaNamedClassSymbol:
annotations: []
classId: JavaClass
classKind: CLASS
companionObject: null
compilerVisibility: PackageVisibility
contextReceivers: []
isActual: false
isData: false
isExpect: false
isExternal: false
isFun: false
isInline: false
isInner: false
location: TOP_LEVEL
modality: OPEN
name: JavaClass
origin: JAVA_SOURCE
superTypes: [
KaUsualClassType:
annotations: [
MyAnnotation(typeParam = kotlin.String::class)
psi: null
]
typeArguments: []
type: @R|MyAnnotation|(typeParam = <getClass>(<getClass>(R|kotlin/String!|))) kotlin/Any
]
typeParameters: []
visibility: PACKAGE_PRIVATE
getContainingFileSymbol: null
getContainingModule: KaSourceModule "Sources of main"
annotationApplicableTargets: null
deprecationStatus: null