f3da26946b
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
22 lines
635 B
Kotlin
Vendored
22 lines
635 B
Kotlin
Vendored
// LANGUAGE: -UseConsistentRulesForPrivateConstructorsOfSealedClasses
|
|
// ISSUE: KT-44866, KT-49729
|
|
|
|
// FILE: base.kt
|
|
sealed class SealedBase(x: Int) {
|
|
private constructor(y: String) : this(y.length)
|
|
|
|
class SealedNested : SealedBase("nested")
|
|
}
|
|
class SealedOuter : <!INVISIBLE_REFERENCE!>SealedBase<!>("outer")
|
|
|
|
abstract class RegularBase(x: Int) {
|
|
private constructor(y: String) : this(y.length)
|
|
|
|
class RegularNested : RegularBase("nested")
|
|
}
|
|
class RegularOuter : <!INVISIBLE_REFERENCE!>RegularBase<!>("outer")
|
|
|
|
// FILE: derived.kt
|
|
|
|
class SealedOuterInDifferentFile : <!INVISIBLE_REFERENCE!>SealedBase<!>("other file")
|