BUG: function pointer as struct member does not compile if name is same as the struct
Lost Illusion
im at lostillusion.net
Sun Jul 17 03:28:39 UTC 2022
Hello,
I'm currently using jextract in tandem with Kotlin/Native's ability to
generate shared libraries and header files. It works nicely until you
add a class to the Kotlin code which generates a struct and a function
pointer (the initializer for the class) as a struct member, with both
having the same name. Here's a minimal header file with the same
problem.
test.h:
```
struct {
int (*Foo)();
} Foo;
```
While this is valid for a header file, jextract has a problem
processing it. Using the latest jextract on the jdk18 branch, and
using the following command: `jextract test.h`. I get bombarded with
11 errors about resolving symbols and a duplicate class. Seems to be
because a static class for the struct Foo is generated and an
interface for the method Foo is also generated. I'm new to the project
and not sure what the correct behavior should be in order to fix this
issue.
More information about the jextract-dev
mailing list