[FIR] Add BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER diagnostic
This commit is contained in:
+6
-6
@@ -3,13 +3,13 @@ interface I2
|
||||
open class C
|
||||
|
||||
interface A1<K, V> where V : K, V : K
|
||||
interface A2<K, V, W> where W : K, W : V
|
||||
interface A3<K, V> where V : I1, V : K, V : I2
|
||||
interface A4<K, V> where K : I1, K : I2, K : C, K : V, V : I2, V : I1
|
||||
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 : V {
|
||||
fun <T> f3() where T : K, T : V {}
|
||||
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, W> f3() where W : K, W : V, W : Any {}
|
||||
fun <K, V, <!BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER!>W<!>> f3() where W : K, W : V, W : Any {}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
class Foo<T : Cloneable> where T : Comparable<T> {
|
||||
fun <U : Cloneable> foo(u: U): U where U: Comparable<U> {
|
||||
fun <T: Any> bar() where T: U {}
|
||||
fun <<!BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER!>T: Any<!>> bar() where T: U {}
|
||||
return u
|
||||
}
|
||||
|
||||
@@ -10,4 +10,4 @@ class Foo<T : Cloneable> where T : Comparable<T> {
|
||||
|
||||
class Bar<T : Cloneable, U> where U: Comparable<T> {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user