Files
kotlin-fork/compiler/testData/diagnostics/tests/kt46483.fir.kt
T
Nikolay Lunyak f578381726 [FIR] KT-46483: Forbid annotations in where Clauses
Merge-request: KT-MR-7208
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
2022-09-28 13:38:18 +00:00

12 lines
536 B
Kotlin
Vendored

@Repeatable
@Target( AnnotationTarget.TYPE_PARAMETER)
annotation class TypeParameterAnn(val name: String)
interface Generic<Z>
fun <<!MISPLACED_TYPE_PARAMETER_CONSTRAINTS!>@TypeParameterAnn("T") T: Any<!>> whereClauseWithAnnotation() where <!ANNOTATION_IN_WHERE_CLAUSE_ERROR!>@TypeParameterAnn("Prohibit me!!!")<!> T : Generic<String> {
}
class Foo<<!MISPLACED_TYPE_PARAMETER_CONSTRAINTS!>@TypeParameterAnn("T") T: Any<!>> () where <!ANNOTATION_IN_WHERE_CLAUSE_ERROR!>@TypeParameterAnn("Prohibit me!!!")<!> T : Generic<String> {
}