KT-6803 Subtyping breaks on star-projections for recursive generics
Star-projections have upper bounds of the form "parameter's bound where all parameter of the same class are substituted with their star-projections" #KT-6803 Fixed
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
trait A<R, T: A<R, T>> {
|
||||
fun r(): R
|
||||
fun t(): T
|
||||
}
|
||||
|
||||
fun testA(a: A<*, *>) {
|
||||
a.r().checkType { it : _<Any?> }
|
||||
a.t().checkType { it : _<A<*, *>> }
|
||||
}
|
||||
|
||||
trait B<R, T: B<List<R>, <!UPPER_BOUND_VIOLATED!>T<!>>> {
|
||||
fun r(): R
|
||||
fun t(): T
|
||||
}
|
||||
|
||||
fun testB(b: B<*, *>) {
|
||||
b.r().checkType { it : _<Any?> }
|
||||
b.t().checkType { it : _<B<List<*>, *>> }
|
||||
|
||||
b.t().r().size()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user