Skip to content

clearer errors #46

Description

@spiral-ladder

Right now it's a bit devex unfriendly if you use a non js wrapped value as an arg to a function signature. For example:

pub fn foo(self: *const Bar, my_bool: bool)  !void { ... }

The error, when you try to build:

➜ zig build build-lib:bindings
build-lib:bindings
└─ install bindings
   └─ compile lib bindings Debug native 1 errors
zig-pkg/zapi-2.2.0-rIqzUXBaBADUsvvvB2N5kOBdLEO0rGPhowTqmIXe3qVh/src/js/wrap_function.zig:180:5: error: convertArg: unsupported type bool
    @compileError("convertArg: unsupported type " ++ @typeName(T));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

it does not tell you exactly where/what went wrong, but only something internally that went wrong, and unless you're familiar with zapi the error can be quite confusing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions