Skip to content

[vm/ffi] Disallow user methods on Structs #40291

Open
@dcharkes

Description

@dcharkes

Structs are really a view on top of memory. They do not have constructors, their instances are invented by the VM in the FFI. Those instances happen to implement the abstract interface of the struct. They do not have normal fields, only the getters and setters to C memory. They cannot be sub typed.

However, currently we do allow methods on those classes. But they add nothing over extension methods from a user point of view, because they work based on the core interface, and we do not allow sub typing. But they do add complexity.

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions