Files
logos-cpp-sdk/cpp-generator
Dario Gabriel LipicarandClaude Opus 5 77a7009742 feat(cdylib): a wrong argument count reports invalid_args
Too-few-arguments emitted `return nullptr`, which the Qt glue converts to an
empty QVariant (logos-qt-sdk lidl_gen_cdylib_glue: `if (!result) return
QVariant();`) — so "you passed 2 of 4 arguments" was indistinguishable from a
method that legitimately returned nothing. Now:

  {"code":"invalid_args","message":"expected 4 arguments, got 2","origin":"<mod>"}

The ABI already allows it (logos_module_impl.h: "errors from dispatch: NULL
return, or a canonical error object") and dispatch_failed objects already travel
this path, so hosts see nothing structurally new.

logos-rust-sdk's generated dispatch emits the same code and the same message, in
the same change, so neither language starts rejecting calls the other accepts.

Unknown method names keep returning nullptr on purpose: nothing branches on the
NULL reply, but a caller that optimistically invokes an optional lifecycle hook
and reads "no value" as "not implemented" would misread an error object as a real
return value.

Tests: 173/173.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 10:24:22 -03:00
..