Make infix modifier diagnostic message more informative (KT-12589)

(cherry picked from commit 2744309)
This commit is contained in:
Yan Zhulanow
2016-06-10 22:45:57 +03:00
parent a434055b55
commit 6752df189d
20 changed files with 94 additions and 70 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
// ERROR: 'infix' modifier is inapplicable on this function
// ERROR: infix modifier is inapplicable on this function: must have a single value parameter
interface Foo {
infix fun foo(a: Int, b: Int)
}
+1 -1
View File
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
// ERROR: 'infix' modifier is inapplicable on this function
// ERROR: infix modifier is inapplicable on this function: must have a single value parameter
fun foo(x: Foo) {
x.<caret>foo(bar = x)
}
+1 -1
View File
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// ERROR: 'infix' modifier is inapplicable on this function
// ERROR: infix modifier is inapplicable on this function: must be a member of an extension function
infix fun id(s: String) = s
val x = <caret>id("0").get(0)
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
// ERROR: 'infix' modifier is inapplicable on this function
// ERROR: infix modifier is inapplicable on this function: must be a member of an extension function
package ppp
infix fun foo(p: String){}
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
// ERROR: 'infix' modifier is inapplicable on this function
// ERROR: infix modifier is inapplicable on this function: must have a single value parameter
class Foo {
infix fun foo(x: Int = 0, y: Int = 0) {
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
// ERROR: 'infix' modifier is inapplicable on this function
// ERROR: infix modifier is inapplicable on this function: must have a single value parameter
fun foo(x: Foo) {
x.<caret>foo(1) { it * 2 }
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
// ERROR: 'infix' modifier is inapplicable on this function
// ERROR: infix modifier is inapplicable on this function: must be a member of an extension function
package demo