Fix incorrect 'original' in property accessors
#KT-3930 Fixed
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
// Changed when traits were introduced. May not make sense any more
|
||||
|
||||
open class Base() {
|
||||
public var v : Int = 0
|
||||
}
|
||||
|
||||
open class Left() : Base() {}
|
||||
interface Right : Base {}
|
||||
|
||||
class D() : Left(), Right
|
||||
|
||||
fun vl(l : Left) : Int = l.v
|
||||
fun vr(r : Right) : Int = r.v
|
||||
|
||||
fun box() : String {
|
||||
val d = D()
|
||||
d.v = 42
|
||||
|
||||
if (d.v != 42) return "Fail #1"
|
||||
if (vl(d) != 42) return "Fail #2"
|
||||
if (vr(d) != 42) return "Fail #3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
public abstract class Foo {
|
||||
var isOpen = true
|
||||
private set
|
||||
}
|
||||
public class Bar: Foo() {
|
||||
inner class Baz {
|
||||
fun call() {
|
||||
val s = this@Bar
|
||||
s.isOpen
|
||||
}
|
||||
}
|
||||
}
|
||||
fun box(): String {
|
||||
Bar().Baz()
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
interface A {
|
||||
var bar: Boolean
|
||||
get() = false
|
||||
set(value) { throw AssertionError("Fail set") }
|
||||
}
|
||||
|
||||
interface B : A
|
||||
|
||||
interface C : A {
|
||||
override var bar: Boolean
|
||||
get() = true
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
interface D : B, C
|
||||
|
||||
class Impl : D
|
||||
|
||||
fun box(): String {
|
||||
Impl().bar = false
|
||||
if (!Impl().bar) return "Fail get"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
interface A {
|
||||
val str: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
interface B : A
|
||||
|
||||
class Impl : B
|
||||
|
||||
fun box() = Impl().str
|
||||
Reference in New Issue
Block a user