MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / VariantError

Method VariantError

tests/runtime/results/intermediate.cpp:43–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41overloaded(Fs...) -> overloaded<Fs...>;
42
43std::expected<float, test_exports::E3> test_exports::VariantError(float a) {
44 auto result = test_imports::VariantError(a);
45 if (result.has_value()) { return result.value(); }
46 return std::visit(overloaded{
47 [](test_imports::E3::E1 const& e1) { return std::unexpected(test_exports::E3{test_exports::E3::E1{to_exports_e(e1.value)}}); },
48 [](test_imports::E3::E2 const& e2) { return std::unexpected(test_exports::E3{test_exports::E3::E2{e2.value.line, e2.value.column}}); }
49 }, result.error().variants);
50}
51
52std::expected<uint32_t, wit::Void> test_exports::EmptyError(uint32_t a) {
53 return test_imports::EmptyError(a);

Callers

nothing calls this directly

Calls 4

unexpectedClass · 0.85
to_exports_eFunction · 0.85
VariantErrorFunction · 0.70
has_valueMethod · 0.45

Tested by

no test coverage detected