Skip to content

[ffi] Nested structs #37271

Closed
Closed
@pingbird

Description

@pingbird

Right now it isn't possible to represent nested structs using ffi, for example the following C data structure:

struct Foo {
    int foo;
};

struct Bar {
    struct Foo foo;
    int bar;
};

In Dart:

@struct class Foo extends Pointer<Void> {
    @Uint32() int foo;
}

@struct class Bar extends Pointer<Void> {
    Foo foo;
    @Uint32() int bar;
}

Does not compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-ffi

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions