mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
KT UAST: fix wrong annotation on fake PSI for default property accessor
^KTIJ-34167 fixed GitOrigin-RevId: 32b342ab3617fe63e72260e153e3821a13b4cd9a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e88b623cb1
commit
70a2d3d4c3
@@ -107,8 +107,6 @@ internal class KotlinUMethodWithFakeLightDelegateDefaultAccessor(
|
||||
) : KotlinUMethodWithFakeLightDelegateBase<KtProperty>(original, fakePsi, givenParent),
|
||||
KotlinUMethodWithFakeLightDelegateAccessorBase {
|
||||
override fun computeAnnotations(annotations: SmartSet<UAnnotation>) {
|
||||
// Annotations on property accessor
|
||||
super.computeAnnotations(annotations)
|
||||
// Annotations on property, along with use-site target
|
||||
val useSiteTarget = if (fakePsi.isSetter) AnnotationUseSiteTarget.PROPERTY_SETTER else AnnotationUseSiteTarget.PROPERTY_GETTER
|
||||
computeAnnotationsFromProperty(annotations, this, original, useSiteTarget)
|
||||
@@ -125,7 +123,7 @@ internal class KotlinUMethodWithFakeLightDelegateAccessor(
|
||||
: this(original, UastFakeSourceLightAccessor(original, containingLightClass), givenParent)
|
||||
|
||||
override fun computeAnnotations(annotations: SmartSet<UAnnotation>) {
|
||||
// Annotations on property accessor
|
||||
// Annotations on property accessor ([original] of [KtPropertyAccessor])
|
||||
super.computeAnnotations(annotations)
|
||||
// Annotations on property, along with use-site target
|
||||
val useSiteTarget = if (original.isSetter) AnnotationUseSiteTarget.PROPERTY_SETTER else AnnotationUseSiteTarget.PROPERTY_GETTER
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.uast.kotlin.psi
|
||||
|
||||
import com.intellij.psi.PsiAnnotation
|
||||
import com.intellij.psi.PsiClass
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.psi.PsiParameterList
|
||||
import com.intellij.psi.impl.light.LightParameterListBuilder
|
||||
import org.jetbrains.kotlin.psi.KtPropertyAccessor
|
||||
import org.jetbrains.kotlin.utils.SmartSet
|
||||
import org.jetbrains.uast.UastLazyPart
|
||||
import org.jetbrains.uast.getOrBuild
|
||||
|
||||
@@ -46,4 +48,11 @@ internal class UastFakeSourceLightAccessor(
|
||||
}
|
||||
|
||||
override fun getParameterList(): PsiParameterList = _parameterList
|
||||
|
||||
override fun computeAnnotations(annotations: SmartSet<PsiAnnotation>) {
|
||||
// Annotations on property accessor ([original] of [KtPropertyAccessor])
|
||||
super.computeAnnotations(annotations)
|
||||
// Annotations on property, along with use-site target
|
||||
annotationFromProperty(annotations)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,14 +32,11 @@ internal open class UastFakeSourceLightAccessorBase<T: KtDeclaration>(
|
||||
return super.getReturnType()
|
||||
}
|
||||
|
||||
override fun computeAnnotations(annotations: SmartSet<PsiAnnotation>) {
|
||||
// Annotations on property accessor
|
||||
super.computeAnnotations(annotations)
|
||||
protected fun annotationFromProperty(annotations: SmartSet<PsiAnnotation>) {
|
||||
// Annotations on property, along with use-site target
|
||||
val useSiteTarget = if (isSetter) AnnotationUseSiteTarget.PROPERTY_SETTER else AnnotationUseSiteTarget.PROPERTY_GETTER
|
||||
property.annotationEntries
|
||||
.filter { it.useSiteTarget?.getAnnotationUseSiteTarget() == useSiteTarget }
|
||||
.mapTo(annotations) { it.toPsiAnnotation() }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.uast.kotlin.psi
|
||||
|
||||
import com.intellij.psi.PsiAnnotation
|
||||
import com.intellij.psi.PsiClass
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.psi.PsiParameterList
|
||||
import com.intellij.psi.impl.light.LightParameterListBuilder
|
||||
import org.jetbrains.kotlin.psi.KtProperty
|
||||
import org.jetbrains.kotlin.utils.SmartSet
|
||||
import org.jetbrains.uast.UastLazyPart
|
||||
import org.jetbrains.uast.getOrBuild
|
||||
|
||||
@@ -40,4 +42,9 @@ internal class UastFakeSourceLightDefaultAccessor(
|
||||
}
|
||||
|
||||
override fun getParameterList(): PsiParameterList = _parameterList
|
||||
|
||||
override fun computeAnnotations(annotations: SmartSet<PsiAnnotation>) {
|
||||
// Annotations on property, along with use-site target
|
||||
annotationFromProperty(annotations)
|
||||
}
|
||||
}
|
||||
@@ -2127,6 +2127,64 @@ interface UastApiFixtureTestBase {
|
||||
)
|
||||
}
|
||||
|
||||
fun checkAnnotationOnPropertyWithValueClassInSignature(myFixture: JavaCodeInsightTestFixture) {
|
||||
// https://youtrack.jetbrains.com/issue/KTIJ-34167
|
||||
myFixture.configureByText(
|
||||
"test.kt",
|
||||
"""
|
||||
package test.pkg
|
||||
|
||||
annotation class Anno
|
||||
|
||||
@JvmInline
|
||||
value class IntValue(val value: Int) {
|
||||
companion object {
|
||||
@Anno val withValueClassTypeSpecified: IntValue = IntValue(0)
|
||||
@Anno val withValueClassTypeUnspecified = IntValue(1)
|
||||
@Anno val withNonValueClassTypeSpecified: Int = 2
|
||||
@Anno val withNonValueClassTypeUnSpecified = 3
|
||||
}
|
||||
}
|
||||
""".trimIndent()
|
||||
)
|
||||
|
||||
var count = 0
|
||||
val uFile = myFixture.file.toUElementOfType<UFile>()!!
|
||||
uFile.accept(
|
||||
object : AbstractUastVisitor() {
|
||||
override fun visitField(node: UField): Boolean {
|
||||
if (!node.name.startsWith("with"))
|
||||
return super.visitField(node)
|
||||
|
||||
val uAnnos = node.uAnnotations.filter { it.qualifiedName == "test.pkg.Anno" }
|
||||
TestCase.assertEquals(node.name, 1, uAnnos.size)
|
||||
|
||||
val jAnnos = (node.javaPsi as? PsiField)?.annotations?.filter { it.qualifiedName == "test.pkg.Anno" }
|
||||
TestCase.assertEquals(node.name, 0, jAnnos?.size)
|
||||
|
||||
count++
|
||||
return super.visitField(node)
|
||||
}
|
||||
|
||||
override fun visitMethod(node: UMethod): Boolean {
|
||||
if (!node.name.startsWith("getWith"))
|
||||
return super.visitMethod(node)
|
||||
|
||||
val uAnnos = node.uAnnotations.filter { it.qualifiedName == "test.pkg.Anno" }
|
||||
TestCase.assertEquals(node.name, 0, uAnnos.size)
|
||||
|
||||
val jAnnos = node.javaPsi.annotations.filter { it.qualifiedName == "test.pkg.Anno" }
|
||||
TestCase.assertEquals(node.name, 0, jAnnos.size)
|
||||
|
||||
count++
|
||||
return super.visitMethod(node)
|
||||
}
|
||||
}
|
||||
)
|
||||
// 4 fields and 4 getters
|
||||
TestCase.assertEquals(8, count)
|
||||
}
|
||||
|
||||
fun checkTypealiasAnnotation(myFixture: JavaCodeInsightTestFixture) {
|
||||
myFixture.addClass(
|
||||
"""
|
||||
|
||||
@@ -234,6 +234,10 @@ class FirUastApiFixtureTest : KotlinLightCodeInsightFixtureTestCase(), UastApiFi
|
||||
checkAnnotationOnMemberWithValueClassInSignature(myFixture)
|
||||
}
|
||||
|
||||
fun testAnnotationOnPropertyWithValueClassInSignature() {
|
||||
checkAnnotationOnPropertyWithValueClassInSignature(myFixture)
|
||||
}
|
||||
|
||||
fun testTypealiasAnnotation() {
|
||||
checkTypealiasAnnotation(myFixture)
|
||||
}
|
||||
|
||||
@@ -40,6 +40,11 @@ public class FirUastDeclarationTestGenerated extends AbstractFirUastDeclarationT
|
||||
runTest("testData/declaration/annotationOnLocal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("annotationOnPropertyWithValueClass.kt")
|
||||
public void testAnnotationOnPropertyWithValueClass() throws Exception {
|
||||
runTest("testData/declaration/annotationOnPropertyWithValueClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("build.gradle.kts")
|
||||
public void testBuild_gradle() throws Exception {
|
||||
runTest("testData/declaration/build.gradle.kts");
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package test.pkg
|
||||
|
||||
annotation class Anno
|
||||
|
||||
@JvmInline
|
||||
value class IntValue(val value: Int) {
|
||||
companion object {
|
||||
@Anno val withValueClassTypeSpecified: IntValue = IntValue(0)
|
||||
@Anno val withValueClassTypeUnspecified = IntValue(1)
|
||||
@Anno val withNonValueClassTypeSpecified: Int = 2
|
||||
@Anno val withNonValueClassTypeUnSpecified = 3
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
UFile (package = test.pkg)
|
||||
UClass (name = Anno)
|
||||
UClass (name = IntValue)
|
||||
UAnnotation (fqName = kotlin.jvm.JvmInline)
|
||||
UField (name = Companion)
|
||||
UAnnotation (fqName = null)
|
||||
UField (name = withValueClassTypeSpecified)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UAnnotation (fqName = test.pkg.Anno)
|
||||
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1))
|
||||
UIdentifier (Identifier (IntValue))
|
||||
USimpleNameReferenceExpression (identifier = IntValue, resolvesTo = PsiClass: IntValue)
|
||||
ULiteralExpression (value = 0)
|
||||
UField (name = withValueClassTypeUnspecified)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UAnnotation (fqName = test.pkg.Anno)
|
||||
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1))
|
||||
UIdentifier (Identifier (IntValue))
|
||||
USimpleNameReferenceExpression (identifier = IntValue, resolvesTo = PsiClass: IntValue)
|
||||
ULiteralExpression (value = 1)
|
||||
UField (name = withNonValueClassTypeSpecified)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UAnnotation (fqName = test.pkg.Anno)
|
||||
ULiteralExpression (value = 2)
|
||||
UField (name = withNonValueClassTypeUnSpecified)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UAnnotation (fqName = test.pkg.Anno)
|
||||
ULiteralExpression (value = 3)
|
||||
UField (name = value)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UMethod (name = getValue)
|
||||
UMethod (name = IntValue)
|
||||
UParameter (name = value)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UClass (name = Companion)
|
||||
UMethod (name = getWithValueClassTypeSpecified)
|
||||
UMethod (name = getWithValueClassTypeUnspecified)
|
||||
UMethod (name = getWithNonValueClassTypeSpecified)
|
||||
UMethod (name = getWithNonValueClassTypeUnSpecified)
|
||||
UMethod (name = Companion)
|
||||
@@ -0,0 +1,42 @@
|
||||
UFile (package = test.pkg)
|
||||
UClass (name = Anno)
|
||||
UClass (name = IntValue)
|
||||
UAnnotation (fqName = kotlin.jvm.JvmInline)
|
||||
UField (name = Companion)
|
||||
UAnnotation (fqName = null)
|
||||
UField (name = withValueClassTypeSpecified)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UAnnotation (fqName = test.pkg.Anno)
|
||||
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1))
|
||||
UIdentifier (Identifier (IntValue))
|
||||
USimpleNameReferenceExpression (identifier = IntValue, resolvesTo = PsiClass: IntValue)
|
||||
ULiteralExpression (value = 0)
|
||||
UField (name = withValueClassTypeUnspecified)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UAnnotation (fqName = test.pkg.Anno)
|
||||
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1))
|
||||
UIdentifier (Identifier (IntValue))
|
||||
USimpleNameReferenceExpression (identifier = IntValue, resolvesTo = PsiClass: IntValue)
|
||||
ULiteralExpression (value = 1)
|
||||
UField (name = withNonValueClassTypeSpecified)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UAnnotation (fqName = test.pkg.Anno)
|
||||
ULiteralExpression (value = 2)
|
||||
UField (name = withNonValueClassTypeUnSpecified)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UAnnotation (fqName = test.pkg.Anno)
|
||||
ULiteralExpression (value = 3)
|
||||
UField (name = value)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UMethod (name = toString)
|
||||
UMethod (name = hashCode)
|
||||
UMethod (name = equals)
|
||||
UParameter (name = other)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.Nullable)
|
||||
UMethod (name = getValue)
|
||||
UClass (name = Companion)
|
||||
UMethod (name = getWithValueClassTypeUnspecified)
|
||||
UMethod (name = getWithNonValueClassTypeSpecified)
|
||||
UMethod (name = getWithNonValueClassTypeUnSpecified)
|
||||
UMethod (name = Companion)
|
||||
UMethod (name = getWithValueClassTypeSpecified)
|
||||
@@ -0,0 +1,22 @@
|
||||
package test.pkg
|
||||
|
||||
public abstract annotation Anno {
|
||||
}
|
||||
|
||||
public final class IntValue {
|
||||
@null public static final var Companion: test.pkg.IntValue.Companion
|
||||
@org.jetbrains.annotations.NotNull @test.pkg.Anno private static final var withValueClassTypeSpecified: int = IntValue(0)
|
||||
@org.jetbrains.annotations.NotNull @test.pkg.Anno private static final var withValueClassTypeUnspecified: int = IntValue(1)
|
||||
@org.jetbrains.annotations.NotNull @test.pkg.Anno private static final var withNonValueClassTypeSpecified: int = 2
|
||||
@org.jetbrains.annotations.NotNull @test.pkg.Anno private static final var withNonValueClassTypeUnSpecified: int = 3
|
||||
@org.jetbrains.annotations.NotNull private final var value: int
|
||||
public final fun getValue() : int = UastEmptyExpression
|
||||
public fun IntValue(@org.jetbrains.annotations.NotNull value: int) = UastEmptyExpression
|
||||
public static final class Companion {
|
||||
public final fun getWithValueClassTypeSpecified() : int = UastEmptyExpression
|
||||
public final fun getWithValueClassTypeUnspecified() : int = UastEmptyExpression
|
||||
public final fun getWithNonValueClassTypeSpecified() : int = UastEmptyExpression
|
||||
public final fun getWithNonValueClassTypeUnSpecified() : int = UastEmptyExpression
|
||||
private fun Companion() = UastEmptyExpression
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package test.pkg
|
||||
|
||||
public abstract annotation Anno {
|
||||
}
|
||||
|
||||
public final class IntValue {
|
||||
@null public static final var Companion: test.pkg.IntValue.Companion
|
||||
@org.jetbrains.annotations.NotNull @test.pkg.Anno private static final var withValueClassTypeSpecified: int = IntValue(0)
|
||||
@org.jetbrains.annotations.NotNull @test.pkg.Anno private static final var withValueClassTypeUnspecified: int = IntValue(1)
|
||||
@org.jetbrains.annotations.NotNull @test.pkg.Anno private static final var withNonValueClassTypeSpecified: int = 2
|
||||
@org.jetbrains.annotations.NotNull @test.pkg.Anno private static final var withNonValueClassTypeUnSpecified: int = 3
|
||||
@org.jetbrains.annotations.NotNull private final var value: int
|
||||
public fun toString() : java.lang.String = UastEmptyExpression
|
||||
public fun hashCode() : int = UastEmptyExpression
|
||||
public fun equals(@org.jetbrains.annotations.Nullable other: java.lang.Object) : boolean = UastEmptyExpression
|
||||
public final fun getValue() : int = UastEmptyExpression
|
||||
public static final class Companion {
|
||||
public final fun getWithValueClassTypeUnspecified() : int = UastEmptyExpression
|
||||
public final fun getWithNonValueClassTypeSpecified() : int = UastEmptyExpression
|
||||
public final fun getWithNonValueClassTypeUnSpecified() : int = UastEmptyExpression
|
||||
private fun Companion() = UastEmptyExpression
|
||||
public final fun getWithValueClassTypeSpecified() : int = UastEmptyExpression
|
||||
}
|
||||
}
|
||||
@@ -53,14 +53,6 @@ UFile (package = test.pkg)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "null?")
|
||||
UMethod (name = setPOld_getter_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UParameter (name = <set-?>)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.Nullable)
|
||||
UMethod (name = getPOld_getter_deprecatedOnGetter)
|
||||
|
||||
@@ -70,14 +70,6 @@ UFile (package = test.pkg)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "null?")
|
||||
UMethod (name = setPOld_getter_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UParameter (name = <set-?>)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.Nullable)
|
||||
UMethod (name = getPOld_getter_deprecatedOnGetter)
|
||||
|
||||
@@ -19,7 +19,6 @@ public final class Test {
|
||||
if (var8a4c2ed8 != null) var8a4c2ed8 else "null?"
|
||||
}
|
||||
}
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public final fun setPOld_getter_deprecatedOnProperty(@org.jetbrains.annotations.Nullable <set-?>: java.lang.String) : void = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more getter", level = DeprecationLevel.HIDDEN)
|
||||
public final fun getPOld_getter_deprecatedOnGetter() : java.lang.String {
|
||||
|
||||
@@ -26,7 +26,6 @@ public final class Test {
|
||||
if (var8a4c2ed8 != null) var8a4c2ed8 else "null?"
|
||||
}
|
||||
}
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public final fun setPOld_getter_deprecatedOnProperty(@org.jetbrains.annotations.Nullable <set-?>: java.lang.String) : void = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more getter", level = DeprecationLevel.HIDDEN)
|
||||
public final fun getPOld_getter_deprecatedOnGetter() : java.lang.String {
|
||||
|
||||
@@ -4,23 +4,7 @@ UFile (package = test.pkg)
|
||||
UMethod (name = setPNew)
|
||||
UParameter (name = <set-?>)
|
||||
UMethod (name = getPOld_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UMethod (name = setPOld_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UParameter (name = <set-?>)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UMethod (name = getPOld_deprecatedOnGetter)
|
||||
|
||||
@@ -7,23 +7,7 @@ UFile (package = test.pkg)
|
||||
UMethod (name = setPNew)
|
||||
UParameter (name = <set-?>)
|
||||
UMethod (name = getPOld_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UMethod (name = setPOld_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UParameter (name = <set-?>)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UMethod (name = getPOld_deprecatedOnGetter)
|
||||
|
||||
@@ -3,9 +3,7 @@ package test.pkg
|
||||
public abstract interface TestInterface {
|
||||
public abstract fun getPNew() : int = UastEmptyExpression
|
||||
public abstract fun setPNew(<set-?>: int) : void = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public abstract fun getPOld_deprecatedOnProperty() : int = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public abstract fun setPOld_deprecatedOnProperty(@org.jetbrains.annotations.NotNull <set-?>: int) : void = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more getter", level = DeprecationLevel.HIDDEN)
|
||||
public abstract fun getPOld_deprecatedOnGetter() : int = UastEmptyExpression
|
||||
|
||||
@@ -5,9 +5,7 @@ public abstract interface TestInterface {
|
||||
public abstract fun getPOld_deprecatedOnSetter() : int = UastEmptyExpression
|
||||
public abstract fun getPNew() : int = UastEmptyExpression
|
||||
public abstract fun setPNew(<set-?>: int) : void = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public abstract fun getPOld_deprecatedOnProperty() : int = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public abstract fun setPOld_deprecatedOnProperty(@org.jetbrains.annotations.NotNull <set-?>: int) : void = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more getter", level = DeprecationLevel.HIDDEN)
|
||||
public abstract fun getPOld_deprecatedOnGetter() : int = UastEmptyExpression
|
||||
|
||||
@@ -30,23 +30,7 @@ UFile (package = test.pkg)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UMethod (name = Test)
|
||||
UMethod (name = getPOld_noAccessor_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UMethod (name = setPOld_noAccessor_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UParameter (name = <set-?>)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UMethod (name = getPOld_noAccessor_deprecatedOnGetter)
|
||||
|
||||
@@ -34,23 +34,7 @@ UFile (package = test.pkg)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UMethod (name = Test)
|
||||
UMethod (name = getPOld_noAccessor_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UMethod (name = setPOld_noAccessor_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UParameter (name = <set-?>)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UMethod (name = getPOld_noAccessor_deprecatedOnGetter)
|
||||
|
||||
@@ -8,9 +8,7 @@ public final class Test {
|
||||
public final fun getPNew_noAccessor() : java.lang.String = UastEmptyExpression
|
||||
public final fun setPNew_noAccessor(@org.jetbrains.annotations.NotNull <set-?>: java.lang.String) : void = UastEmptyExpression
|
||||
public fun Test() = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public final fun getPOld_noAccessor_deprecatedOnProperty() : java.lang.String = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public final fun setPOld_noAccessor_deprecatedOnProperty(@org.jetbrains.annotations.NotNull <set-?>: java.lang.String) : void = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more getter", level = DeprecationLevel.HIDDEN)
|
||||
public final fun getPOld_noAccessor_deprecatedOnGetter() : java.lang.String = UastEmptyExpression
|
||||
|
||||
@@ -10,9 +10,7 @@ public final class Test {
|
||||
public final fun getPNew_noAccessor() : java.lang.String = UastEmptyExpression
|
||||
public final fun setPNew_noAccessor(@org.jetbrains.annotations.NotNull <set-?>: java.lang.String) : void = UastEmptyExpression
|
||||
public fun Test() = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public final fun getPOld_noAccessor_deprecatedOnProperty() : java.lang.String = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public final fun setPOld_noAccessor_deprecatedOnProperty(@org.jetbrains.annotations.NotNull <set-?>: java.lang.String) : void = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more getter", level = DeprecationLevel.HIDDEN)
|
||||
public final fun getPOld_noAccessor_deprecatedOnGetter() : java.lang.String = UastEmptyExpression
|
||||
|
||||
@@ -35,14 +35,6 @@ UFile (package = test.pkg)
|
||||
USimpleNameReferenceExpression (identifier = value)
|
||||
UMethod (name = Test)
|
||||
UMethod (name = getPOld_setter_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UMethod (name = setPOld_setter_deprecatedOnProperty)
|
||||
UParameter (name = value)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.Nullable)
|
||||
|
||||
@@ -48,14 +48,6 @@ UFile (package = test.pkg)
|
||||
USimpleNameReferenceExpression (identifier = value)
|
||||
UMethod (name = Test)
|
||||
UMethod (name = getPOld_setter_deprecatedOnProperty)
|
||||
UAnnotation (fqName = kotlin.Deprecated)
|
||||
UNamedExpression (name = message)
|
||||
UPolyadicExpression (operator = +)
|
||||
ULiteralExpression (value = "no more property")
|
||||
UNamedExpression (name = level)
|
||||
UQualifiedReferenceExpression
|
||||
USimpleNameReferenceExpression (identifier = DeprecationLevel)
|
||||
USimpleNameReferenceExpression (identifier = HIDDEN)
|
||||
UMethod (name = setPOld_setter_deprecatedOnProperty)
|
||||
UParameter (name = value)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.Nullable)
|
||||
|
||||
@@ -12,7 +12,6 @@ public final class Test {
|
||||
}
|
||||
}
|
||||
public fun Test() = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public final fun getPOld_setter_deprecatedOnProperty() : java.lang.String = UastEmptyExpression
|
||||
public final fun setPOld_setter_deprecatedOnProperty(@org.jetbrains.annotations.Nullable value: java.lang.String) : void {
|
||||
if (field == null) {
|
||||
|
||||
@@ -18,7 +18,6 @@ public final class Test {
|
||||
}
|
||||
}
|
||||
public fun Test() = UastEmptyExpression
|
||||
@kotlin.Deprecated(message = "no more property", level = DeprecationLevel.HIDDEN)
|
||||
public final fun getPOld_setter_deprecatedOnProperty() : java.lang.String = UastEmptyExpression
|
||||
public final fun setPOld_setter_deprecatedOnProperty(@org.jetbrains.annotations.Nullable value: java.lang.String) : void {
|
||||
if (field == null) {
|
||||
|
||||
@@ -226,11 +226,15 @@ class FE1UastApiFixtureTest : KotlinLightCodeInsightFixtureTestCase(), UastApiFi
|
||||
checkJavaConstantEvaluation(myFixture)
|
||||
}
|
||||
|
||||
fun testTypealiasAnnotation() {
|
||||
checkTypealiasAnnotation(myFixture)
|
||||
}
|
||||
|
||||
fun testAnnotationOnMemberWithValueClassInSignature() {
|
||||
checkAnnotationOnMemberWithValueClassInSignature(myFixture)
|
||||
}
|
||||
|
||||
fun testAnnotationOnPropertyWithValueClassInSignature() {
|
||||
checkAnnotationOnPropertyWithValueClassInSignature(myFixture)
|
||||
}
|
||||
|
||||
fun testTypealiasAnnotation() {
|
||||
checkTypealiasAnnotation(myFixture)
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,11 @@ public class FE1UastDeclarationTestGenerated extends AbstractFE1UastDeclarationT
|
||||
runTest("../../uast-kotlin-fir/tests/testData/declaration/annotationOnLocal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("annotationOnPropertyWithValueClass.kt")
|
||||
public void testAnnotationOnPropertyWithValueClass() throws Exception {
|
||||
runTest("../../uast-kotlin-fir/tests/testData/declaration/annotationOnPropertyWithValueClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("build.gradle.kts")
|
||||
public void testBuild_gradle() throws Exception {
|
||||
runTest("../../uast-kotlin-fir/tests/testData/declaration/build.gradle.kts");
|
||||
|
||||
Reference in New Issue
Block a user