Made SAM adapters final.

This commit is contained in:
Evgeny Gerashchenko
2013-07-10 23:00:46 +04:00
parent 822c42603f
commit 5c8f87658a
29 changed files with 73 additions and 86 deletions
@@ -1,7 +0,0 @@
class Super {
public String lastCalled = null;
void foo(Runnable r) {
lastCalled = "super";
}
}
@@ -1,21 +0,0 @@
class Sub() : Super() {
override fun foo(r : (() -> Unit)?) {
lastCalled = "sub"
}
}
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"
}