Create from usage: make new member function/property private by default
#KT-6689 Fixed
This commit is contained in:
+1
-1
@@ -5,6 +5,6 @@
|
||||
import kotlin.properties.ReadOnlyProperty
|
||||
|
||||
class A<T> {
|
||||
val foo: ReadOnlyProperty<A<T>, A<Int>>
|
||||
private val foo: ReadOnlyProperty<A<T>, A<Int>>
|
||||
val x: A<Int> by foo
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
class A {
|
||||
class B {
|
||||
val foo: Int
|
||||
private val foo: Int
|
||||
|
||||
fun test(): Int {
|
||||
return foo
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@
|
||||
import kotlin.properties.ReadWriteProperty
|
||||
|
||||
class A<T> {
|
||||
val foo: ReadWriteProperty<A<T>, A<Int>>
|
||||
private val foo: ReadWriteProperty<A<T>, A<Int>>
|
||||
var x: A<Int> by foo
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
class A {
|
||||
object B {
|
||||
val foo: Int
|
||||
private val foo: Int
|
||||
|
||||
fun test(): Int {
|
||||
return foo
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
class A {
|
||||
private var foo: Int
|
||||
|
||||
fun test() {
|
||||
foo = 1
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
|
||||
class A<T>(val n: T) {
|
||||
val foo: A<Int>
|
||||
private val foo: A<Int>
|
||||
|
||||
fun test(): A<Int> {
|
||||
return this.foo
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
class A<T>(val n: T) {
|
||||
inner class B<U>(val m: U) {
|
||||
val foo: A<Int>
|
||||
private val foo: A<Int>
|
||||
|
||||
fun test(): A<Int> {
|
||||
return this.foo
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
|
||||
class A<T>(val n: T) {
|
||||
val foo: A<Int>
|
||||
private val foo: A<Int>
|
||||
|
||||
inner class B<U>(val m: U) {
|
||||
fun test(): A<Int> {
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create property 'foo'" "true"
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
class A {
|
||||
fun test() {
|
||||
<caret>foo = 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user