FIR: bail out early for override check if base candidate is private
This commit is contained in:
committed by
Mikhail Glukhikh
parent
09640d9d63
commit
a884555171
@@ -1,10 +1,11 @@
|
||||
class A(
|
||||
private val x: String,
|
||||
private var y: Double
|
||||
open class A(
|
||||
private val x: String,
|
||||
private var y: Double
|
||||
) {
|
||||
fun foo() {
|
||||
val r = {
|
||||
if (x != "abc") throw AssertionError("$x")
|
||||
if (y < 0.0) throw AssertionError("$y < 0.0")
|
||||
y = 0.0
|
||||
if (y != 0.0) throw AssertionError("$y")
|
||||
}
|
||||
@@ -12,7 +13,14 @@ class A(
|
||||
}
|
||||
}
|
||||
|
||||
class B(
|
||||
val x: String,
|
||||
y: Double
|
||||
) : A("abc", y)
|
||||
|
||||
fun box(): String {
|
||||
A("abc", 3.14).foo()
|
||||
return "OK"
|
||||
val b = B("OK", 0.42)
|
||||
b.foo()
|
||||
return b.x
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user