Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler: return "if-test and throw" when compiling 'assert' (beta-3.0) #477

Merged
merged 1 commit into from May 6, 2023

Conversation

mortend
Copy link
Member

@mortend mortend commented May 5, 2023

'assert' statements were turned into method calls to a method that was removed in 992b515, resulting in compile errors.

'assert' is still used in a few places, and this commit turns them into "if-test and throw" in debug builds (noop in release builds) to fix the compile errors.

assert VALUE;

becomes when compiled:

if (IS_DEBUG_BUILD && !VALUE)
    throw new Uno.InvalidOperationException(
        "Assertion failed: VALUE"
    );

'assert' statements were turned into method calls to a method that was
removed in 992b515, resulting in compile errors.

'assert' is still used in a few places, and this commit turns them into
"if-test and throw" in debug builds (noop in release builds) to fix the
compile errors.

    assert VALUE;

becomes when compiled:

    if (IS_DEBUG_BUILD && !VALUE)
        throw new Uno.InvalidOperationException(
            "Assertion failed: VALUE"
        );
@mortend mortend merged commit ec99ff1 into fuse-open:beta-3.0 May 6, 2023
1 check passed
@mortend mortend deleted the assert branch May 6, 2023 07:32
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.

None yet

1 participant