Make infix modifier diagnostic message more informative (KT-12589)
(cherry picked from commit 2744309)
This commit is contained in:
@@ -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
@@ -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,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
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user