-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
make Base.@assume_effects :nothrow
mark throwing expressions as unreachable
#54427
Comments
This is a clever way to implement unreachable, but I don't like it. It's too hard to use properly. An
I think we shouldn't have this for many of the same reasons we don't have global |
Not true, since v1.11 Base.@assume_effects :nothrow let
7::Union{}
end Obviously |
Thanks for the correction. I vaguely recalled seeing something like that but it's hard to keep up with all the upcoming changes. Really, you're right that (in at least some senses) That said, as far as I understand (though my understanding is poor), I also don't relish the idea of encouraging people to impose blatantly false effects to twist the compiler into emitting unreachable. There should be a more direct option (although it could co-exist with the proposed feature). |
xref #54436 |
This would provide a pure-Julia way to implement an assumed-unreachable statement, and thus fix #52851 without introducing any new features. Also xref #51729. If this were implemented, any statement that's annotated with
Base.@assume_effects :nothrow
, but statically known to throw would be equivalent tounreachable()
. E.g.,7::Union{}
would be assumed unreachable.The text was updated successfully, but these errors were encountered: