Quickfix for "Expression cannot be invoked as a function" with no arguments to remove parentheses

#KT-10825 Fixed
This commit is contained in:
Dmitry Jemerov
2016-01-27 19:15:21 +01:00
parent 6d7e1c69dc
commit 7c59592212
8 changed files with 101 additions and 0 deletions
@@ -0,0 +1,5 @@
// "Change to property access" "true"
fun x() {
val y = (1+2<caret>)()
}
@@ -0,0 +1,5 @@
// "Change to property access" "true"
fun x() {
val y = (1+2)
}
@@ -0,0 +1,6 @@
// "Change to property access" "true"
class A(val ff: String)
fun x() {
val y = A("").f<caret>f()
}
@@ -0,0 +1,6 @@
// "Change to property access" "true"
class A(val ff: String)
fun x() {
val y = A("").ff
}
@@ -0,0 +1,7 @@
// "Change to property access" "false"
// ERROR: Expression 'fd' of type 'kotlin.String' cannot be invoked as a function. The function invoke() is not found
class A(val fd: String)
fun x() {
val y = A("").f<caret>d("")
}