Create From Usage: Place generated declarations next to original element container if they have common parent
#KT-6687 Fixed
This commit is contained in:
+3
-3
@@ -1,8 +1,8 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
val foo: String
|
||||
|
||||
fun test() {
|
||||
println("a = $foo")
|
||||
}
|
||||
|
||||
val foo: String
|
||||
}
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
val foo: Int
|
||||
|
||||
fun test(): Int {
|
||||
return foo
|
||||
}
|
||||
|
||||
val foo: Int
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
|
||||
package foo
|
||||
|
||||
val foo: Int
|
||||
|
||||
fun test(): Int {
|
||||
return foo
|
||||
}
|
||||
|
||||
val foo: Int
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Property must be initialized
|
||||
|
||||
val Unit.foo: Int
|
||||
|
||||
fun test() {
|
||||
val a: Int = Unit.foo
|
||||
}
|
||||
|
||||
val Unit.foo: Int
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
val Int.foo: A<Int>
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = 2.foo
|
||||
}
|
||||
|
||||
val Int.foo: A<Int>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
var Int.foo: A<String>
|
||||
|
||||
fun test() {
|
||||
2.foo = A("2")
|
||||
}
|
||||
|
||||
var Int.foo: A<String>
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
val A.foo: String?
|
||||
|
||||
fun test(): String? {
|
||||
return A().foo
|
||||
}
|
||||
|
||||
val A.foo: String?
|
||||
}
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
// "Create extension property 'foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
val A.foo: String?
|
||||
|
||||
fun test(): String? {
|
||||
return A().foo
|
||||
}
|
||||
|
||||
val A.foo: String?
|
||||
}
|
||||
Reference in New Issue
Block a user