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:
@@ -1,7 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNREACHABLE_CODE
|
||||
open class B<T>(x: T, y: T) {
|
||||
constructor(x: T): this(x, x) {}
|
||||
constructor(): this(null) {}
|
||||
constructor(): this(null!!, null!!) {}
|
||||
}
|
||||
|
||||
class A0 : B<String?> {
|
||||
@@ -16,3 +16,6 @@ class A1<R> : B<R> {
|
||||
constructor(x: R, y: R): super(x, y) {}
|
||||
}
|
||||
|
||||
class A2<R> {
|
||||
constructor(t: R, i: Int) : <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>(<!TYPE_MISMATCH!>i<!>, 1) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user