Create from Usage: Make extension functions/properties 'private' by default
#KT-11799 Fixed
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
import package1.A
|
||||
|
||||
val package2.A.foo: Any
|
||||
private val package2.A.foo: Any<caret>
|
||||
|
||||
class X {
|
||||
init {
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create extension property 'A.foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
val A.foo: String?
|
||||
private val A.foo: String?<caret>
|
||||
|
||||
fun test(): String? {
|
||||
return A().foo
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create extension property 'A.foo'" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
val A.foo: String?
|
||||
private val A.foo: String?<caret>
|
||||
|
||||
fun test(): String? {
|
||||
return A().foo
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// ERROR: Property must be initialized
|
||||
fun consume(n: Int) {}
|
||||
|
||||
val <T> T.bar: Int
|
||||
private val <T> T.bar: Int
|
||||
|
||||
fun <T> foo(t: T) {
|
||||
consume(t.bar)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// ERROR: Property must be initialized
|
||||
// WITH_RUNTIME
|
||||
|
||||
val Unit.foo: Int
|
||||
private val Unit.foo: Int
|
||||
|
||||
fun test() {
|
||||
val a: Int = Unit.foo
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
val Int.foo: A<Int>
|
||||
private val Int.foo: A<Int>
|
||||
|
||||
fun test() {
|
||||
val a: A<Int> = 2.foo
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
class A<T>(val n: T)
|
||||
|
||||
var Int.foo: A<String>
|
||||
private var Int.foo: A<String>
|
||||
|
||||
fun test() {
|
||||
2.foo = A("2")
|
||||
|
||||
Reference in New Issue
Block a user