[FIR] add diagnostic test for annotations inside type parameters

^KT-63396
This commit is contained in:
Dmitrii Gridin
2023-11-10 17:16:12 +01:00
committed by Space Team
parent bec434d534
commit 2ee9fcab9b
13 changed files with 812 additions and 0 deletions
@@ -0,0 +1,15 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// WITH_STDLIB
@Target(AnnotationTarget.TYPE, AnnotationTarget.FUNCTION, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.TYPE_PARAMETER)
annotation class Anno(val position: String)
interface OriginalInterface {
@Anno("explicitType $prop")
fun <@Anno("type param $<!UNRESOLVED_REFERENCE!>prop<!>") F : @Anno("bound $<!UNRESOLVED_REFERENCE!>prop<!>") List<@Anno("nested bound $<!UNRESOLVED_REFERENCE!>prop<!>") List<@Anno("nested nested bound $<!UNRESOLVED_REFERENCE!>prop<!>") String>>> @receiver:Anno("receiver annotation: $prop") @Anno("receiver type $prop") Collection<@Anno("nested receiver type $prop") List<@Anno("nested nested receiver type $prop")String>>.explicitType(@Anno("parameter annotation $prop") param: @Anno("parameter type $prop") ListIterator<@Anno("nested parameter type $prop") List<@Anno("nested nested parameter type $prop")String>>): @Anno("explicitType return type $prop") List<@Anno("explicitType nested return type $prop") List<@Anno("explicitType nested nested return type $prop") Int>> = emptyList()
val <@Anno("type param $<!UNRESOLVED_REFERENCE!>prop<!>") F : @Anno("bound $<!UNRESOLVED_REFERENCE!>prop<!>") Number> F.explicitType: @Anno("bound $prop") Int get() = 1
companion object {
private const val prop = 0
}
}
@@ -0,0 +1,15 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// WITH_STDLIB
@Target(AnnotationTarget.TYPE, AnnotationTarget.FUNCTION, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.TYPE_PARAMETER)
annotation class Anno(val position: String)
interface OriginalInterface {
@Anno("explicitType $prop")
fun <@Anno("type param $prop") F : @Anno("bound $prop") List<@Anno("nested bound $prop") List<@Anno("nested nested bound $prop") String>>> @receiver:Anno("receiver annotation: $prop") <!REPEATED_ANNOTATION!>@Anno("receiver type $prop")<!> Collection<@Anno("nested receiver type $prop") List<@Anno("nested nested receiver type $prop")String>>.explicitType(@Anno("parameter annotation $prop") param: @Anno("parameter type $prop") ListIterator<@Anno("nested parameter type $prop") List<@Anno("nested nested parameter type $prop")String>>): @Anno("explicitType return type $prop") List<@Anno("explicitType nested return type $prop") List<@Anno("explicitType nested nested return type $prop") Int>> = emptyList()
val <@Anno("type param $prop") F : @Anno("bound $prop") Number> F.explicitType: @Anno("bound $prop") Int get() = 1
companion object {
private const val prop = 0
}
}