KT-1717 Don't make member visibility inherit when it is not declared explicitly

#KT-1717 Fixed
This commit is contained in:
Svetlana Isakova
2012-04-03 19:12:29 +04:00
parent 5df7258708
commit 9b2eeb076e
45 changed files with 115 additions and 159 deletions
@@ -2,7 +2,7 @@ import java.util.ArrayList
public object SomeObject {
private val workerThread = object : Thread() {
override fun run() {
public override fun run() {
foo()
}
}
@@ -2,7 +2,7 @@ public object SomeClass {
var bug: Any = ""
private val workerThread = object : Thread() {
override fun run() {
public override fun run() {
try {
foo()
bug = "none"
@@ -1,6 +1,6 @@
public object RefreshQueue {
private val workerThread: Thread = Thread(object : Runnable {
override fun run() {
public override fun run() {
workerThread.isInterrupted()
}
});
@@ -7,9 +7,9 @@ public abstract class BaseClass() {
}
public class Subclass : BaseClass() {
override val kind : String = "Physical"
protected override val kind : String = "Physical"
override val kind2 : String = " kind2"
protected override val kind2 : String = " kind2"
}
fun box():String = if(Subclass().debug() == "Physical kind2") "OK" else "fail"
@@ -1,5 +1,5 @@
class MyRange1() : Range<Int> {
override fun contains(item: Int) = true
public override fun contains(item: Int) = true
}
class MyRange2() {
@@ -163,7 +163,7 @@ fun t11(var x: Int) : Int {
fun t12(x: Int) : Int {
var y = x
val runnable = object : Runnable {
override fun run () {
public override fun run () {
y = y + 1
}
}
@@ -95,11 +95,11 @@ fun LinkedList<Int>.sum(f : (Int, Int) -> Int) : Int {
}
fun <T> List<T>.backwards() : Iterable<T> = object : Iterable<T> {
override fun iterator() : jet.Iterator<T> =
public override fun iterator() : jet.Iterator<T> =
object : jet.Iterator<T> {
var current = size()
override fun next() : T = get(--current)
override val hasNext : Boolean get() = current > 0
public override fun next() : T = get(--current)
public override val hasNext : Boolean get() = current > 0
}
}
@@ -1,5 +1,5 @@
class Book(val name: String) : Comparable<Book> {
override fun compareTo(other: Book) = name.compareTo(other.name)
public override fun compareTo(other: Book) = name.compareTo(other.name)
}
fun box() = if(Book("239").compareTo(Book("932")) != 0) "OK" else "fail"
@@ -3,13 +3,13 @@ import java.util.*
fun box() : String {
val w = object : Comparator<String?> {
override fun compare(o1 : String?, o2 : String?) : Int {
public override fun compare(o1 : String?, o2 : String?) : Int {
val l1 : Int = o1?.length ?: 0
val l2 = o2?.length ?: 0
return l1 - l2
}
override fun equals(obj: Any?): Boolean = obj === this
public override fun equals(obj: Any?): Boolean = obj === this
}
w.compare("aaa", "bbb")