slint/internal/compiler/generator
Simon Hausmann 00471449b4 Fix compilation of Rust generated code when the generated code uses a return statement inside a block
We cast the result of the body of functions or binding expressions to
the target type via `as _`. When the code contains a return expression,
that works fine, because `return`'s type is the never type, which can be
coerced to a value of any type. However when the return statement is
inside a sub-block, the type becomes `()`, for which the `as _` cast
fails.

Work around this by attempting to detect the situation (return produces
Type::Invalid) and omit the trailing cast.
2023-03-22 18:07:34 +01:00
..
cpp.rs C++: Don't make the global_* member public 2023-02-17 17:54:03 +01:00
rust.rs Fix compilation of Rust generated code when the generated code uses a return statement inside a block 2023-03-22 18:07:34 +01:00