Added tests with SAM adapter overridden in Java class.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
class Super {
|
||||
public String lastCalled = null;
|
||||
|
||||
void foo(Runnable r) {
|
||||
lastCalled = "super";
|
||||
}
|
||||
}
|
||||
|
||||
class Sub extends Super {
|
||||
void foo(jet.Function0<jet.Unit> r) {
|
||||
lastCalled = "sub";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fun box(): String {
|
||||
val sub = Sub()
|
||||
|
||||
(sub : Super).foo{ }
|
||||
if (sub.lastCalled != "super") {
|
||||
return "FAIL: ${sub.lastCalled} instead of super"
|
||||
}
|
||||
|
||||
sub.foo{ }
|
||||
if (sub.lastCalled != "sub") {
|
||||
return "FAIL: ${sub.lastCalled} instead of sub"
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user