[FIR] add tests on annotations for delegated getter during implicit type phase
^KT-62874
This commit is contained in:
committed by
Space Team
parent
11e7500d9e
commit
1b636bf450
+12
@@ -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 {
|
||||
|
||||
+12
@@ -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 {
|
||||
|
||||
+17
@@ -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) {}
|
||||
}
|
||||
+17
@@ -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) {}
|
||||
}
|
||||
+17
@@ -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) {}
|
||||
}
|
||||
Generated
+12
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user