tests for:
#KT-1248 Fixed Control visibility of overrides needed #KT-37 Fixed Typechecker doesn't complain about accessing non-public property
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
//KT-1248 Control visibility of overrides needed
|
||||||
|
package kt1248
|
||||||
|
|
||||||
|
trait ParseResult<out T> {
|
||||||
|
public val success : Boolean
|
||||||
|
public val value : T
|
||||||
|
}
|
||||||
|
|
||||||
|
class Success<T>(<!CANNOT_WEAKEN_ACCESS_PRIVILEGE!>internal<!> override val value : T) : ParseResult<T> {
|
||||||
|
<!CANNOT_WEAKEN_ACCESS_PRIVILEGE!>internal<!> override val success : Boolean = true
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
//KT-37 Typechecker doesn't complain about accessing non-public property
|
||||||
|
package kt37
|
||||||
|
|
||||||
|
class C() {
|
||||||
|
private var f: Int
|
||||||
|
|
||||||
|
{
|
||||||
|
f = 610
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val c = C()
|
||||||
|
if (c.<!UNRESOLVED_REFERENCE!>f<!> != 610) return "fail"
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user