File tree Expand file tree Collapse file tree 4 files changed +35
-1
lines changed
Expand file tree Collapse file tree 4 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1414 object may change, but the underlying ObjC object will still be the same.
1515 In any case, you should be using ` Foo.isInstance(x) ` instead of ` x is Foo `
1616 to check the runtime type of an ObjC object.
17+ - Fix for opaque dependencies for struct/union const arrays.
1718
1819## 19.1.0
1920
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class FindByValueCompoundsVisitation extends Visitation {
2121
2222 @override
2323 void visitPointerType (PointerType node) {
24- if (node.child.typealiasType is Compound ) {
24+ if (node.child.typealiasType is Compound && node is ! ConstantArray ) {
2525 // Don't visit compounds through pointers. We're only interested in
2626 // compounds that are referred to by value.
2727 } else {
Original file line number Diff line number Diff line change @@ -59,10 +59,20 @@ final class D extends ffi.Struct {
5959 external ffi.Pointer <NoDefinitionStructInD > nds;
6060}
6161
62+ final class DArray extends ffi.Struct {
63+ @ffi .Int ()
64+ external int a;
65+
66+ external ffi.Pointer <NoDefinitionStructInD > nds;
67+ }
68+
6269final class E extends ffi.Struct {
6370 external ffi.Pointer <C > c;
6471
6572 external D d;
73+
74+ @ffi .Array .multi ([10 ])
75+ external ffi.Array <DArray > dArray;
6676}
6777
6878final class UA extends ffi.Opaque {}
@@ -76,8 +86,16 @@ final class UD extends ffi.Union {
7686 external int a;
7787}
7888
89+ final class UDArray extends ffi.Union {
90+ @ffi .Int ()
91+ external int a;
92+ }
93+
7994final class UE extends ffi.Union {
8095 external ffi.Pointer <UC > c;
8196
8297 external UD d;
98+
99+ @ffi .Array .multi ([10 ])
100+ external ffi.Array <UDArray > dArray;
83101}
Original file line number Diff line number Diff line change @@ -30,11 +30,19 @@ struct D
3030 struct NoDefinitionStructInD * nds ;
3131};
3232
33+ // Full (excluded, but used by value in an array).
34+ struct DArray
35+ {
36+ int a ;
37+ struct NoDefinitionStructInD * nds ;
38+ };
39+
3340// Full (included)
3441struct E
3542{
3643 struct C * c ;
3744 struct D d ;
45+ struct DArray dArray [10 ];
3846};
3947
4048// Opaque.
@@ -63,9 +71,16 @@ union UD
6371 int a ;
6472};
6573
74+ // Full (excluded, but used by value in array).
75+ union UDArray
76+ {
77+ int a ;
78+ };
79+
6680// Full (included)
6781union UE
6882{
6983 union UC * c ;
7084 union UD d ;
85+ union UDArray dArray [10 ];
7186};
You can’t perform that action at this time.
0 commit comments