Should as
keyword be allowed cast option types?
#17572
impopular-guy
started this conversation in
General
Replies: 1 comment 3 replies
-
Why enter this as a discussion, rather than issues? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This prints 0, which is incorrect,
0 != none
. Apart from none, any other value works.current: builder error for both
?int(none)
and?int(3)
expected: to get 3 or
panic: option not set
which is the error message we get in case of functions returning Option(none).current: builder error: cannot convert 'struct _option_int' to 'int'
Question:
For points 1 and 3, I though
as
syntax was for sum-types, import alias andenum Name as u8
only. Seems like it violates one-way rule.Beta Was this translation helpful? Give feedback.
All reactions