Skip to content

Conversation

@brendandahl
Copy link
Collaborator

This change moves the BindingType specialization for std::optional from emscripten/bind.h to emscripten/val.h. This ensures that emscripten::val can use std::optional types even when emscripten/bind.h is not included in the translation unit. A regression test is added to verify the fix.

Fixes #24747

This change moves the BindingType specialization for std::optional from emscripten/bind.h to emscripten/val.h. This ensures that emscripten::val can use std::optional types even when emscripten/bind.h is not included in the translation unit. A regression test is added to verify the fix.

Fixes emscripten-core#24747
@brendandahl brendandahl requested review from kripken and sbc100 January 8, 2026 01:42
@brendandahl brendandahl merged commit d04526e into emscripten-core:main Jan 8, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Passing std::optional<T> to emscripten::val causes marshalling error unless <emscripten/bind.h> is included

2 participants