diff --git a/src/hx/cppia/CppiaVars.cpp b/src/hx/cppia/CppiaVars.cpp index 0aecb4792..aea9eb863 100644 --- a/src/hx/cppia/CppiaVars.cpp +++ b/src/hx/cppia/CppiaVars.cpp @@ -179,17 +179,9 @@ void CppiaVar::linkVarTypes(CppiaModule &cppia, int &ioOffset) exprType = typeId==0 ? etObject : type->expressionType; AlignOffset(exprType, ioOffset); offset = ioOffset; - - switch(exprType) - { - case etInt: ioOffset += sizeof(int); storeType=fsInt; break; - case etFloat: ioOffset += sizeof(Float);storeType=fsFloat; break; - case etString: ioOffset += sizeof(String);storeType=fsString; break; - case etObject: ioOffset += sizeof(hx::Object *);storeType=fsObject; break; - case etVoid: - case etNull: - break; - } + + storeType = typeId==0 ? fsObject : fieldStorageFromType(type); + ioOffset += sTypeSize[exprType]; } } diff --git a/test/cppia/cases/client/TestClient.hx b/test/cppia/cases/client/TestClient.hx index b44f0bae7..946c5220c 100644 --- a/test/cppia/cases/client/TestClient.hx +++ b/test/cppia/cases/client/TestClient.hx @@ -6,6 +6,8 @@ class TestClient extends Test { public static var clientBool2 = true; public static var clientBool3 = false; + var memberBool = true; + function testThread() { // See if it compiles Assert.notNull(sys.thread.Thread.current()); @@ -55,6 +57,9 @@ class TestClient extends Test { var hostBools = HostBase.hostBool0 + "/" + HostBase.hostBool1 + "/" + HostBase.hostBool2 + "/" + HostBase.hostBool3; var clientBools = clientBool0 + "/" + clientBool1 + "/" + clientBool2 + "/" + clientBool3; Assert.equals(hostBools, clientBools); + + Assert.same(Type.ValueType.TBool, Type.typeof(clientBool0)); + Assert.same(Type.ValueType.TBool, Type.typeof(memberBool)); } function testIssue926() {