Create from Usage: Make extension functions/properties 'private' by default

#KT-11799 Fixed
This commit is contained in:
Alexey Sedunov
2016-08-17 14:19:04 +03:00
parent 92b0c852dd
commit 99ba340236
35 changed files with 37 additions and 35 deletions
@@ -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.
}
@@ -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.
}
@@ -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.
}
@@ -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.
}
@@ -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
@@ -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
@@ -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.
}
@@ -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.
}
@@ -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.
}
@@ -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.
}
@@ -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.
}
@@ -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.
}
@@ -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.
}
@@ -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.
}
@@ -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.
}
@@ -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.
}
@@ -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.
}