ConvertToAnonymousObjectFix: do not suggest when there is no lambda
#KT-31912 Fixed
This commit is contained in:
committed by
Roman Golyshev
parent
d3c54f664b
commit
09304bbd54
@@ -0,0 +1,8 @@
|
||||
// "Convert to anonymous object" "true"
|
||||
interface I {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val i = <caret>I({ "" })
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Convert to anonymous object" "true"
|
||||
interface I {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val i = object : I {
|
||||
override fun foo(): String {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Convert to anonymous object" "false"
|
||||
// ACTION: Introduce import alias
|
||||
// ACTION: Split property declaration
|
||||
// ERROR: Interface I does not have constructors
|
||||
interface I {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val i = <caret>I()
|
||||
}
|
||||
Reference in New Issue
Block a user