Refine type arguments resolution and rendering
In case of type constructors captured parameters from outer classes #KT-5510 Fixed #KT-3112 Fixed #KT-6325 Fixed #KT-408 Fixed #KT-6337 Fixed
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
class Outer<T> {
|
||||
inner class Inner<R> {
|
||||
fun <S> newInner(): Inner<S> = Inner()
|
||||
//type mismatch
|
||||
fun <U, S> newOuterInner(): Outer<U>.Inner<S> = Outer<U>().Inner<S>()
|
||||
//^ U here is not analyzed
|
||||
fun foo(t: T, r: R) {}
|
||||
}
|
||||
}
|
||||
|
||||
fun test0() {
|
||||
val inner: Outer<Int>.Inner<String> = Outer<Int>().Inner<String>()
|
||||
Outer<Int>().Inner<String>().foo(1, "") // type mismatch on second argument
|
||||
}
|
||||
|
||||
|
||||
fun test1() {
|
||||
Outer<Int>().Inner<String>().newOuterInner<Double, Boolean>().foo(1.0, true) // type mismatch on 1.0
|
||||
}
|
||||
Reference in New Issue
Block a user