Skip to content

[BUG] Struct field function pointers don't support function call convention #317

@borup3

Description

@borup3

Describe the bug

alias FileSystemMonitorCallback = fn*(const char*);

opaque struct FileSystemMonitorEntry {
    fn_ptr: FileSystemMonitorCallback;
}

fn main() {
    let e = FileSystemMonitorEntry{};

    // This doesn't work
    e.fn_ptr("Hello!");

   // You have to do this
   let cb = e.fn_ptr;
   cb("Hello!");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions