[FIR] KT-46483: Forbid annotations in where Clauses

Merge-request: KT-MR-7208
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
This commit is contained in:
Nikolay Lunyak
2022-09-28 13:38:18 +00:00
committed by Space
parent a20ce06102
commit f578381726
37 changed files with 462 additions and 20 deletions
+11
View File
@@ -0,0 +1,11 @@
@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_WARNING!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>TypeParameterAnn<!>("Prohibit me!!!")<!> T : Generic<String> {
}
class Foo<<!MISPLACED_TYPE_PARAMETER_CONSTRAINTS!>@TypeParameterAnn("T") T: Any<!>> () where <!ANNOTATION_IN_WHERE_CLAUSE_WARNING!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>TypeParameterAnn<!>("Prohibit me!!!")<!> T : Generic<String> {
}