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:
Svetlana Isakova
2012-04-04 14:23:04 +04:00
parent 0f20d4a6e2
commit 2577683ce8
2 changed files with 28 additions and 0 deletions
@@ -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"
}