mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 00:21:35 +00:00
#KT-21696 Fixed The problem is coming from the fact that `AnnotationTarget.VALUE_PARAMETER` is mapped to receiver parameter and to value parameter, but annotation with use-site target `receiver` can be used only on type reference of receiver parameter
8 lines
385 B
Kotlin
Vendored
8 lines
385 B
Kotlin
Vendored
@Target(AnnotationTarget.VALUE_PARAMETER)
|
|
annotation class Fancy
|
|
|
|
fun @receiver:Fancy String.myExtension() { }
|
|
val @receiver:Fancy Int.asVal get() = 0
|
|
|
|
fun ((<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET_ON_TYPE!>@receiver:Fancy<!> Int) -> Unit).complexReceiver1() {}
|
|
fun ((Int) -> <!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET_ON_TYPE!>@receiver:Fancy<!> Unit).complexReceiver2() {} |