ladybird/Meta/Lagom/Tools/CodeGenerators
Timothy Flynn 357fd76e30 Meta: Generate a helper constructor for single-value IPC responses
When an IPC message returns a single value, we generate a class with a
constructor that is something like:

    class MessageResponse {
        MessageResponse(SingleReturnType value)
            : m_value(move(value))
        {
        }
    };

If that IPC message wants to return a value that SingleReturnType is
constructible from, you have to wrap that return call with braces:

    return { value_that_could_construct_single_return_type };

That isn't really an issue except for when we want to mix TRY semantics
with the return type. If SingleReturnType is constructible from an Error
type (i.e. something similar to ErrorOr), the following doesn't work:

    TRY(fallible_function());

Because MessageResponse would not be constructible from Error. Instead,
we must do some workaround with a custom TRY macro, as in 31bb792.

This patch generates a constructor that makes TRY usable as-is without
any custom macros. We perform a very similar trick in ThrowCompletionOr
inside LibJS. This constructor will allow you to create MessageResponse
from any type that SingleReturnType is constructible from.
2022-11-09 14:15:59 +00:00
..
IPCCompiler Meta: Generate a helper constructor for single-value IPC responses 2022-11-09 14:15:59 +00:00
LibEDID AK+Everywhere: Turn bool keep_empty to an enum in split* functions 2022-10-24 23:29:18 +01:00
LibLocale LibJS+LibUnicode: Add "microsecond" and "nanosecond" as sanctioned units 2022-11-03 18:37:48 +00:00
LibTimeZone AK+Everywhere: Turn bool keep_empty to an enum in split* functions 2022-10-24 23:29:18 +01:00
LibUnicode Meta+LibUnicode: Avoid relocations for emoji data 2022-11-06 17:34:06 +01:00
LibWeb LibWeb: Support translate3d 2022-11-02 11:04:23 +00:00
StateMachineGenerator StateMachineGenerator: Remove unused variable 2022-09-20 18:54:16 +01:00
CMakeLists.txt LibUnicode: Move CLDR data generators to a LibLocale subfolder 2022-09-05 14:37:16 -04:00