code style inspection: to -> Pair function used not in infix form

This commit is contained in:
kenji tomita
2017-12-12 21:38:17 +09:00
committed by Dmitry Jemerov
parent 41739602bc
commit 37351c344f
8 changed files with 130 additions and 2 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.inspections.ReplaceToWithInfixFormInspection
@@ -0,0 +1,7 @@
// WITH_RUNTIME
class A
class B
fun foo(a: A, b: B) {
val pair = a.<caret>to(b)
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
class A
class B
fun foo(a: A, b: B) {
val pair = a to b
}
@@ -0,0 +1,9 @@
// PROBLEM: none
class A {
fun to(x: Int) {
}
}
fun foo() {
A().<caret>to(1)
}