Add quickfix for @receiver applied to extension member instead of type

So #KT-14648 Fixed
This commit is contained in:
Kirill Rakhman
2017-05-29 21:17:14 +03:00
committed by Mikhail Glukhikh
parent b206f6288d
commit 08bd212d82
9 changed files with 139 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
// "Move annotation to receiver type" "true"
annotation class Ann
@receiver:Ann<caret>
fun String.foo() {
}
@@ -0,0 +1,6 @@
// "Move annotation to receiver type" "true"
annotation class Ann
<caret>fun @receiver:Ann String.foo() {
}
@@ -0,0 +1,11 @@
// "Move annotation to receiver type" "false"
// ERROR: '@receiver:' annotations could be applied only to extension function or extension property declarations
// ACTION: Convert to expression body
// ACTION: Make internal
// ACTION: Make private
annotation class Ann
@receiver:Ann<caret>
fun foo() {
}
@@ -0,0 +1,10 @@
// "Move annotation to receiver type" "false"
// ERROR: '@receiver:' annotations could be applied only to extension function or extension property declarations
// ACTION: Make internal
// ACTION: Make private
// ACTION: Specify type explicitly
annotation class Ann
@receiver:Ann<caret>
val bar get() = ""
+6
View File
@@ -0,0 +1,6 @@
// "Move annotation to receiver type" "true"
annotation class Ann
@receiver:Ann<caret>
val String.bar get() = ""
@@ -0,0 +1,5 @@
// "Move annotation to receiver type" "true"
annotation class Ann
<caret>val @receiver:Ann String.bar get() = ""