Check presence of dispatch receiver parameter in modifier checks

Also fix typo in "inapplicable infix" diagnostic message
This commit is contained in:
Alexander Udalov
2016-07-21 15:00:31 +03:00
parent 2a390155a9
commit 9be219b69c
8 changed files with 16 additions and 23 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// ERROR: 'infix' modifier is inapplicable on this function: must be a member of an extension function
// ERROR: 'infix' modifier is inapplicable on this function: must be a member or an extension function
infix fun id(s: String) = s
val x = <caret>id("0").get(0)
val x = <caret>id("0").get(0)
@@ -1,9 +1,9 @@
// IS_APPLICABLE: false
// ERROR: 'infix' modifier is inapplicable on this function: must be a member of an extension function
// ERROR: 'infix' modifier is inapplicable on this function: must be a member or an extension function
package ppp
infix fun foo(p: String){}
fun main() {
ppp.<caret>foo("")
}
}
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
// ERROR: 'infix' modifier is inapplicable on this function: must be a member of an extension function
// ERROR: 'infix' modifier is inapplicable on this function: must be a member or an extension function
package demo
@@ -8,4 +8,4 @@ infix fun foo(str: String) = kotlin.io.println(str)
fun main() {
<caret>demo.foo("")
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
// "Replace with 'newFun(p, this)'" "true"
// ERROR: 'infix' modifier is inapplicable on this function: must be a member of an extension function
// ERROR: 'infix' modifier is inapplicable on this function: must be a member or an extension function
@Deprecated("", ReplaceWith("newFun(p, this)"))
infix fun String.oldFun(p: Int) {
@@ -1,5 +1,5 @@
// "Replace with 'newFun(p, this)'" "true"
// ERROR: 'infix' modifier is inapplicable on this function: must be a member of an extension function
// ERROR: 'infix' modifier is inapplicable on this function: must be a member or an extension function
@Deprecated("", ReplaceWith("newFun(p, this)"))
infix fun String.oldFun(p: Int) {