Disallow extension properties with backing fields
#KT-1682 Fixed
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
class A { }
|
||||
class B { }
|
||||
|
||||
public val A.prop: Int = 0;
|
||||
public val B.prop: String = "1111";
|
||||
public val prop: Double = 0.1;
|
||||
|
||||
public fun doTest() : String {
|
||||
if (A().prop != 0) return "fail1"
|
||||
if (B().prop != "1111") return "fail2"
|
||||
if (prop != 0.1) return "fail3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
return doTest()
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
class A { }
|
||||
class B { }
|
||||
|
||||
class Test {
|
||||
|
||||
public val A.prop: Int = 0;
|
||||
public val B.prop: String = "1111";
|
||||
public val prop: Double = 0.1;
|
||||
|
||||
public fun doTest() : String {
|
||||
if (A().prop != 0) return "fail1"
|
||||
if (B().prop != "1111") return "fail2"
|
||||
if (prop != 0.1) return "fail3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun box() : String {
|
||||
return Test().doTest()
|
||||
}
|
||||
Reference in New Issue
Block a user