Do not report "inconsistent bounds" when there are repeated bounds
Also slightly refactor DeclarationsChecker#checkSupertypesForConsistency
This commit is contained in:
@@ -6,15 +6,15 @@ interface B
|
||||
|
||||
interface D<T>
|
||||
|
||||
interface IncorrectF<<!MISPLACED_TYPE_PARAMETER_CONSTRAINTS, INCONSISTENT_TYPE_PARAMETER_BOUNDS!>T : D<A><!>> where T : <!REPEATED_BOUND!>D<B><!>
|
||||
interface IncorrectF<<!MISPLACED_TYPE_PARAMETER_CONSTRAINTS!>T : D<A><!>> where T : <!REPEATED_BOUND!>D<B><!>
|
||||
|
||||
interface CorrectF<<!INCONSISTENT_TYPE_PARAMETER_BOUNDS!>T<!>> where T : D<A>, T : <!REPEATED_BOUND!>D<B><!>
|
||||
interface CorrectF<T> where T : D<A>, T : <!REPEATED_BOUND!>D<B><!>
|
||||
|
||||
interface G<T>
|
||||
|
||||
interface IncorrectH<<!MISPLACED_TYPE_PARAMETER_CONSTRAINTS, INCONSISTENT_TYPE_PARAMETER_BOUNDS!>T : G<D<A>><!>> where T : <!REPEATED_BOUND!>G<D<T>><!>
|
||||
interface IncorrectH<<!MISPLACED_TYPE_PARAMETER_CONSTRAINTS!>T : G<D<A>><!>> where T : <!REPEATED_BOUND!>G<D<T>><!>
|
||||
|
||||
interface CorrectH<<!INCONSISTENT_TYPE_PARAMETER_BOUNDS!>T<!>> where T : G<D<A>>, T : <!REPEATED_BOUND!>G<D<B>><!>
|
||||
interface CorrectH<T> where T : G<D<A>>, T : <!REPEATED_BOUND!>G<D<B>><!>
|
||||
|
||||
interface I<T : G<D<T>>> {
|
||||
fun <<!MISPLACED_TYPE_PARAMETER_CONSTRAINTS, INCONSISTENT_TYPE_PARAMETER_BOUNDS!>S : T?<!>> incorrectFoo() where S : G<D<S>>
|
||||
@@ -22,8 +22,8 @@ interface I<T : G<D<T>>> {
|
||||
fun <<!INCONSISTENT_TYPE_PARAMETER_BOUNDS!>S<!>> correctFoo() where S : T?, S : G<D<S>>
|
||||
}
|
||||
|
||||
interface incorrectJ<<!MISPLACED_TYPE_PARAMETER_CONSTRAINTS, INCONSISTENT_TYPE_PARAMETER_BOUNDS!>T: G<D<T>><!>> where T : <!REPEATED_BOUND!>G<D<T?>><!>
|
||||
interface incorrectJ<<!MISPLACED_TYPE_PARAMETER_CONSTRAINTS!>T: G<D<T>><!>> where T : <!REPEATED_BOUND!>G<D<T?>><!>
|
||||
|
||||
interface correctJ<<!INCONSISTENT_TYPE_PARAMETER_BOUNDS!>T<!>> where T : G<D<T>>, T : <!REPEATED_BOUND!>G<D<T?>><!>
|
||||
interface correctJ<T> where T : G<D<T>>, T : <!REPEATED_BOUND!>G<D<T?>><!>
|
||||
|
||||
fun <<!INCONSISTENT_TYPE_PARAMETER_BOUNDS!>T<!>> bar() where T : D<A>, T : <!REPEATED_BOUND!>D<B><!> {}
|
||||
fun <T> bar() where T : D<A>, T : <!REPEATED_BOUND!>D<B><!> {}
|
||||
|
||||
Reference in New Issue
Block a user