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

assert(0) as ternary RHS => crash #3885

Open
maxhaton opened this issue Dec 17, 2021 · 2 comments
Open

assert(0) as ternary RHS => crash #3885

maxhaton opened this issue Dec 17, 2021 · 2 comments

Comments

@maxhaton
Copy link
Contributor

int front(int param)
{
    return param ? 1 : assert(0);
}

Also causes an assertion failure in dmd (https://issues.dlang.org/show_bug.cgi?id=22587). Is it even valid code?

@MoonlightSentinel
Copy link
Contributor

Is it even valid code?

Yes, see the DIP

@maxhaton
Copy link
Contributor Author

Is it even valid code?

Yes, see the DIP

Good good, was just asking to be idiot-checked.

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

No branches or pull requests

2 participants