Files
kotlin-fork/compiler/testData/diagnostics/tests/scopes/protectedVisibility/constructors.fir.kt
T
Dmitriy Novozhilov f3da26946b [FIR] Change priority of K2_VISIBILITY_ERROR CandidateApplicability
In K1 analogue of `K2_VISIBILITY_ERROR` is `K1_RUNTIME_ERROR`, so
  candidates with `K2_VISIBILITY_ERROR` should win over innaplicable
  candidates with `INAPPLICABLE`, `INAPPLICABLE_ARGUMENTS_MAPPING_ERROR`
  or `INAPPLICABLE_WRONG_RECEIVER` applicability

This is needed to allow resolution to invisible symbols (and later
  suppress error with `@Suppress("INVISIBLE_SYMBOL", "INVISIBLE_REFERENCE")`

^KT-55026 Fixed
^KT-55234
2022-12-09 12:02:05 +00:00

23 lines
451 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
open class A protected constructor(x: Int) {
protected constructor() : this(1)
protected constructor(x: String) : this(2)
public constructor(x: Double) : this(3)
}
fun foo() {
<!NONE_APPLICABLE!>A<!>()
A(1.0)
}
class B1 : A(1) {}
class B2 : A() {}
class B3 : A("") {}
class B4 : A {
constructor() : super(1)
constructor(x: Int) : super()
constructor(x: Int, y: Int) : super("")
}