fun reformat( str : String, normalizeCase : Boolean = true, uppercaseFirstLetter : Boolean = true, divideByCamelHumps : Boolean = true, wordSeparator : String = " " ) = (normalizeCase, uppercaseFirstLetter, divideByCamelHumps, wordSeparator) trait A { fun bar2(arg: Int = 239) : Int fun bar(arg: Int = 240) : Int = bar2(arg/2) } open abstract class B() : A { fun foo(arg: Int = 239 + 1) : Int = arg abstract fun foo2(arg: Int = 239) : Int override fun bar2(arg: Int) : Int = arg } class C() : B() { override fun foo2(arg: Int) : Int = arg } // fun T.toPrefixedString(prefix: String = "") = prefix + (this as java.lang.Object).toString() fun box() : String { val expected = (true, true, true, " ") // if("mama".toPrefixedString("papa") != "papamama") return "fail" // if("mama".toPrefixedString() != "mama") return "fail" if(C().bar(10) != 5) return "fail" if(C().bar() != 120) return "fail" if(C().foo(10) != 10) return "fail" if(C().foo() != 240) return "fail" if(C().foo2() != 239) return "fail" if(C().foo2(10) != 10) return "fail" if(C().bar2() != 239) return "fail" if(C().bar2(10) != 10) return "fail" if(reformat("", true, true, true, " ") != expected) return "fail" if(reformat("", true, true, true) != expected) return "fail" if(reformat("", true, true) != expected) return "fail" if(reformat("", true) != expected) return "fail" if(reformat("") != expected) return "fail" return "OK" }