do not generate delegates when the class already has such method either declared or delegated (report an ambiguity in this case)
Merge conflict resolved by committer
This commit is contained in:
committed by
Andrey Breslav
parent
10bdc02409
commit
1061e1ef69
@@ -0,0 +1,35 @@
|
||||
trait One {
|
||||
public open fun foo() : Int
|
||||
public open fun faz() : Int = 10
|
||||
}
|
||||
trait Two {
|
||||
public open fun foo() : Int
|
||||
public open fun quux() : Int = 100
|
||||
}
|
||||
|
||||
class OneImpl : One {
|
||||
public override fun foo() = 1
|
||||
}
|
||||
class TwoImpl : Two {
|
||||
public override fun foo() = 2
|
||||
}
|
||||
|
||||
class Test2(a : One, b : Two) : Two by b, One by a {
|
||||
public override fun foo() = 0
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
var t2 = Test2(OneImpl(), TwoImpl())
|
||||
if (t2.foo() != 0)
|
||||
return "Fail #1"
|
||||
if (t2.faz() != 10)
|
||||
return "Fail #2"
|
||||
if (t2.quux() != 100)
|
||||
return "Fail #3"
|
||||
if (t2 !is One)
|
||||
return "Fail #4"
|
||||
if (t2 !is Two)
|
||||
return "Fail #5"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user