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
At first glance it should simply be a matter of adding *types.Basic (with .Kind() == types.String) to the case where we handle *types.Array and *types.Slicehere, however range loops are a bit different when strings are involved. When indexing a string you get back a byte. When using a for range loop with a string you get a rune along with an index representing its offset in the string. More info in https://go.dev/blog/strings.
The desugaring pass should use utf.DecodeRuneInString to parse runes from strings iteratively.
The text was updated successfully, but these errors were encountered:
The desugaring pass should be updated to desugar for range loops over strings:
At first glance it should simply be a matter of adding
*types.Basic
(with.Kind() == types.String
) to the case where we handle*types.Array
and*types.Slice
here, however range loops are a bit different when strings are involved. When indexing a string you get back abyte
. When using a for range loop with a string you get arune
along with an index representing its offset in the string. More info in https://go.dev/blog/strings.The desugaring pass should use
utf.DecodeRuneInString
to parse runes from strings iteratively.The text was updated successfully, but these errors were encountered: