Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract method that returns byte[] array translated with --objc-generics raises compile error #1962

Open
sarsonj opened this issue Nov 14, 2022 · 2 comments

Comments

@sarsonj
Copy link
Contributor

sarsonj commented Nov 14, 2022

Hi,

we have Java file with method:

abstract byte[] readData();

In .h is generated:

- (IOSArray<JavaLangByte *> *)readData;

It raises compile error: Declaration of JavaLangByte must be imported before required

It looks like that generator counts with usage of IOSByteArray (it is defined by @class declaration in .h file). That is also type, that is used in generated .m file.

@tomball
Copy link
Collaborator

tomball commented Nov 14, 2022

Good catch, thanks for reporting it.

As a very temporary workaround, you can add the following above your Java file's class declaration:

/*-HEADER[
#include "IOSPrimitiveArray.h"
]-*/

This adds the block contents to the .h file instead of the .m file.

@tomball
Copy link
Collaborator

tomball commented Nov 15, 2022

Oops, make that "java/lang/Byte.h".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants