pniederw
11/15/2017, 10:38 PMopen class Foo(val foo: String) {
fun copy(foo: String = this.foo) = Foo(foo)
}
class Bar(foo: String, val bar: String) : Foo(foo) {
fun copy(foo: String = this.foo, bar: String = this.bar) = Bar(foo, bar)
}
fun test() {
// resolves to Foo.copy()
// I'd have expected ambiguity error or Bar.copy()
// surprised I'm not getting a warning
Bar("foo", "bar").copy(foo = "other")
}