Files
kotlin-fork/js/js.translator/testData/expression/function/cases/overloadOverridenFun.kt
T
Zalim Bashorov 7b503bbe6f Minor in JS backend: added regression tests.
#{KT-2219, KT-2470, KT-2507, KT-2222, KT-2995, KT-2221} Obsolete
2014-03-13 22:57:41 +04:00

26 lines
552 B
Kotlin

// KT-2219 if function overload overridden function its name doesn't translated correctly
package foo
fun assertEquals(expected: Any, actual: Any) {
if (expected != actual) throw Exception("expected = $expected, actual = $actual")
}
trait I {
fun test(): String
}
class P : I {
override fun test(): String = "foo" + test("bar")
private fun test(p: String) = p
fun test(s: String, i: Int) = "$i $s"
}
fun box(): String {
assertEquals("foobar", P().test())
assertEquals("35 baz", P().test("baz", 35))
return "OK"
}