[FIR] add tests on annotations for delegated getter during implicit type phase

^KT-62874
This commit is contained in:
Dmitrii Gridin
2023-10-24 21:47:14 +02:00
committed by Space Team
parent 11e7500d9e
commit 1b636bf450
13 changed files with 547 additions and 0 deletions
@@ -0,0 +1,15 @@
import kotlin.reflect.KProperty
@get:Anno("getter")
@set:Anno("setter")
@setparam:Anno("parameter")
@delegate:Anno("delegate")
var f<caret>oo by MyDelegate()
@Repeatable
annotation class Anno(val s: String)
class MyDelegate {
operator fun getValue(thisRef: Any?, property: KProperty<*>) = 42
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: Int) {}
}
@@ -0,0 +1,15 @@
import kotlin.reflect.KProperty
@get:Anno("getter")
@set:Anno("setter")
@setparam:Anno("parameter")
@delegate:Anno("delegate")
var f<caret>oo: Int by MyDelegate()
@Repeatable
annotation class Anno(val s: String)
class MyDelegate {
operator fun getValue(thisRef: Any?, property: KProperty<*>) = 42
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: Int) {}
}
@@ -0,0 +1,382 @@
RAW_FIR:
FILE: [ResolvedTo(RAW_FIR)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] var foo: Intby LAZY_EXPRESSION
@PROPERTY_GETTER:Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(RAW_FIR)] get(): <implicit> {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] @SETTER_PARAMETER:Anno[Unresolved](LAZY_EXPRESSION) <set-?>: <implicit>): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@Repeatable[Unresolved]() public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|<local>/s|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
IMPORTS:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] var foo: Intby LAZY_EXPRESSION
@PROPERTY_GETTER:Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(RAW_FIR)] get(): <implicit> {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] @SETTER_PARAMETER:Anno[Unresolved](LAZY_EXPRESSION) <set-?>: <implicit>): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@Repeatable[Unresolved]() public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|<local>/s|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
COMPILER_REQUIRED_ANNOTATIONS:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] var foo: Intby LAZY_EXPRESSION
@PROPERTY_GETTER:Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] get(): <implicit> {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] set([ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] @SETTER_PARAMETER:Anno[Unresolved](LAZY_EXPRESSION) <set-?>: <implicit>): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@Repeatable[Unresolved]() public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|<local>/s|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
COMPANION_GENERATION:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPANION_GENERATION)] var foo: Intby LAZY_EXPRESSION
@PROPERTY_GETTER:Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(COMPANION_GENERATION)] get(): <implicit> {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(COMPANION_GENERATION)] set([ResolvedTo(COMPANION_GENERATION)] @SETTER_PARAMETER:Anno[Unresolved](LAZY_EXPRESSION) <set-?>: <implicit>): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@Repeatable[Unresolved]() public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|<local>/s|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
SUPER_TYPES:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(SUPER_TYPES)] var foo: Intby LAZY_EXPRESSION
@PROPERTY_GETTER:Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(SUPER_TYPES)] get(): <implicit> {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(SUPER_TYPES)] set([ResolvedTo(SUPER_TYPES)] @SETTER_PARAMETER:Anno[Unresolved](LAZY_EXPRESSION) <set-?>: <implicit>): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@Repeatable[Unresolved]() public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|<local>/s|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
TYPES:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:R|Anno|[Types](LAZY_EXPRESSION) public? final? [ResolvedTo(TYPES)] var foo: R|kotlin/Int|by LAZY_EXPRESSION
@PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public? [ResolvedTo(TYPES)] get(): R|kotlin/Int| {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public? [ResolvedTo(TYPES)] set([ResolvedTo(TYPES)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) <set-?>: R|kotlin/Int|): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@Repeatable[Unresolved]() public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|<local>/s|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
STATUS:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:R|Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] var foo: R|kotlin/Int|by LAZY_EXPRESSION
@PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] get(): R|kotlin/Int| {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) <set-?>: R|kotlin/Int|): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@Repeatable[Unresolved]() public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|<local>/s|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
EXPECT_ACTUAL_MATCHING:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:R|Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] var foo: R|kotlin/Int|by LAZY_EXPRESSION
@PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(EXPECT_ACTUAL_MATCHING)] get(): R|kotlin/Int| {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(EXPECT_ACTUAL_MATCHING)] set([ResolvedTo(EXPECT_ACTUAL_MATCHING)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) <set-?>: R|kotlin/Int|): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@Repeatable[Unresolved]() public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|<local>/s|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
CONTRACTS:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:R|Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(CONTRACTS)] var foo: R|kotlin/Int|by LAZY_EXPRESSION
@PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(CONTRACTS)] get(): R|kotlin/Int| {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(CONTRACTS)] set([ResolvedTo(CONTRACTS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) <set-?>: R|kotlin/Int|): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@Repeatable[Unresolved]() public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|<local>/s|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
IMPLICIT_TYPES_BODY_RESOLVE:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:R|Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var foo: R|kotlin/Int|by LAZY_EXPRESSION
@PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] set([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) <set-?>: R|kotlin/Int|): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@Repeatable[Unresolved]() public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|<local>/s|
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
ANNOTATION_ARGUMENTS:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:R|Anno|[Types](s = String(delegate)) public final [ResolvedTo(ANNOTATION_ARGUMENTS)] var foo: R|kotlin/Int|by LAZY_EXPRESSION
@PROPERTY_GETTER:R|Anno|[Types](s = String(getter)) public [ResolvedTo(ANNOTATION_ARGUMENTS)] get(): R|kotlin/Int| {
^ D|/foo|.getValue#(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:R|Anno|[Types](s = String(setter)) public [ResolvedTo(ANNOTATION_ARGUMENTS)] set([ResolvedTo(ANNOTATION_ARGUMENTS)] @SETTER_PARAMETER:R|Anno|[Types](s = String(parameter)) <set-?>: R|kotlin/Int|): R|kotlin/Unit| {
^ D|/foo|.setValue#(Null(null), ::R|/foo|, R|<local>/foo|)
}
@R|kotlin/annotation/Repeatable|[Types]() public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.s] s: R|kotlin/String|): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|<local>/s|
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String|
}
public? final? [ResolvedTo(RAW_FIR)] class MyDelegate : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public? final? operator [ResolvedTo(RAW_FIR)] fun getValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>): <implicit> { LAZY_BLOCK }
public? final? operator [ResolvedTo(RAW_FIR)] fun setValue([ResolvedTo(RAW_FIR)] thisRef: Any?, [ResolvedTo(RAW_FIR)] property: KProperty<*>, [ResolvedTo(RAW_FIR)] value: Int): R|kotlin/Unit| { LAZY_BLOCK }
}
BODY_RESOLVE:
FILE: [ResolvedTo(IMPORTS)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:R|Anno|[Types](s = String(delegate)) public final [ResolvedTo(BODY_RESOLVE)] var foo: R|kotlin/Int|by R|/MyDelegate.MyDelegate|()
@PROPERTY_GETTER:R|Anno|[Types](s = String(getter)) public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int| {
^ D|/foo|.R|/MyDelegate.getValue|(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:R|Anno|[Types](s = String(setter)) public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](s = String(parameter)) <set-?>: R|kotlin/Int|): R|kotlin/Unit| {
^ D|/foo|.R|/MyDelegate.setValue|(Null(null), ::R|/foo|, R|<local>/foo|)
}
@R|kotlin/annotation/Repeatable|[Types]() public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.s] s: R|kotlin/String|): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|<local>/s|
public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String|
}
public final [ResolvedTo(STATUS)] class MyDelegate : R|kotlin/Any| {
public [ResolvedTo(STATUS)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
LAZY_super<R|kotlin/Any|>
}
public final operator [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun getValue([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] thisRef: R|kotlin/Any?|, [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] property: R|kotlin/reflect/KProperty<*>|): R|kotlin/Int| {
^getValue Int(42)
}
public final operator [ResolvedTo(CONTRACTS)] fun setValue([ResolvedTo(CONTRACTS)] thisRef: R|kotlin/Any?|, [ResolvedTo(CONTRACTS)] property: R|kotlin/reflect/KProperty<*>|, [ResolvedTo(CONTRACTS)] value: R|kotlin/Int|): R|kotlin/Unit| {
}
}
FILE RAW TO BODY:
FILE: [ResolvedTo(BODY_RESOLVE)] delegateWithAnnotationOnAccessorWithExplicitType.kt
field:@PROPERTY_DELEGATE_FIELD:R|Anno|[Types](s = String(delegate)) public final [ResolvedTo(BODY_RESOLVE)] var foo: R|kotlin/Int|by R|/MyDelegate.MyDelegate|()
@PROPERTY_GETTER:R|Anno|[Types](s = String(getter)) public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int| {
^ D|/foo|.R|/MyDelegate.getValue|(Null(null), ::R|/foo|)
}
@PROPERTY_SETTER:R|Anno|[Types](s = String(setter)) public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](s = String(parameter)) <set-?>: R|kotlin/Int|): R|kotlin/Unit| {
^ D|/foo|.R|/MyDelegate.setValue|(Null(null), ::R|/foo|, R|<local>/foo|)
}
@R|kotlin/annotation/Repeatable|[Types]() public final [ResolvedTo(BODY_RESOLVE)] annotation class Anno : R|kotlin/Annotation| {
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Anno.s] s: R|kotlin/String|): R|Anno| {
super<R|kotlin/Any|>()
}
public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|<local>/s|
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): R|kotlin/String|
}
public final [ResolvedTo(BODY_RESOLVE)] class MyDelegate : R|kotlin/Any| {
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyDelegate] constructor(): R|MyDelegate| {
super<R|kotlin/Any|>()
}
public final operator [ResolvedTo(BODY_RESOLVE)] fun getValue([ResolvedTo(BODY_RESOLVE)] thisRef: R|kotlin/Any?|, [ResolvedTo(BODY_RESOLVE)] property: R|kotlin/reflect/KProperty<*>|): R|kotlin/Int| {
^getValue Int(42)
}
public final operator [ResolvedTo(BODY_RESOLVE)] fun setValue([ResolvedTo(BODY_RESOLVE)] thisRef: R|kotlin/Any?|, [ResolvedTo(BODY_RESOLVE)] property: R|kotlin/reflect/KProperty<*>|, [ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| {
}
}
@@ -895,6 +895,18 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/lazyResolve/properties"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessor.kt")
public void testDelegateWithAnnotationOnAccessor() throws Exception {
runTest("analysis/low-level-api-fir/testData/lazyResolve/properties/delegateWithAnnotationOnAccessor.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithExplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithExplicitType() throws Exception {
runTest("analysis/low-level-api-fir/testData/lazyResolve/properties/delegateWithAnnotationOnAccessorWithExplicitType.kt");
}
@Test
@TestMetadata("getterWithDelegation.kt")
public void testGetterWithDelegation() throws Exception {
@@ -895,6 +895,18 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/lazyResolve/properties"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessor.kt")
public void testDelegateWithAnnotationOnAccessor() throws Exception {
runTest("analysis/low-level-api-fir/testData/lazyResolve/properties/delegateWithAnnotationOnAccessor.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithExplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithExplicitType() throws Exception {
runTest("analysis/low-level-api-fir/testData/lazyResolve/properties/delegateWithAnnotationOnAccessorWithExplicitType.kt");
}
@Test
@TestMetadata("getterWithDelegation.kt")
public void testGetterWithDelegation() throws Exception {
@@ -9556,6 +9556,18 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithExplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithExplicitType() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/delegateWithAnnotationOnAccessorWithExplicitType.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithImplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithImplicitType() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/delegateWithAnnotationOnAccessorWithImplicitType.kt");
}
@Test
@TestMetadata("delegatedPropertyOverridedInTrait.kt")
public void testDelegatedPropertyOverridedInTrait() throws Exception {
@@ -9556,6 +9556,18 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithExplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithExplicitType() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/delegateWithAnnotationOnAccessorWithExplicitType.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithImplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithImplicitType() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/delegateWithAnnotationOnAccessorWithImplicitType.kt");
}
@Test
@TestMetadata("delegatedPropertyOverridedInTrait.kt")
public void testDelegatedPropertyOverridedInTrait() throws Exception {
@@ -9550,6 +9550,18 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithExplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithExplicitType() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/delegateWithAnnotationOnAccessorWithExplicitType.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithImplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithImplicitType() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/delegateWithAnnotationOnAccessorWithImplicitType.kt");
}
@Test
@TestMetadata("delegatedPropertyOverridedInTrait.kt")
public void testDelegatedPropertyOverridedInTrait() throws Exception {
@@ -9556,6 +9556,18 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithExplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithExplicitType() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/delegateWithAnnotationOnAccessorWithExplicitType.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithImplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithImplicitType() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/delegateWithAnnotationOnAccessorWithImplicitType.kt");
}
@Test
@TestMetadata("delegatedPropertyOverridedInTrait.kt")
public void testDelegatedPropertyOverridedInTrait() throws Exception {
@@ -0,0 +1,17 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
@get:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
@set:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
@setparam:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
@delegate:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
var foo: Int by MyDelegate()
@Repeatable
annotation class Anno(val s: Int)
class MyDelegate {
operator fun getValue(thisRef: Any?, property: KProperty<*>) = 42
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: Int) {}
}
@@ -0,0 +1,17 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_REVERSED_RESOLVE
import kotlin.reflect.KProperty
@get:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>foo<!>)
@set:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
@setparam:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
@delegate:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
var foo by MyDelegate()
@Repeatable
annotation class Anno(val i: Int)
class MyDelegate {
operator fun getValue(thisRef: Any?, property: KProperty<*>) = 42
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: Int) {}
}
@@ -0,0 +1,17 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_REVERSED_RESOLVE
import kotlin.reflect.KProperty
@get:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
@set:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
@setparam:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
@delegate:Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>foo<!>)
var foo by MyDelegate()
@Repeatable
annotation class Anno(val i: Int)
class MyDelegate {
operator fun getValue(thisRef: Any?, property: KProperty<*>) = 42
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: Int) {}
}
@@ -9556,6 +9556,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithExplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithExplicitType() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/delegateWithAnnotationOnAccessorWithExplicitType.kt");
}
@Test
@TestMetadata("delegateWithAnnotationOnAccessorWithImplicitType.kt")
public void testDelegateWithAnnotationOnAccessorWithImplicitType() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/delegateWithAnnotationOnAccessorWithImplicitType.kt");
}
@Test
@TestMetadata("delegatedPropertyOverridedInTrait.kt")
public void testDelegatedPropertyOverridedInTrait() throws Exception {