Stream: beginners

Topic: U8 character literals


view this post on Zulip Aurélien Geron (Sep 04 2026 at 03:19):

I can write 65.U8 but not 'A'.U8, I have to write:

c : U8
c = 'A'

Is there a one-liner syntax to define a U8 using single-quote literal?

view this post on Zulip Aurélien Geron (Sep 04 2026 at 03:21):

I also tried U8.('A'), U8.'A', ('A').U8 but none work.
The only solution I found so far is 0.U8 + 'A' but it's not very nice (although the compiler is probably smart enough to entirely drop the addition at compilation time).

view this post on Zulip Richard Feldman (Sep 04 2026 at 11:14):

oh 'A'.U8 should work - can you open an issue for that? :smile:

view this post on Zulip Aurélien Geron (Sep 04 2026 at 19:04):

Opened issue #11095


Last updated: Sep 24 2026 at 15:59 UTC