bind: fix field accessors for Go implemented Java classes

The go_seq_to_refnum function handles its argument object as a Java
object if it doesn't implement Seq.Proxy. Java classes implemented in
Go does not implement Seq.Proxy, but when passing "this" references to
Go, instances must be treated as a Go object.

Use go_seq_to_refnum_go everywhere "this" is passed to Go, which fixes
field accessors and simplifies the method call case.

Change-Id: I3d01c63d7b2081e6344ece431f5e5021a9dd7662
Reviewed-on: https://go-review.googlesource.com/31171
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Elias Naur
2016-10-17 10:26:22 +00:00
parent eb6d6dca20
commit 63993740dd
10 changed files with 97 additions and 96 deletions
+5
View File
@@ -71,6 +71,11 @@ public class ClassesTest extends InstrumentationTestCase {
assertNotNull("RuntimeException", exc);
}
public void testField() {
GoRunnable r = new GoRunnable();
String f = r.getField();
}
public void testGoObject() {
Runnable r = new GoRunnable();
r.run();