[FIR] Refactor upper bound validation with better source element info
Attach source information to each argument of the type before expanding to preserve information during validation. This allows errors to be reported on the original argument during nested type alias expansion. ^KT-50798 Fixed ^KT-50703 Fixed
This commit is contained in:
+3
-3
@@ -27,11 +27,11 @@ typealias A<A> = MapLike<A, Int>
|
||||
typealias A2<B> = Foo<MapLike<B, Int>>
|
||||
typealias A3<C> = ListLike<List<C>>
|
||||
|
||||
fun main1(x: <!UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION!>A<Int?><!>) {}
|
||||
fun main2(x: A2<Int?>) {}
|
||||
fun main1(x: A<<!UPPER_BOUND_VIOLATED!>Int?<!>>) {}
|
||||
fun main2(x: A2<<!UPPER_BOUND_VIOLATED!>Int?<!>>) {}
|
||||
fun main3(x: <!UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION!>A3<Int?><!>) {}
|
||||
fun main3() {
|
||||
val x = <!UPPER_BOUND_VIOLATED!>A3<Int?>()<!> // TODO: support reporting errors on typealias constructor calls
|
||||
val x2 = <!UPPER_BOUND_VIOLATED!>A<Int?>()<!> // TODO: support reporting errors on typealias constructor calls
|
||||
val x2 = A<<!UPPER_BOUND_VIOLATED!>Int?<!>>() // TODO: support reporting errors on typealias constructor calls
|
||||
val y: <!UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION!>A3<Int?><!> = <!UPPER_BOUND_VIOLATED!>A3<Int?>()<!>
|
||||
}
|
||||
|
||||
+3
-3
@@ -27,11 +27,11 @@ typealias A<A> = MapLike<A, Int>
|
||||
typealias A2<B> = Foo<MapLike<B, Int>>
|
||||
typealias A3<C> = ListLike<List<C>>
|
||||
|
||||
fun main1(x: <!UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION!>A<Int?><!>) {}
|
||||
fun main2(x: A2<Int?>) {}
|
||||
fun main1(x: A<<!UPPER_BOUND_VIOLATED!>Int?<!>>) {}
|
||||
fun main2(x: A2<<!UPPER_BOUND_VIOLATED!>Int?<!>>) {}
|
||||
fun main3(x: <!UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION!>A3<Int?><!>) {}
|
||||
fun main3() {
|
||||
val x = <!UPPER_BOUND_VIOLATED!>A3<Int?>()<!>
|
||||
val x2 = <!UPPER_BOUND_VIOLATED!>A<Int?>()<!>
|
||||
val x2 = A<<!UPPER_BOUND_VIOLATED!>Int?<!>>()
|
||||
val y: <!UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION!>A3<Int?><!> = <!UPPER_BOUND_VIOLATED!>A3<Int?>()<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user