Deprecate extension annotation in favor of Extension
This commit is contained in:
@@ -6,8 +6,8 @@ fun foo(a: (String) -> Unit) {
|
||||
|
||||
interface A : (String) -> Unit {}
|
||||
|
||||
fun foo(a: @extension A) {
|
||||
// @extension annotation on an unrelated type shouldn't have any effect on this diagnostic.
|
||||
// Only kotlin.Function{n} type annotated with @extension should
|
||||
fun foo(a: @Extension A) {
|
||||
// @Extension annotation on an unrelated type shouldn't have any effect on this diagnostic.
|
||||
// Only kotlin.Function{n} type annotated with @Extension should
|
||||
"".<!FREE_FUNCTION_CALLED_AS_EXTENSION!>a<!>()
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package
|
||||
|
||||
internal fun foo(/*0*/ a: (kotlin.String) -> kotlin.Unit): kotlin.Unit
|
||||
internal fun foo(/*0*/ a: @[kotlin.extension()] A): kotlin.Unit
|
||||
internal fun foo(/*0*/ a: @[kotlin.Extension()] A): kotlin.Unit
|
||||
|
||||
internal interface A : (kotlin.String) -> kotlin.Unit {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
@@ -4,7 +4,7 @@ annotation class ann
|
||||
|
||||
interface Some {
|
||||
fun f1(): String.() -> Int
|
||||
fun f2(): @extension String.() -> Int
|
||||
fun f2(): @Extension String.() -> Int
|
||||
fun f3(): @ann String.() -> Int
|
||||
fun f4(): @extension @ann String.() -> Int
|
||||
fun f4(): @Extension @ann String.() -> Int
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ package
|
||||
internal interface Some {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal abstract fun f1(): kotlin.String.() -> kotlin.Int
|
||||
internal abstract fun f2(): @[kotlin.extension()] kotlin.String.() -> kotlin.Int
|
||||
internal abstract fun f2(): @[kotlin.Extension()] kotlin.String.() -> kotlin.Int
|
||||
internal abstract fun f3(): @[ann()] kotlin.String.() -> kotlin.Int
|
||||
internal abstract fun f4(): @[kotlin.extension() ann()] kotlin.String.() -> kotlin.Int
|
||||
internal abstract fun f4(): @[kotlin.Extension() ann()] kotlin.String.() -> kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ fun <T, U, V> Function2<T, U, V>.get(index : Int) {
|
||||
|
||||
}
|
||||
|
||||
fun <T, U, V, W> @extension Function3<T, U, V, W>.get(index : Int) {
|
||||
fun <T, U, V, W> @Extension Function3<T, U, V, W>.get(index : Int) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ inline fun <T, U> Function1<T, U>.plusAssign(p: Function1<T, U>) {
|
||||
<!USAGE_IS_NOT_INLINABLE!>p<!> -= <!USAGE_IS_NOT_INLINABLE!>this<!>
|
||||
}
|
||||
|
||||
fun <T, U, V> @extension Function2<T, U, V>.minusAssign(ext : @extension Function2<T, U, V>) {}
|
||||
fun <T, U, V> @Extension Function2<T, U, V>.minusAssign(ext : @Extension Function2<T, U, V>) {}
|
||||
|
||||
inline fun <T, U, V> @extension Function2<T, U, V>.modAssign(ext : @extension Function2<T, U, V>) = {
|
||||
inline fun <T, U, V> @Extension Function2<T, U, V>.modAssign(ext : @Extension Function2<T, U, V>) = {
|
||||
this += ext
|
||||
ext += this
|
||||
}
|
||||
|
||||
inline fun <T, U, V> @extension Function2<T, U, V>.plusAssign(ext : @extension Function2<T, U, V>) {
|
||||
inline fun <T, U, V> @Extension Function2<T, U, V>.plusAssign(ext : @Extension Function2<T, U, V>) {
|
||||
<!USAGE_IS_NOT_INLINABLE!>this<!> -= <!USAGE_IS_NOT_INLINABLE!>ext<!>
|
||||
<!USAGE_IS_NOT_INLINABLE!>ext<!> -= <!USAGE_IS_NOT_INLINABLE!>this<!>
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ inline fun <T, U, V> inlineFunWithInvoke(s: (p: T) -> U) {
|
||||
|
||||
//noinline
|
||||
fun <T, U, V> Function2<T, U, V>.compareTo(index : Function2<T, U, V>) = 1
|
||||
fun <T, U, V, W> @extension Function3<T, U, V, W>.compareTo(index : @extension Function3<T, U, V, W>) = 1
|
||||
fun <T, U, V, W> @Extension Function3<T, U, V, W>.compareTo(index : @Extension Function3<T, U, V, W>) = 1
|
||||
|
||||
inline fun <T, U, V, W> inlineFunWithInvoke(s: (p: T, l: U) -> V, ext: T.(p: U, l: V) -> W) {
|
||||
<!USAGE_IS_NOT_INLINABLE!>s<!> < <!USAGE_IS_NOT_INLINABLE!>s<!>
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ inline fun <T, U, V> inlineFunWithInvoke(s: (p: T) -> U) {
|
||||
fun <T, U, V> Function2<T, U, V>.component1() = 1
|
||||
fun <T, U, V> Function2<T, U, V>.component2() = 2
|
||||
|
||||
fun <T, U, V, W> @extension Function3<T, U, V, W>.component1() = 1
|
||||
fun <T, U, V, W> @extension Function3<T, U, V, W>.component2() = 2
|
||||
fun <T, U, V, W> @Extension Function3<T, U, V, W>.component1() = 1
|
||||
fun <T, U, V, W> @Extension Function3<T, U, V, W>.component2() = 2
|
||||
|
||||
inline fun <T, U, V, W> inlineFunWithInvoke(s: (p: T, l: U) -> V, ext: T.(p: U, l: V) -> W) {
|
||||
val (d1, e1) = <!USAGE_IS_NOT_INLINABLE, USAGE_IS_NOT_INLINABLE!>s<!>
|
||||
|
||||
@@ -13,7 +13,7 @@ inline fun <T, U, V> inlineFunWithInvoke(s: (p: T) -> U) {
|
||||
|
||||
fun <T, U, V> Function2<T, U, V>.contains(p: Function2<T, U, V>): Boolean = false
|
||||
|
||||
fun <T, U, V, W> @extension Function3<T, U, V, W>.contains(ext: @extension Function3<T, U, V, W>): Boolean = false
|
||||
fun <T, U, V, W> @Extension Function3<T, U, V, W>.contains(ext: @Extension Function3<T, U, V, W>): Boolean = false
|
||||
|
||||
inline fun <T, U, V> inlineFunWithInvoke(s: (p: T, l: U) -> U, ext: T.(p: U, l: U) -> V) {
|
||||
<!USAGE_IS_NOT_INLINABLE!>s<!> in <!USAGE_IS_NOT_INLINABLE!>s<!>
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@ fun <T, U> Function1<T, U>.minus(p: Function1<T, U>) {
|
||||
|
||||
}
|
||||
|
||||
fun <T, U, V> @extension Function2<T, U, V>.minus(p: T.(p: U) -> V) {
|
||||
fun <T, U, V> @Extension Function2<T, U, V>.minus(p: T.(p: U) -> V) {
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ inline fun <T, U> Function1<T, U>.plus(p: Function1<T, U>) {
|
||||
<!USAGE_IS_NOT_INLINABLE!>this<!> - <!USAGE_IS_NOT_INLINABLE!>p<!>
|
||||
}
|
||||
|
||||
inline fun <T, U, V> @extension Function2<T, U, V>.plus(p: T.(p: U) -> V) {
|
||||
inline fun <T, U, V> @Extension Function2<T, U, V>.plus(p: T.(p: U) -> V) {
|
||||
<!USAGE_IS_NOT_INLINABLE!>this<!> - <!USAGE_IS_NOT_INLINABLE!>p<!>
|
||||
}
|
||||
|
||||
@@ -29,6 +29,6 @@ inline fun <T, U> Function1<T, U>.submit() {
|
||||
this + this
|
||||
}
|
||||
|
||||
inline fun <T, U, V> @extension Function2<T, U, V>.submit() {
|
||||
inline fun <T, U, V> @Extension Function2<T, U, V>.submit() {
|
||||
this + this
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ fun <T, U, V> Function2<T, U, V>.rangeTo(p: Function2<T, U, V>): Range<Int> {
|
||||
return 1..2
|
||||
}
|
||||
|
||||
fun <T, U, V, W> @extension Function3<T, U, V, W>.rangeTo(ext: @extension Function3<T, U, V, W>): Range<Int> {
|
||||
fun <T, U, V, W> @Extension Function3<T, U, V, W>.rangeTo(ext: @Extension Function3<T, U, V, W>): Range<Int> {
|
||||
return 1..2
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -5,10 +5,10 @@ fun <T, V> Function1<T, V>.minus() = this
|
||||
inline fun <T, V> Function1<T, V>.inc() = <!USAGE_IS_NOT_INLINABLE!>this<!>
|
||||
fun <T, V> Function1<T, V>.dec() = this
|
||||
|
||||
inline fun <T, V> @extension Function2<T, T, V>.plus(){}
|
||||
fun <T, V> @extension Function2<T, T, V>.minus(){}
|
||||
inline fun <T, V> @extension Function2<T, T, V>.inc() = <!USAGE_IS_NOT_INLINABLE!>this<!>
|
||||
fun <T, V> @extension Function2<T, T, V>.dec() = this
|
||||
inline fun <T, V> @Extension Function2<T, T, V>.plus(){}
|
||||
fun <T, V> @Extension Function2<T, T, V>.minus(){}
|
||||
inline fun <T, V> @Extension Function2<T, T, V>.inc() = <!USAGE_IS_NOT_INLINABLE!>this<!>
|
||||
fun <T, V> @Extension Function2<T, T, V>.dec() = this
|
||||
|
||||
inline fun <T, V> inlineFunWithInvoke(s: (p: T) -> V, ext: T.(p: T) -> V) {
|
||||
+s
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ fun <T, U, V> Function2<T, U, V>.not() : Boolean {
|
||||
return !this
|
||||
}
|
||||
|
||||
fun <T, U, V, W> @extension Function3<T, U, V, W>.not() : Boolean {
|
||||
fun <T, U, V, W> @Extension Function3<T, U, V, W>.not() : Boolean {
|
||||
return !this
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user