[foreign] RFR duplicates in named layouts have to be reported as error

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Sat May 26 09:13:41 UTC 2018



On 26/05/18 02:07, Sundararajan Athijegannathan wrote:
> I didn't find so. Only assumption here is that @NativeStruct classes 
> are nested inside @NativeHeader classes - so that Util.getNativeHeader 
> can locate the containing native header class. Unless we want to 
> change the model of 'header' interface contains 'struct' interface as 
> nested type, there is no issue.
I think this assumption is bad.

What if I have a struct interface:

@NativeStruct("[i32(get=getX)i32(get=getY)](mystruct)")
interface MyStruct extends Struct<MyStruct> {
     int getX();
     int getY();
}

And then I do

Scope sc = ...
sc.allocateStruct(MyStruct.class)

This *has* to work. There are two aspects to what we're doing; one is 
interop with C headers, but another big part of the story is interfacing 
with native data. The two use cases are rather orthogonal; of course for 
jextract generated code the assumption you mention will be valid, but in 
the general case I don't expect this to be the case.

Maurizio


More information about the panama-dev mailing list