Change logic of constructor delegation call resolution
- If class has type arguments (A<T1,..>) then resolve it's delegation call to `this` as for expression A<T1, ..>() like type arguments are explicitly specified. - Same logic works for `super` delegation calls. - It could be just enough to substitute all candidates before resolve but diagnostic messages looks more correct when substitution is performed within CandidateResolver.performResolutionForCandidateCall because it works the same way as when resolving A<T1, ..>(). #KT-6992 Fixed #KT-6993 Fixed #KT-6994 Fixed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
open class B<X, Y : X> {
|
||||
constructor(x: X, y: Y) {}
|
||||
constructor(x: X, s: String) {}
|
||||
constructor(y: Y, i: Int) : this(y, "") {}
|
||||
}
|
||||
|
||||
class A<T1, T2 : T1> : B<T1, T2> {
|
||||
constructor(x: T1, y: T2): super(x, y) {}
|
||||
constructor(x: T2, y: T2, z: String): super(x, y) {}
|
||||
|
||||
constructor(x: T2, z: String, z1: String): super(x, "") {}
|
||||
constructor(x: T2, z: String, z1: String, z2: String): super(x, 1) {}
|
||||
constructor(x: T1, z: String, z1: String, z2: String, z3: String): super(x, "") {}
|
||||
constructor(x: T1, z: String, z1: String, z2: String, z3: String, z4: String): <!NONE_APPLICABLE!>super<!>(x, 1) {}
|
||||
}
|
||||
Reference in New Issue
Block a user