You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BridJ cannot properly handle structs with nested generic types. For instance, the following test case will not work:
package org.bridj;
import org.bridj.ann.Field;
import org.junit.Test;
public class GenericStructTest {
// a structure to nest.
public static class Nested extends StructObject {
@Field(0)
public int data() {
return io.getIntField(this, 0);
}
@Field(0)
public Nested data(int data) {
io.setIntField(this, 0, data);
return this;
}
}
// a type with a generic nested structure.
public static class GenericStruct<N extends StructObject> extends
StructObject {
@Field(0)
public N nested() {
return io.getNativeObjectField(this, 0);
}
@Field(0)
public GenericStruct<N> nested(N nested) {
io.setNativeObjectField(this, 0, nested);
return this;
}
}
// a concrete structure. BridgJ cannot allocate this type.
public static class ConcreteStruct extends GenericStruct<Nested> {
}
@Test
public void canCreatePointerToExtendedGenericStruct() {
Pointer.allocate(ConcreteStruct.class).release();
}
}
The text was updated successfully, but these errors were encountered:
BridJ cannot properly handle structs with nested generic types. For instance, the following test case will not work:
The text was updated successfully, but these errors were encountered: