[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
+2
-16
@@ -1,17 +1,3 @@
|
|||||||
KtErrorCallInfo:
|
KtErrorCallInfo:
|
||||||
candidateCalls = [
|
candidateCalls = []
|
||||||
KtSimpleFunctionCall:
|
diagnostic = ERROR<UNRESOLVED_REFERENCE: Unresolved reference: Obj>
|
||||||
isImplicitInvoke = false
|
|
||||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
|
||||||
dispatchReceiver = null
|
|
||||||
extensionReceiver = null
|
|
||||||
signature = KtFunctionLikeSignature:
|
|
||||||
receiverType = null
|
|
||||||
returnType = Obj
|
|
||||||
symbol = <constructor>(): Obj
|
|
||||||
valueParameters = []
|
|
||||||
callableIdIfNonLocal = null
|
|
||||||
typeArgumentsMapping = {}
|
|
||||||
argumentMapping = {}
|
|
||||||
]
|
|
||||||
diagnostic = ERROR<INVISIBLE_REFERENCE: Symbol constructor(): Obj is invisible>
|
|
||||||
|
|||||||
-1
@@ -1 +0,0 @@
|
|||||||
NO_CANDIDATES
|
|
||||||
+1
-16
@@ -1,16 +1 @@
|
|||||||
KtInapplicableCallCandidateInfo:
|
NO_CANDIDATES
|
||||||
diagnostic = ERROR<INVISIBLE_REFERENCE: Symbol constructor(): Obj is invisible>
|
|
||||||
candidate = KtSimpleFunctionCall:
|
|
||||||
isImplicitInvoke = false
|
|
||||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
|
||||||
dispatchReceiver = null
|
|
||||||
extensionReceiver = null
|
|
||||||
signature = KtFunctionLikeSignature:
|
|
||||||
receiverType = null
|
|
||||||
returnType = Obj
|
|
||||||
symbol = <constructor>(): Obj
|
|
||||||
valueParameters = []
|
|
||||||
callableIdIfNonLocal = null
|
|
||||||
typeArgumentsMapping = {}
|
|
||||||
argumentMapping = {}
|
|
||||||
isInBestCandidates = true
|
|
||||||
|
|||||||
+2
-2
@@ -12,7 +12,7 @@ FILE: singletonConstructors.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final fun foo(): R|kotlin/Unit| {
|
public final fun foo(): R|kotlin/Unit| {
|
||||||
<HIDDEN: /A.Comp.Comp is invisible>#()
|
<HIDDEN: /A.Comp.Comp is deprecated with DeprecationLevel.HIDDEN>#()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ FILE: singletonConstructors.kt
|
|||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
private final val x: R|B| = <HIDDEN: /B.B is invisible>#()
|
private final val x: R|B| = <HIDDEN: /B.B is deprecated with DeprecationLevel.HIDDEN>#()
|
||||||
private get(): R|B|
|
private get(): R|B|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -2,12 +2,12 @@ class A {
|
|||||||
companion object Comp {}
|
companion object Comp {}
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
<!INVISIBLE_REFERENCE!>Comp<!>()
|
<!UNRESOLVED_REFERENCE!>Comp<!>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object B {
|
object B {
|
||||||
private val x = <!INVISIBLE_REFERENCE!>B<!>()
|
private val x = <!UNRESOLVED_REFERENCE!>B<!>()
|
||||||
}
|
}
|
||||||
|
|
||||||
class D {
|
class D {
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ internal object CheckVisibility : CheckerStage() {
|
|||||||
val visibilityChecker = callInfo.session.visibilityChecker
|
val visibilityChecker = callInfo.session.visibilityChecker
|
||||||
val symbol = candidate.symbol
|
val symbol = candidate.symbol
|
||||||
val declaration = symbol.fir
|
val declaration = symbol.fir
|
||||||
if (declaration is FirMemberDeclaration) {
|
if (declaration is FirMemberDeclaration && declaration !is FirConstructor) {
|
||||||
if (!visibilityChecker.isVisible(declaration, candidate)) {
|
if (!visibilityChecker.isVisible(declaration, candidate)) {
|
||||||
sink.yieldDiagnostic(VisibilityError)
|
sink.yieldDiagnostic(VisibilityError)
|
||||||
return
|
return
|
||||||
@@ -538,13 +538,16 @@ internal object CheckVisibility : CheckerStage() {
|
|||||||
|
|
||||||
if (classSymbol is FirRegularClassSymbol) {
|
if (classSymbol is FirRegularClassSymbol) {
|
||||||
if (classSymbol.fir.classKind.isSingleton) {
|
if (classSymbol.fir.classKind.isSingleton) {
|
||||||
sink.yieldDiagnostic(VisibilityError)
|
sink.yieldDiagnostic(HiddenCandidate)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!visibilityChecker.isVisible(
|
val visible = visibilityChecker.isVisible(
|
||||||
declaration, candidate.callInfo, dispatchReceiverValue = null, importedQualifierForStatic = null
|
declaration,
|
||||||
)
|
candidate.callInfo,
|
||||||
) {
|
dispatchReceiverValue = null,
|
||||||
|
importedQualifierForStatic = null
|
||||||
|
)
|
||||||
|
if (!visible) {
|
||||||
sink.yieldDiagnostic(VisibilityError)
|
sink.yieldDiagnostic(VisibilityError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -18,11 +18,6 @@ enum class CandidateApplicability {
|
|||||||
*/
|
*/
|
||||||
HIDDEN,
|
HIDDEN,
|
||||||
|
|
||||||
/**
|
|
||||||
* Candidate isn't visible. Provokes INVISIBLE_REFERENCE.
|
|
||||||
*/
|
|
||||||
K2_VISIBILITY_ERROR,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Candidate could be successful but requires an unsupported feature.
|
* Candidate could be successful but requires an unsupported feature.
|
||||||
* Reported for references to local variables in K2.
|
* Reported for references to local variables in K2.
|
||||||
@@ -62,6 +57,11 @@ enum class CandidateApplicability {
|
|||||||
*/
|
*/
|
||||||
K1_RUNTIME_ERROR,
|
K1_RUNTIME_ERROR,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Candidate isn't visible. Provokes INVISIBLE_REFERENCE.
|
||||||
|
*/
|
||||||
|
K2_VISIBILITY_ERROR,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Candidate could be successful but receiver (or argument?) nullability doesn't match
|
* Candidate could be successful but receiver (or argument?) nullability doesn't match
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
// TARGET_BACKEND: JVM_IR
|
// TARGET_BACKEND: JVM_IR
|
||||||
// IGNORE_BACKEND_K2: JVM_IR
|
|
||||||
// FIR_STATUS: KT-55026
|
|
||||||
// ISSUE: KT-55026
|
// ISSUE: KT-55026
|
||||||
|
|
||||||
// MODULE: lib
|
// MODULE: lib
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
fun test() {
|
fun test() {
|
||||||
<!NO_VALUE_FOR_PARAMETER!>Double()<!>
|
<!INVISIBLE_REFERENCE!>Double<!>()
|
||||||
<!NO_VALUE_FOR_PARAMETER!>Float()<!>
|
<!INVISIBLE_REFERENCE!>Float<!>()
|
||||||
<!NO_VALUE_FOR_PARAMETER!>Long()<!>
|
<!INVISIBLE_REFERENCE!>Long<!>()
|
||||||
<!NO_VALUE_FOR_PARAMETER!>Int()<!>
|
<!INVISIBLE_REFERENCE!>Int<!>()
|
||||||
<!NO_VALUE_FOR_PARAMETER!>Short()<!>
|
<!INVISIBLE_REFERENCE!>Short<!>()
|
||||||
<!NO_VALUE_FOR_PARAMETER!>Byte()<!>
|
<!INVISIBLE_REFERENCE!>Byte<!>()
|
||||||
<!INVISIBLE_REFERENCE!>Char<!>()
|
<!INVISIBLE_REFERENCE!>Char<!>()
|
||||||
<!NO_VALUE_FOR_PARAMETER!>Boolean()<!>
|
<!INVISIBLE_REFERENCE!>Boolean<!>()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ class IllegalVersion()
|
|||||||
@<!INVISIBLE_REFERENCE, INVISIBLE_REFERENCE!>RequireKotlin<!>("1.2")
|
@<!INVISIBLE_REFERENCE, INVISIBLE_REFERENCE!>RequireKotlin<!>("1.2")
|
||||||
class LegalMinimum()
|
class LegalMinimum()
|
||||||
|
|
||||||
@<!INVISIBLE_REFERENCE, INVISIBLE_REFERENCE!>RequireKotlin<!>("1.2", versionKind = <!INVISIBLE_REFERENCE!>RequireKotlinVersionKind<!>.<!INVISIBLE_REFERENCE!>COMPILER_VERSION<!>, message = "Requires newer compiler version to be inlined correctly.")
|
@<!INVISIBLE_REFERENCE, INVISIBLE_REFERENCE!>RequireKotlin<!>("1.2", versionKind = <!NO_COMPANION_OBJECT!>RequireKotlinVersionKind<!>.<!INVISIBLE_REFERENCE!>COMPILER_VERSION<!>, message = "Requires newer compiler version to be inlined correctly.")
|
||||||
class LegalStdLib()
|
class LegalStdLib()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||||
|
// FIR_DIFFERENCE: KT-55234
|
||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
package k
|
package k
|
||||||
|
|
||||||
@@ -26,17 +27,17 @@ import k.two
|
|||||||
import k.all
|
import k.all
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
<!NONE_APPLICABLE!>zero<!>()
|
<!INVISIBLE_REFERENCE!>zero<!>()
|
||||||
<!NONE_APPLICABLE!>zero<!>(1)
|
<!INVISIBLE_REFERENCE!>zero<!>(1)
|
||||||
<!NONE_APPLICABLE!>zero<!>("")
|
<!INVISIBLE_REFERENCE!>zero<!>("")
|
||||||
|
|
||||||
one()
|
one()
|
||||||
one(<!TOO_MANY_ARGUMENTS!>1<!>)
|
<!INVISIBLE_REFERENCE!>one<!>(1)
|
||||||
one(<!TOO_MANY_ARGUMENTS!>""<!>)
|
<!INVISIBLE_REFERENCE!>one<!>("")
|
||||||
|
|
||||||
two()
|
two()
|
||||||
two(1)
|
two(1)
|
||||||
two(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
|
<!INVISIBLE_REFERENCE!>two<!>("")
|
||||||
|
|
||||||
all()
|
all()
|
||||||
all(1)
|
all(1)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||||
|
// FIR_DIFFERENCE: KT-55234
|
||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
package k
|
package k
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ fun x(f : Foo) {
|
|||||||
|
|
||||||
f.<!FUNCTION_EXPECTED!>a<!>()
|
f.<!FUNCTION_EXPECTED!>a<!>()
|
||||||
<!UNRESOLVED_REFERENCE!>c<!>()
|
<!UNRESOLVED_REFERENCE!>c<!>()
|
||||||
<!INVISIBLE_REFERENCE!>R<!>()
|
<!UNRESOLVED_REFERENCE!>R<!>()
|
||||||
}
|
}
|
||||||
|
|
||||||
object R {}
|
object R {}
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ import a.MyJavaClass
|
|||||||
|
|
||||||
val <!EXPOSED_PROPERTY_TYPE!>mc1<!> = <!INVISIBLE_REFERENCE!>MyJavaClass<!>()
|
val <!EXPOSED_PROPERTY_TYPE!>mc1<!> = <!INVISIBLE_REFERENCE!>MyJavaClass<!>()
|
||||||
|
|
||||||
val x = <!INVISIBLE_REFERENCE!>MyJavaClass<!>.<!INVISIBLE_REFERENCE!>staticMethod<!>()
|
val x = <!NO_COMPANION_OBJECT!>MyJavaClass<!>.<!INVISIBLE_REFERENCE!>staticMethod<!>()
|
||||||
val y = MyJavaClass.<!INVISIBLE_REFERENCE!>NestedClass<!>.<!INVISIBLE_REFERENCE!>staticMethodOfNested<!>()
|
val y = MyJavaClass.<!NO_COMPANION_OBJECT!>NestedClass<!>.<!INVISIBLE_REFERENCE!>staticMethodOfNested<!>()
|
||||||
val <!EXPOSED_PROPERTY_TYPE!>z<!> = <!INVISIBLE_REFERENCE!>MyJavaClass<!>.<!INVISIBLE_REFERENCE!>NestedClass<!>()
|
val <!EXPOSED_PROPERTY_TYPE!>z<!> = <!NO_COMPANION_OBJECT!>MyJavaClass<!>.<!INVISIBLE_REFERENCE!>NestedClass<!>()
|
||||||
|
|
||||||
//FILE: c.kt
|
//FILE: c.kt
|
||||||
package a.c
|
package a.c
|
||||||
@@ -39,6 +39,6 @@ import a.MyJavaClass
|
|||||||
|
|
||||||
val <!EXPOSED_PROPERTY_TYPE!>mc1<!> = <!INVISIBLE_REFERENCE!>MyJavaClass<!>()
|
val <!EXPOSED_PROPERTY_TYPE!>mc1<!> = <!INVISIBLE_REFERENCE!>MyJavaClass<!>()
|
||||||
|
|
||||||
val x = <!INVISIBLE_REFERENCE!>MyJavaClass<!>.<!INVISIBLE_REFERENCE!>staticMethod<!>()
|
val x = <!NO_COMPANION_OBJECT!>MyJavaClass<!>.<!INVISIBLE_REFERENCE!>staticMethod<!>()
|
||||||
val y = MyJavaClass.<!INVISIBLE_REFERENCE!>NestedClass<!>.<!INVISIBLE_REFERENCE!>staticMethodOfNested<!>()
|
val y = MyJavaClass.<!NO_COMPANION_OBJECT!>NestedClass<!>.<!INVISIBLE_REFERENCE!>staticMethodOfNested<!>()
|
||||||
val <!EXPOSED_PROPERTY_TYPE!>z<!> = <!INVISIBLE_REFERENCE!>MyJavaClass<!>.<!INVISIBLE_REFERENCE!>NestedClass<!>()
|
val <!EXPOSED_PROPERTY_TYPE!>z<!> = <!NO_COMPANION_OBJECT!>MyJavaClass<!>.<!INVISIBLE_REFERENCE!>NestedClass<!>()
|
||||||
|
|||||||
+1
-1
@@ -14,5 +14,5 @@ public class Foo {
|
|||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
javaPackage.Foo.<!INVISIBLE_REFERENCE!>Bar<!>.<!INVISIBLE_REFERENCE!>doSmth<!>()
|
javaPackage.Foo.<!NO_COMPANION_OBJECT!>Bar<!>.<!INVISIBLE_REFERENCE!>doSmth<!>()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ fun test() {
|
|||||||
val interface_as_fun = <!RESOLUTION_TO_CLASSIFIER!>A<!>()
|
val interface_as_fun = <!RESOLUTION_TO_CLASSIFIER!>A<!>()
|
||||||
val interface_as_val = <!NO_COMPANION_OBJECT!>A<!>
|
val interface_as_val = <!NO_COMPANION_OBJECT!>A<!>
|
||||||
|
|
||||||
val object_as_fun = <!INVISIBLE_REFERENCE!>B<!>()
|
val object_as_fun = <!UNRESOLVED_REFERENCE!>B<!>()
|
||||||
val class_as_val = <!NO_COMPANION_OBJECT!>C<!>
|
val class_as_val = <!NO_COMPANION_OBJECT!>C<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -11,7 +11,7 @@ fun testX() {
|
|||||||
val interface_as_fun = X.<!RESOLUTION_TO_CLASSIFIER!>A<!>()
|
val interface_as_fun = X.<!RESOLUTION_TO_CLASSIFIER!>A<!>()
|
||||||
val interface_as_val = X.<!NO_COMPANION_OBJECT!>A<!>
|
val interface_as_val = X.<!NO_COMPANION_OBJECT!>A<!>
|
||||||
|
|
||||||
val object_as_fun = X.<!INVISIBLE_REFERENCE!>B<!>()
|
val object_as_fun = X.<!UNRESOLVED_REFERENCE!>B<!>()
|
||||||
val class_as_val = X.<!NO_COMPANION_OBJECT!>C<!>
|
val class_as_val = X.<!NO_COMPANION_OBJECT!>C<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ fun testY() {
|
|||||||
val interface_as_fun = Y.<!RESOLUTION_TO_CLASSIFIER!>A<!>()
|
val interface_as_fun = Y.<!RESOLUTION_TO_CLASSIFIER!>A<!>()
|
||||||
val interface_as_val = Y.<!NO_COMPANION_OBJECT!>A<!>
|
val interface_as_val = Y.<!NO_COMPANION_OBJECT!>A<!>
|
||||||
|
|
||||||
val object_as_fun = Y.<!INVISIBLE_REFERENCE!>B<!>()
|
val object_as_fun = Y.<!UNRESOLVED_REFERENCE!>B<!>()
|
||||||
val class_as_val = Y.<!NO_COMPANION_OBJECT!>C<!>
|
val class_as_val = Y.<!NO_COMPANION_OBJECT!>C<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ open class A protected constructor(x: Int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
<!NO_VALUE_FOR_PARAMETER!>A()<!>
|
<!NONE_APPLICABLE!>A<!>()
|
||||||
A(1.0)
|
A(1.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -7,15 +7,15 @@ sealed class SealedBase(x: Int) {
|
|||||||
|
|
||||||
class SealedNested : SealedBase("nested")
|
class SealedNested : SealedBase("nested")
|
||||||
}
|
}
|
||||||
class SealedOuter : SealedBase(<!ARGUMENT_TYPE_MISMATCH!>"outer"<!>)
|
class SealedOuter : <!INVISIBLE_REFERENCE!>SealedBase<!>("outer")
|
||||||
|
|
||||||
abstract class RegularBase(x: Int) {
|
abstract class RegularBase(x: Int) {
|
||||||
private constructor(y: String) : this(y.length)
|
private constructor(y: String) : this(y.length)
|
||||||
|
|
||||||
class RegularNested : RegularBase("nested")
|
class RegularNested : RegularBase("nested")
|
||||||
}
|
}
|
||||||
class RegularOuter : RegularBase(<!ARGUMENT_TYPE_MISMATCH!>"outer"<!>)
|
class RegularOuter : <!INVISIBLE_REFERENCE!>RegularBase<!>("outer")
|
||||||
|
|
||||||
// FILE: derived.kt
|
// 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 SealedNested : SealedBase("nested")
|
||||||
}
|
}
|
||||||
class SealedOuter : SealedBase(<!ARGUMENT_TYPE_MISMATCH!>"outer"<!>)
|
class SealedOuter : <!INVISIBLE_REFERENCE!>SealedBase<!>("outer")
|
||||||
|
|
||||||
abstract class RegularBase(x: Int) {
|
abstract class RegularBase(x: Int) {
|
||||||
private constructor(y: String) : this(y.length)
|
private constructor(y: String) : this(y.length)
|
||||||
|
|
||||||
class RegularNested : RegularBase("nested")
|
class RegularNested : RegularBase("nested")
|
||||||
}
|
}
|
||||||
class RegularOuter : RegularBase(<!ARGUMENT_TYPE_MISMATCH!>"outer"<!>)
|
class RegularOuter : <!INVISIBLE_REFERENCE!>RegularBase<!>("outer")
|
||||||
|
|
||||||
// FILE: derived.kt
|
// 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 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 {
|
sealed class Case4 {
|
||||||
protected constructor(x: Int)
|
protected constructor(x: Int)
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ sealed class Case3 private constructor(val x: Int) {
|
|||||||
class Inheritor2 : Case3("Hello")
|
class Inheritor2 : Case3("Hello")
|
||||||
}
|
}
|
||||||
|
|
||||||
class Case3Inheritor3 : Case3(<!ARGUMENT_TYPE_MISMATCH!>20<!>)
|
class Case3Inheritor3 : <!INVISIBLE_REFERENCE!>Case3<!>(20)
|
||||||
|
|
||||||
sealed class Case4 {
|
sealed class Case4 {
|
||||||
protected constructor(x: Int)
|
protected constructor(x: Int)
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ private typealias TA = <!INVISIBLE_REFERENCE!>C<!>
|
|||||||
private val test1: <!INVISIBLE_REFERENCE!>C<!> = <!INVISIBLE_REFERENCE!>C<!>()
|
private val test1: <!INVISIBLE_REFERENCE!>C<!> = <!INVISIBLE_REFERENCE!>C<!>()
|
||||||
private val test1co: <!INVISIBLE_REFERENCE!>C.Companion<!> = <!INITIALIZER_TYPE_MISMATCH, INVISIBLE_REFERENCE, NO_COMPANION_OBJECT!>C<!>
|
private val test1co: <!INVISIBLE_REFERENCE!>C.Companion<!> = <!INITIALIZER_TYPE_MISMATCH, INVISIBLE_REFERENCE, NO_COMPANION_OBJECT!>C<!>
|
||||||
|
|
||||||
private val test2: <!INVISIBLE_REFERENCE!>TA<!> = <!INITIALIZER_TYPE_MISMATCH, NO_VALUE_FOR_PARAMETER!>TA()<!>
|
private val test2: <!INVISIBLE_REFERENCE!>TA<!> = <!INVISIBLE_REFERENCE!>TA<!>()
|
||||||
private val test2co = <!INVISIBLE_REFERENCE!>TA<!>
|
private val test2co = <!INVISIBLE_REFERENCE!>TA<!>
|
||||||
|
|
||||||
// FILE: file2.kt
|
// FILE: file2.kt
|
||||||
private val test1: C = C()
|
private val test1: C = C()
|
||||||
private val test1co: C.Companion = <!INITIALIZER_TYPE_MISMATCH, NO_COMPANION_OBJECT!>C<!>
|
private val test1co: C.Companion = <!INITIALIZER_TYPE_MISMATCH, NO_COMPANION_OBJECT!>C<!>
|
||||||
|
|
||||||
private val test2: TA = <!INITIALIZER_TYPE_MISMATCH, NO_VALUE_FOR_PARAMETER!>TA()<!>
|
private val test2: TA = <!INVISIBLE_REFERENCE!>TA<!>()
|
||||||
private val test2co = TA
|
private val test2co = TA
|
||||||
|
|
||||||
private class <!PACKAGE_OR_CLASSIFIER_REDECLARATION!>C<!>
|
private class <!PACKAGE_OR_CLASSIFIER_REDECLARATION!>C<!>
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ typealias TO = AnObject
|
|||||||
val test6 = <!RESOLUTION_TO_CLASSIFIER!>TI<!>()
|
val test6 = <!RESOLUTION_TO_CLASSIFIER!>TI<!>()
|
||||||
val test6a = <!RESOLUTION_TO_CLASSIFIER!>Interface<!>()
|
val test6a = <!RESOLUTION_TO_CLASSIFIER!>Interface<!>()
|
||||||
|
|
||||||
val test7 = <!INVISIBLE_REFERENCE!>TO<!>()
|
val test7 = <!UNRESOLVED_REFERENCE!>TO<!>()
|
||||||
val test7a = <!INVISIBLE_REFERENCE!>AnObject<!>()
|
val test7a = <!UNRESOLVED_REFERENCE!>AnObject<!>()
|
||||||
|
|||||||
+6
-6
@@ -9,18 +9,18 @@ open class MyClass private constructor(val x: Int) {
|
|||||||
|
|
||||||
typealias MyAlias = MyClass
|
typealias MyAlias = MyClass
|
||||||
|
|
||||||
val test1 = MyAlias(<!ARGUMENT_TYPE_MISMATCH!>1<!>)
|
val test1 = <!NONE_APPLICABLE!>MyAlias<!>(1)
|
||||||
val test1a = MyClass(<!ARGUMENT_TYPE_MISMATCH!>1<!>)
|
val test1a = <!NONE_APPLICABLE!>MyClass<!>(1)
|
||||||
|
|
||||||
val test2 = MyAlias(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
|
val test2 = <!NONE_APPLICABLE!>MyAlias<!>("")
|
||||||
val test2a = MyClass(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
|
val test2a = <!NONE_APPLICABLE!>MyClass<!>("")
|
||||||
|
|
||||||
val test3 = MyAlias(1.0)
|
val test3 = MyAlias(1.0)
|
||||||
val test3a = MyClass(1.0)
|
val test3a = MyClass(1.0)
|
||||||
|
|
||||||
class MyDerived : MyClass(1.0) {
|
class MyDerived : MyClass(1.0) {
|
||||||
val test4 = <!NONE_APPLICABLE!>MyAlias<!>(1)
|
val test4 = <!INVISIBLE_REFERENCE!>MyAlias<!>(1)
|
||||||
val test4a = <!NONE_APPLICABLE!>MyClass<!>(1)
|
val test4a = <!INVISIBLE_REFERENCE!>MyClass<!>(1)
|
||||||
val test5 = MyAlias("")
|
val test5 = MyAlias("")
|
||||||
val test5a = MyClass("")
|
val test5a = MyClass("")
|
||||||
val test6 = MyAlias(1.0)
|
val test6 = MyAlias(1.0)
|
||||||
|
|||||||
Reference in New Issue
Block a user