'quick' directory renamed to 'tests' which reflects its contents
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
namespace boundsWithSubstitutors {
|
||||
open class A<T>
|
||||
class B<X : A<X>>()
|
||||
|
||||
class C : A<C>
|
||||
|
||||
val a = B<C>()
|
||||
val a1 = B<<!UPPER_BOUND_VIOLATED!>Int<!>>()
|
||||
|
||||
class X<A, B : A>()
|
||||
|
||||
val b = X<Any, X<A<C>, C>>
|
||||
val b0 = X<Any, <!UPPER_BOUND_VIOLATED!>Any?<!>>
|
||||
val b1 = X<Any, X<A<C>, <!UPPER_BOUND_VIOLATED!>String<!>>>
|
||||
|
||||
}
|
||||
|
||||
open class A {}
|
||||
open class B<T : A>()
|
||||
|
||||
abstract class C<T : B<<!UPPER_BOUND_VIOLATED!>Int<!>>, X : fun (B<<!UPPER_BOUND_VIOLATED!>Char<!>>) : (B<<!UPPER_BOUND_VIOLATED!>Any<!>>, B<A>)>() : B<<!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>Any<!>>() { // 2 errors
|
||||
val a = B<<!UPPER_BOUND_VIOLATED!>Char<!>>() // error
|
||||
|
||||
abstract val x : fun (B<<!UPPER_BOUND_VIOLATED!>Char<!>>) : B<<!UPPER_BOUND_VIOLATED!>Any<!>>
|
||||
}
|
||||
|
||||
|
||||
fun test() {
|
||||
foo<<!UPPER_BOUND_VIOLATED!>Int?<!>>()
|
||||
foo<Int>()
|
||||
bar<Int?>()
|
||||
bar<Int>()
|
||||
bar<<!UPPER_BOUND_VIOLATED!>Double?<!>>()
|
||||
bar<<!UPPER_BOUND_VIOLATED!>Double<!>>()
|
||||
1.buzz<<!UPPER_BOUND_VIOLATED!>Double<!>>()
|
||||
}
|
||||
|
||||
fun foo<T : Any>() {}
|
||||
fun bar<T : Int?>() {}
|
||||
fun <T : <!FINAL_UPPER_BOUND!>Int<!>> Int.buzz() : Unit {}
|
||||
Reference in New Issue
Block a user