[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
This commit is contained in:
committed by
Space Team
parent
6c6525ecde
commit
f3da26946b
+3
-3
@@ -7,15 +7,15 @@ sealed class SealedBase(x: Int) {
|
||||
|
||||
class SealedNested : SealedBase("nested")
|
||||
}
|
||||
class SealedOuter : SealedBase(<!ARGUMENT_TYPE_MISMATCH!>"outer"<!>)
|
||||
class SealedOuter : <!INVISIBLE_REFERENCE!>SealedBase<!>("outer")
|
||||
|
||||
abstract class RegularBase(x: Int) {
|
||||
private constructor(y: String) : this(y.length)
|
||||
|
||||
class RegularNested : RegularBase("nested")
|
||||
}
|
||||
class RegularOuter : RegularBase(<!ARGUMENT_TYPE_MISMATCH!>"outer"<!>)
|
||||
class RegularOuter : <!INVISIBLE_REFERENCE!>RegularBase<!>("outer")
|
||||
|
||||
// FILE: derived.kt
|
||||
|
||||
class SealedOuterInDifferentFile : SealedBase(<!ARGUMENT_TYPE_MISMATCH!>"other file"<!>)
|
||||
class SealedOuterInDifferentFile : <!INVISIBLE_REFERENCE!>SealedBase<!>("other file")
|
||||
|
||||
+3
-3
@@ -7,15 +7,15 @@ sealed class SealedBase(x: Int) {
|
||||
|
||||
class SealedNested : SealedBase("nested")
|
||||
}
|
||||
class SealedOuter : SealedBase(<!ARGUMENT_TYPE_MISMATCH!>"outer"<!>)
|
||||
class SealedOuter : <!INVISIBLE_REFERENCE!>SealedBase<!>("outer")
|
||||
|
||||
abstract class RegularBase(x: Int) {
|
||||
private constructor(y: String) : this(y.length)
|
||||
|
||||
class RegularNested : RegularBase("nested")
|
||||
}
|
||||
class RegularOuter : RegularBase(<!ARGUMENT_TYPE_MISMATCH!>"outer"<!>)
|
||||
class RegularOuter : <!INVISIBLE_REFERENCE!>RegularBase<!>("outer")
|
||||
|
||||
// FILE: derived.kt
|
||||
|
||||
class SealedOuterInDifferentFile : SealedBase(<!ARGUMENT_TYPE_MISMATCH!>"other file"<!>)
|
||||
class SealedOuterInDifferentFile : <!INVISIBLE_REFERENCE!>SealedBase<!>("other file")
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ sealed class Case3 private constructor(val x: Int) {
|
||||
class Inheritor2 : Case3("Hello")
|
||||
}
|
||||
|
||||
class Case3Inheritor3 : Case3(<!ARGUMENT_TYPE_MISMATCH!>20<!>) // should be an error in 1.8
|
||||
class Case3Inheritor3 : <!INVISIBLE_REFERENCE!>Case3<!>(20) // should be an error in 1.8
|
||||
|
||||
sealed class Case4 {
|
||||
protected constructor(x: Int)
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ sealed class Case3 private constructor(val x: Int) {
|
||||
class Inheritor2 : Case3("Hello")
|
||||
}
|
||||
|
||||
class Case3Inheritor3 : Case3(<!ARGUMENT_TYPE_MISMATCH!>20<!>)
|
||||
class Case3Inheritor3 : <!INVISIBLE_REFERENCE!>Case3<!>(20)
|
||||
|
||||
sealed class Case4 {
|
||||
protected constructor(x: Int)
|
||||
|
||||
Reference in New Issue
Block a user