Closed HGuillemet closed 1 year ago
Info.constPointer currently gets ignored in this case, yes. It's complicated, but if this fix works for that template that's fine for now. We can do something about Info.constPointer later, I think that's OK, yes. Did you make sure it doesn't break anything in the presets though?
Just finished to reparse (almost) all presets. Only changes are for pytorch where const
is removed from @Cast
in the following declarations:
In BlockArrayRef.java:
public native @Cast("torch::jit::Block**") PointerPointer data();
In ValueArrayRef.java
public native @Cast("torch::jit::Value**") PointerPointer data();
JNI still compiles.
If you instantiate this template with
int *
, then the resulting type should beint * const *
and notconst int **
.But the parser produces this, with a
new Info("X<int *>").pointerTypes("XI")
:Leading to JNI compile error since the constructor expects a
int * const*
. This PR tries to fix this. It seems to do the trick. The parser now emits:The
const
doesn't appear in the cast at all, but at least we have a better chance to compile the JNI. I'm not sure it generalizes well. Can we do something better ?