Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/hx/cppia/Cppia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4654,6 +4654,12 @@ struct GetFieldByLinkage : public CppiaExpr
(CppiaExpr*)new MemReference<String,locThis>(this,offset);
break;
case fsObject:
#if (HXCPP_API_LEVEL<500)
replace = object ?
(CppiaExpr*)new MemReference<hx::Object *,locObj>(this,offset,object):
(CppiaExpr*)new MemReference<hx::Object *,locThis>(this,offset);
break;
#endif
case fsByte:
case fsUnknown:
forceNamedAccess = true;
Expand Down
1 change: 1 addition & 0 deletions test/cppia/Client.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Client {
Common.clientImplementation = new ClientOne();

Common.callback = () -> Common.callbackSet = 2;
Common.instance.dynamicMethod = () -> Common.callbackSet = 3;
}

public static function useHostImplementation() {
Expand Down
3 changes: 3 additions & 0 deletions test/cppia/Common.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ class Common
public function instanceIncrementCount(_) {
count++;
}

public static var instance = new Common();
public dynamic function dynamicMethod() {}
}
6 changes: 6 additions & 0 deletions test/cppia/cases/TestCommon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ class TestCommon extends Test {
Assert.equals(2, Common.callbackSet, 'Bad cppia closure');
}

function testDynamicMethod() {
Common.instance.dynamicMethod();

Assert.equals(3, Common.callbackSet, 'Bad cppia closure');
}

function testInterfaceCalling() {
final obj : IFoo = Type.createInstance(Type.resolveClass('ClientFoo'), []);

Expand Down
1 change: 0 additions & 1 deletion test/cppia/compile-client.hxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-m Client
cases.client.TestClient
-D dll_import=host_classes.info
-L utest
--cppia bin/client.cppia
Loading