Add toString() to Any, fix all tests
#KT-4517 Fixed
This commit is contained in:
@@ -5,7 +5,7 @@ import kotlin.test.*
|
||||
import org.junit.Test
|
||||
|
||||
class Item(val name: String, val rating: Int): Comparable<Item> {
|
||||
fun toString() = "Item($name, $rating)"
|
||||
override fun toString() = "Item($name, $rating)"
|
||||
|
||||
public override fun compareTo(other: Item): Int {
|
||||
return compareBy(this, other, { rating }, { name })
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.junit.Test as test
|
||||
|
||||
class ListTest {
|
||||
|
||||
test fun toString() {
|
||||
test fun _toString() {
|
||||
val data = arrayList("foo", "bar")
|
||||
assertEquals("[foo, bar]", data.toString())
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class Customer() : ChangeSupport() {
|
||||
$city = value
|
||||
}
|
||||
|
||||
fun toString() = "Customer($name, $city)"
|
||||
override fun toString() = "Customer($name, $city)"
|
||||
}
|
||||
|
||||
class MyChangeListener() : ChangeListener {
|
||||
|
||||
@@ -33,7 +33,7 @@ class Failure(val message : String) : ParseResult<Nothing> {
|
||||
}
|
||||
|
||||
open class Token(val text : String) {
|
||||
fun toString() = text
|
||||
override fun toString() = text
|
||||
}
|
||||
object LPAR : Token("(")
|
||||
object RPAR : Token(")")
|
||||
|
||||
Reference in New Issue
Block a user