use receiver type as owner when calling Java methods

This commit is contained in:
Dmitry Jemerov
2011-05-26 18:08:51 +04:00
parent 815a423dc1
commit 71a10295d7
2 changed files with 13 additions and 1 deletions
@@ -393,4 +393,11 @@ public class NamespaceGenTest extends CodegenTestCase {
main.invoke(null, l);
assertEquals(10, l.get(0).intValue());
}
public void testCallMethodDeclaredInSuperclass() throws Exception {
loadText("fun foo(sb: StringBuilder) = sb.charAt(0)");
final Method main = generateFunction();
final StringBuilder sb = new StringBuilder("x");
assertEquals('x', ((Character) main.invoke(null, sb)).charValue());
}
}