[FIR] Add REPEATED_BOUND, CONFLICTING_UPPER_BOUNDS diagnostics

This commit is contained in:
Andrey Zinovyev
2021-04-09 07:38:39 +00:00
committed by Space
parent 81d4c19d8b
commit 37055c5a09
20 changed files with 132 additions and 94 deletions
@@ -6,18 +6,18 @@ interface B
interface D<T>
interface IncorrectF<T : D<A>> where T : D<B>
interface IncorrectF<T : D<A>> where T : <!REPEATED_BOUND!>D<B><!>
interface CorrectF<T> where T : D<A>, T : D<B>
interface CorrectF<T> where T : D<A>, T : <!REPEATED_BOUND!>D<B><!>
interface G<T>
interface IncorrectH<T : G<D<A>>> where T : G<D<T>>
interface IncorrectH<T : G<D<A>>> where T : <!REPEATED_BOUND!>G<D<T>><!>
interface CorrectH<T> where T : G<D<A>>, T : G<D<B>>
interface CorrectH<T> where T : G<D<A>>, T : <!REPEATED_BOUND!>G<D<B>><!>
interface incorrectJ<T: G<D<T>>> where T : G<D<T?>>
interface incorrectJ<T: G<D<T>>> where T : <!REPEATED_BOUND!>G<D<T?>><!>
interface correctJ<T> where T : G<D<T>>, T : G<D<T?>>
interface correctJ<T> where T : G<D<T>>, T : <!REPEATED_BOUND!>G<D<T?>><!>
fun <T> bar() where T : D<A>, T : D<B> {}
fun <T> bar() where T : D<A>, T : <!REPEATED_BOUND!>D<B><!> {}
@@ -1,15 +0,0 @@
interface I1
interface I2
open class C
interface A1<K, V> where V : K, V : K
interface A2<K, V, W> where W : K, W : <!BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER!>V<!>
interface A3<K, <!BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER!>V<!>> where V : I1, V : K, V : I2
interface A4<<!BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER!>K<!>, V> where K : I1, K : I2, K : C, K : V, V : I2, V : I1
fun <K, V> f1() where V : K, V : K {}
fun <K, V, W> f2() where W : K, W : <!BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER!>V<!> {
fun <T> f3() where T : K, T : <!BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER!>V<!> {}
fun <T> f4() where T : K, T : K {}
}
fun <K, V, <!BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER!>W<!>> f3() where W : K, W : V, W : Any {}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface I1
interface I2
open class C