You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected it to compile and print the emoji character.
What did you see instead?
Compilation fails, as it appears that the unicode is not a valid rune. This also happens for other sets of valid unicode code points, such as weightlifter = U+1F3CB.
It also seems to error either as multiple characters in rune literal, or invalid character in rune.
The text was updated successfully, but these errors were encountered:
Hm, so it only works for a certain set of unicode characters which have a fixed number of code points?
Is it possible to update the compiler's error message for this case? It seems to be a strange edge case considering that it is not easily identifiable from just looking at the character itself.
I understand that runes can't support this case, but just saying "illegal character" is hard to understand.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?Fails on playground.
What did you do?
https://play.golang.org/p/GKmXPxtK52x
What did you expect to see?
I expected it to compile and print the emoji character.
What did you see instead?
Compilation fails, as it appears that the unicode is not a valid rune. This also happens for other sets of valid unicode code points, such as
weightlifter = U+1F3CB
.It also seems to error either as multiple characters in rune literal, or invalid character in rune.
The text was updated successfully, but these errors were encountered: