-
Notifications
You must be signed in to change notification settings - Fork 0
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
Throw expressions #51
Labels
Comments
Could be realized by an IIFE: // Given this input...
$a ?? throw new \lang\IllegalArgumentException("X");
// ...the compiler would emit this:
$a ?? (function() { throw new \lang\IllegalArgumentException("X"); })() |
Good blog article on throws expressions in C# 7.0 |
Stackoverflow question covering the problem: https://stackoverflow.com/questions/9544976/using-throw-in-a-javascript-expression |
In Kotlin, throw is an expression: https://kotlinlang.org/docs/reference/exceptions.html#the-nothing-type |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a nutshell
Would be allowed for the ternary operator, the null-coalesing operator and inside of compact functions.
See also
The text was updated successfully, but these errors were encountered: