[FIR] Add NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER check

This commit is contained in:
Andrey Zinovyev
2021-04-11 16:18:07 +00:00
committed by Space
parent ea22f4b681
commit 47407c4445
20 changed files with 373 additions and 16 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ class Test1<T>()
where
T : A,
T : B,
B : T // error
<error descr="[NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER] B does not refer to a type parameter of Test1">B</error> : T // error
{
fun test(t : T) {
@@ -48,7 +48,7 @@ fun <T> test2(t : T)
where
T : A,
T : B,
B : T
<error descr="[NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER] B does not refer to a type parameter of test2">B</error> : T
{
<error descr="[TYPE_PARAMETER_ON_LHS_OF_DOT] Type parameter 'T' cannot have or inherit a companion object, so it cannot be on the left hand side of dot">T</error>.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: foo">foo</error>()
<error descr="[TYPE_PARAMETER_ON_LHS_OF_DOT] Type parameter 'T' cannot have or inherit a companion object, so it cannot be on the left hand side of dot">T</error>.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: bar">bar</error>()