Revert "Rename Extension annotation to ExtensionFunctionType"
This reverts commit 460dad135c.
The old compiler will not see the new runtime correctly. Postponing this until
1.0
This commit is contained in:
+2
-4
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.idea.decompiler.stubBuilder
|
||||
import com.google.protobuf.MessageLite
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.stubs.StubElement
|
||||
import com.intellij.util.SmartList
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.lexer.KtModifierKeywordToken
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
@@ -80,10 +81,7 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) {
|
||||
val shouldBuildAsFunctionType = KotlinBuiltIns.isNumberedFunctionClassFqName(classId.asSingleFqName().toUnsafe())
|
||||
&& type.getArgumentList().none { it.getProjection() == Projection.STAR }
|
||||
if (shouldBuildAsFunctionType) {
|
||||
val extension = annotations.any { annotation ->
|
||||
val fqName = annotation.asSingleFqName()
|
||||
fqName == KotlinBuiltIns.FQ_NAMES.extensionFunctionType || fqName == KotlinBuiltIns.FQ_NAMES.deprecatedExtensionAnnotation
|
||||
}
|
||||
val extension = annotations.any { annotation -> annotation.asSingleFqName() == KotlinBuiltIns.FQ_NAMES.extension }
|
||||
createFunctionTypeStub(parent, type, extension)
|
||||
return
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
package somePackage
|
||||
|
||||
class ExcludedClass
|
||||
// Such strange name here needed to make completion prefix not intersecting with kotlin.ExtensionFunctionType
|
||||
class ExctraClass
|
||||
// Such strange name here needed to make completion prefix not intersecting with kotlin.Extension
|
||||
class ExctraClass
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
package somePackage;
|
||||
|
||||
// Such strange name here needed to make completion prefix not intersecting with kotlin.ExtensionFunctionType
|
||||
// Such strange name here needed to make completion prefix not intersecting with kotlin.Extension
|
||||
public class ExctraClass {
|
||||
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -6,7 +6,7 @@ fun (() -> Unit)?.helloFun1() {
|
||||
fun Function0<Unit>.helloFun2() {
|
||||
}
|
||||
|
||||
fun @ExtensionFunctionType Function1<String, Unit>.helloFun3() {
|
||||
fun @Extension Function1<String, Unit>.helloFun3() {
|
||||
}
|
||||
|
||||
fun Function1<String, Unit>.helloFun4() {
|
||||
|
||||
+2
-2
@@ -6,10 +6,10 @@ fun (String.() -> Unit)?.helloFun1() {
|
||||
fun Function0<Unit>.helloFun2() {
|
||||
}
|
||||
|
||||
fun @ExtensionFunctionType Function1<String, Unit>.helloFun3() {
|
||||
fun @Extension Function1<String, Unit>.helloFun3() {
|
||||
}
|
||||
|
||||
fun @ExtensionFunctionType Function1<Int, Unit>.helloFun4() {
|
||||
fun @Extension Function1<Int, Unit>.helloFun4() {
|
||||
}
|
||||
|
||||
fun Function1<String, Unit>.helloFun5() {
|
||||
|
||||
@@ -10,7 +10,7 @@ public final class FunctionTypes public constructor() {
|
||||
|
||||
public final fun f3(f: kotlin.Int.(kotlin.Int) -> kotlin.Unit): kotlin.Unit { /* compiled code */ }
|
||||
|
||||
public final fun f4(f: kotlin.List<@kotlin.ExtensionFunctionType kotlin.Function1<*, *>>): kotlin.Unit { /* compiled code */ }
|
||||
public final fun f4(f: kotlin.List<@kotlin.Extension kotlin.Function1<*, *>>): kotlin.Unit { /* compiled code */ }
|
||||
|
||||
public final fun <A> (A.(A) -> A)?.bar(): kotlin.Unit { /* compiled code */ }
|
||||
|
||||
@@ -19,4 +19,4 @@ public final class FunctionTypes public constructor() {
|
||||
public final fun <IP, R, P1> ((IP) -> R).compose2(f: (P1) -> IP): (P1) -> R { /* compiled code */ }
|
||||
|
||||
public final fun <A> (A.(A) -> A).foo(): kotlin.Unit { /* compiled code */ }
|
||||
}
|
||||
}
|
||||
@@ -21,9 +21,9 @@ class FunctionTypes {
|
||||
public fun f2(f: Function2<Int, *, String>) {
|
||||
}
|
||||
|
||||
public fun f3(f: @ExtensionFunctionType Function2<Int, Int, Unit>) {
|
||||
public fun f3(f: @Extension Function2<Int, Int, Unit>) {
|
||||
}
|
||||
|
||||
public fun f4(f: List<@ExtensionFunctionType Function1<*, *>>) {
|
||||
public fun f4(f: List<@Extension Function1<*, *>>) {
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ abstract class Types {
|
||||
|
||||
abstract val starList: List<*>
|
||||
abstract val starFun: Function1<*, *>
|
||||
abstract val extFun: @ExtensionFunctionType Function2<Int, Int, Unit>
|
||||
abstract val listExtStarFun: List<@ExtensionFunctionType Function1<*, *>>
|
||||
abstract val extFun: @Extension Function2<Int, Int, Unit>
|
||||
abstract val listExtStarFun: List<@Extension Function1<*, *>>
|
||||
abstract val funTypeWithStarAndNonStar: Function1<*, Int>
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -252,13 +252,13 @@ PsiJetFileStubImpl[package=test]
|
||||
TYPE_ARGUMENT_LIST:
|
||||
TYPE_PROJECTION:[projectionKind=NONE]
|
||||
TYPE_REFERENCE:
|
||||
ANNOTATION_ENTRY:[hasValueArguments=false, shortName=ExtensionFunctionType]
|
||||
ANNOTATION_ENTRY:[hasValueArguments=false, shortName=Extension]
|
||||
CONSTRUCTOR_CALLEE:
|
||||
TYPE_REFERENCE:
|
||||
USER_TYPE:[isAbsoluteInRootPackage=false]
|
||||
USER_TYPE:[isAbsoluteInRootPackage=false]
|
||||
REFERENCE_EXPRESSION:[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION:[referencedName=ExtensionFunctionType]
|
||||
REFERENCE_EXPRESSION:[referencedName=Extension]
|
||||
USER_TYPE:[isAbsoluteInRootPackage=false]
|
||||
USER_TYPE:[isAbsoluteInRootPackage=false]
|
||||
REFERENCE_EXPRESSION:[referencedName=kotlin]
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ val c: <selection>() -> String</selection> = { "" }
|
||||
val d: () -> kotlin.String = { "" }
|
||||
val e: () -> Unit = { }
|
||||
val f: Any.() -> String = { "" }
|
||||
val g: @ExtensionFunctionType Function1<String, String> = { "" }
|
||||
val g: @Extension Function1<String, String> = { "" }
|
||||
|
||||
+2
-2
@@ -5,6 +5,6 @@ val d: (n: Int) -> kotlin.String = { "" }
|
||||
val e: (String) -> Int = { 0 }
|
||||
val f: () -> Int = { 0 }
|
||||
val g: Int.() -> String = { "" }
|
||||
val h: @ExtensionFunctionType Function2<Int, Int, String> = { "" }
|
||||
val h: @Extension Function2<Int, Int, String> = { "" }
|
||||
val i: (m: Int) -> kotlin.String = { "" }
|
||||
val j: @ExtensionFunctionType Function1<Int, String> = { "" }
|
||||
val j: @Extension Function1<Int, String> = { "" }
|
||||
|
||||
@@ -10,4 +10,4 @@ Int.() -> String
|
||||
|
||||
(m: Int) -> kotlin.String
|
||||
|
||||
@ExtensionFunctionType Function1<Int, String>
|
||||
@Extension Function1<Int, String>
|
||||
|
||||
+2
-2
@@ -6,6 +6,6 @@ val e: (String) -> Int = { 0 }
|
||||
val f: () -> Int = { 0 }
|
||||
val g: Any.(Int) -> String = { "" }
|
||||
val h: Int.(Any) -> String = { "" }
|
||||
val i: @ExtensionFunctionType Function3<Any, Any, Int, String> = { a, b -> "" }
|
||||
val i: @Extension Function3<Any, Any, Int, String> = { a, b -> "" }
|
||||
val j: (t: Any, u: Int) -> kotlin.String = { a, b -> "" }
|
||||
val k: @ExtensionFunctionType Function2<Any, Int, String> = { "" }
|
||||
val k: @Extension Function2<Any, Int, String> = { "" }
|
||||
|
||||
@@ -10,4 +10,4 @@ Any.(Int) -> String
|
||||
|
||||
(t: Any, u: Int) -> kotlin.String
|
||||
|
||||
@ExtensionFunctionType Function2<Any, Int, String>
|
||||
@Extension Function2<Any, Int, String>
|
||||
|
||||
Reference in New Issue
Block a user