Use known type substitutor if it exists
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ package boundsWithSubstitutors
|
||||
|
||||
class Pair<A, B>
|
||||
|
||||
abstract class C<T : B<<!UPPER_BOUND_VIOLATED!>Int<!>>, X : (B<<!UPPER_BOUND_VIOLATED!>Char<!>>) -> Pair<B<<!UPPER_BOUND_VIOLATED!>Any<!>>, B<A>>>() : B<<!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>Any<!>>() { // 2 errors
|
||||
abstract class C<T : B<<!UPPER_BOUND_VIOLATED!>Int<!>>, X : (B<<!UPPER_BOUND_VIOLATED!>Char<!>>) -> Pair<B<<!UPPER_BOUND_VIOLATED!>Any<!>>, B<A>>>() : B<<!UPPER_BOUND_VIOLATED!>Any<!>>() { // 2 errors
|
||||
val a = B<<!UPPER_BOUND_VIOLATED!>Char<!>>() // error
|
||||
|
||||
abstract val x : (B<<!UPPER_BOUND_VIOLATED!>Char<!>>) -> B<<!UPPER_BOUND_VIOLATED!>Any<!>>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
open class C<T : C<T>>
|
||||
class TestOK : C<TestOK>()
|
||||
class TestFail : C<<!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>C<<!UPPER_BOUND_VIOLATED!>TestFail<!>><!>>()
|
||||
class TestFail : C<<!UPPER_BOUND_VIOLATED!>C<<!UPPER_BOUND_VIOLATED!>TestFail<!>><!>>()
|
||||
|
||||
@@ -7,7 +7,7 @@ abstract class Wrapper<T: A>(protected val t: T)
|
||||
class MyWrapper(a: A): Wrapper<A>(a)
|
||||
|
||||
// This wrapper is not legal
|
||||
class TheirWrapper(e: E): Wrapper<<!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>E<!>>(e)
|
||||
class TheirWrapper(e: E): Wrapper<<!UPPER_BOUND_VIOLATED!>E<!>>(e)
|
||||
|
||||
data class Pair<out T>(val a: T, val b: T)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class E
|
||||
class MyWrapper(a: A): Wrapper<A>(a)
|
||||
|
||||
// This wrapper is not legal
|
||||
class TheirWrapper(e: E): Wrapper<<!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>E<!>>(e)
|
||||
class TheirWrapper(e: E): Wrapper<<!UPPER_BOUND_VIOLATED!>E<!>>(e)
|
||||
|
||||
data class Pair<out T>(val a: T, val b: T)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user