Create from Usage: Make extension functions/properties 'private' by default
#KT-11799 Fixed
This commit is contained in:
+1
-1
@@ -7,6 +7,6 @@ fun main(args: Array<String>) {
|
||||
list.foo { object : A() {} }
|
||||
}
|
||||
|
||||
fun <E> List<E>.foo(function: () -> A) {
|
||||
private fun <E> List<E>.foo(function: () -> A) {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -9,6 +9,6 @@ fun main(args: Array<String>) {
|
||||
list.foo { Local() }
|
||||
}
|
||||
|
||||
fun <E> List<E>.foo(function: () -> A) {
|
||||
private fun <E> List<E>.foo(function: () -> A) {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,6 +9,6 @@ fun A.test() {
|
||||
bar(foo(n))
|
||||
}
|
||||
|
||||
fun A.foo(n: Int): Boolean {
|
||||
private fun A.foo(n: Int): Boolean {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,6 +12,6 @@ fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
fun A.foo(n: Int): Boolean {
|
||||
private fun A.foo(n: Int): Boolean {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// ERROR: Property must be initialized
|
||||
class A(val n: Int)
|
||||
|
||||
val A.foo: Boolean<caret>
|
||||
private val A.foo: Boolean
|
||||
|
||||
class B {
|
||||
val A.test: Boolean get() = foo
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// ERROR: Property must be initialized
|
||||
class A(val n: Int)
|
||||
|
||||
var A.foo: Boolean<caret>
|
||||
private var A.foo: Boolean
|
||||
|
||||
class B {
|
||||
var A.test: Boolean
|
||||
|
||||
Vendored
+1
-1
@@ -5,6 +5,6 @@ fun test(): Int {
|
||||
return A().foo()
|
||||
}
|
||||
|
||||
fun A.foo(): Int {
|
||||
private fun A.foo(): Int {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@ fun test(): Int? {
|
||||
return A().foo(1, "2")
|
||||
}
|
||||
|
||||
fun A.foo(i: Int, s: String): Int? {
|
||||
private fun A.foo(i: Int, s: String): Int? {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,6 +6,6 @@ fun test(t: T) {
|
||||
val b: Boolean = t.foo("1", 2)
|
||||
}
|
||||
|
||||
fun T.foo(s: String, i: Int): Boolean {
|
||||
private fun T.foo(s: String, i: Int): Boolean {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,6 +10,6 @@ class X {
|
||||
}
|
||||
}
|
||||
|
||||
fun package2.A.foo() {
|
||||
private fun package2.A.foo() {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@ fun test() {
|
||||
val a: Int = Unit.foo(2)
|
||||
}
|
||||
|
||||
fun Unit.foo(i: Int): Int {
|
||||
private fun Unit.foo(i: Int): Int {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@ fun test() {
|
||||
val a: A<Int> = 2.foo(A(1))
|
||||
}
|
||||
|
||||
fun Int.foo(a: A<Int>): A<Int> {
|
||||
private fun Int.foo(a: A<Int>): A<Int> {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -4,6 +4,6 @@ fun foo(block: (Int) -> String) {
|
||||
block.bar()
|
||||
}
|
||||
|
||||
fun <P1, R> ((P1) -> R).bar() {
|
||||
private fun <P1, R> ((P1) -> R).bar() {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -7,6 +7,6 @@ class A<T>(val items: List<T>) {
|
||||
}
|
||||
}
|
||||
|
||||
fun <E, T, U> List<E>.foo(t: T, u: U): T {
|
||||
private fun <E, T, U> List<E>.foo(t: T, u: U): T {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@ class A<T>(val items: List<T>) {
|
||||
}
|
||||
}
|
||||
|
||||
fun <E, T> List<E>.foo(t: T, s: String): T {
|
||||
private fun <E, T> List<E>.foo(t: T, s: String): T {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@ class A<T>(val items: List<T>) {
|
||||
}
|
||||
}
|
||||
|
||||
fun <E, T, U> List<E>.foo(t: T, u: U): T {
|
||||
private fun <E, T, U> List<E>.foo(t: T, u: U): T {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@ fun <T> foo(t: T) {
|
||||
t.bar()
|
||||
}
|
||||
|
||||
fun <T> T.bar() {
|
||||
private fun <T> T.bar() {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user