google / jni-bind

JNI Bind is a set of advanced syntactic sugar for writing efficient correct JNI Code in C++17 (and up).
Apache License 2.0
244 stars 29 forks source link

Support Inheritance #310

Open jwhpryor opened 2 months ago

jwhpryor commented 2 months ago

Currently, class definitions must re-declare all of their parent classes interface if they want to be used, which is repetitive.

Also, subclasses must static_cast themselves to jobjects to be used in a context their subclass is required which loses type safety.

enum classes are basically syntactic sugar for a subclassing, so this likely needs to be implemented first.

It will be nice to unify the type system to enable interface of Object throughout Java. That said, Kotlin's Any is not Java's Object, so any solution should not presume this.