FIR/Analysis API: Get parameter name from function type notation or
`@ParameterName` annotation, which is also now added during type resolution.
This commit is contained in:
committed by
Dmitriy Novozhilov
parent
afb68d15d6
commit
167dc81d3b
@@ -183,6 +183,11 @@ sealed class FirFakeSourceElementKind : FirSourceElementKind() {
|
||||
|
||||
// for annotation moved to another element due to annotation use-site target
|
||||
object FromUseSiteTarget : FirFakeSourceElementKind()
|
||||
|
||||
// for `@ParameterName` annotation call added to function types with names in the notation
|
||||
// with a fake source that refers to the value parameter in the function type notation
|
||||
// e.g., `(x: Int) -> Unit` becomes `Function1<@ParameterName("x") Int, Unit>`
|
||||
object ParameterNameAnnotationCall : FirFakeSourceElementKind()
|
||||
}
|
||||
|
||||
sealed class FirSourceElement {
|
||||
|
||||
+1
-1
@@ -27,6 +27,6 @@ class CustomAnnotationTypeAttribute(val annotations: List<FirAnnotation>) : Cone
|
||||
get() = CustomAnnotationTypeAttribute::class
|
||||
}
|
||||
|
||||
private val ConeAttributes.custom: CustomAnnotationTypeAttribute? by ConeAttributes.attributeAccessor<CustomAnnotationTypeAttribute>()
|
||||
val ConeAttributes.custom: CustomAnnotationTypeAttribute? by ConeAttributes.attributeAccessor<CustomAnnotationTypeAttribute>()
|
||||
|
||||
val ConeAttributes.customAnnotations: List<FirAnnotation> get() = custom?.annotations.orEmpty()
|
||||
|
||||
Reference in New Issue
Block a user