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
For array and slice literals the following rules apply:
- Each element has an associated integer index marking its position in the array.
- An element without a key uses the previous element's index plus one. If the first element has no key, its index is zero.
piux2
changed the title
mixed keyed and un-keyed elements elements in slice are not supported
mixed keyed and un-keyed elements in a slice are not supported
Jan 9, 2025
piux2
changed the title
mixed keyed and un-keyed elements in a slice are not supported
Mixed keyed and unkeyed elements in a slice are not supported
Jan 9, 2025
Description
Mixed keyed and unkeyed elements in a slice should be allowed.
According to the go specs https://go.dev/ref/spec
Your environment
Steps to reproduce
Expected behaviour
It should pass, and the output should be
6 34
https://go.dev/play/p/QWy6BXtDJZV?v=goprev
Actual behaviour
--- FAIL: TestFiles (0.04s)
--- FAIL: TestFiles/slice/slice4.gno (0.00s)
panic: slice composite literal cannot mix keyed and unkeyed elements [recovered]
panic: slice composite literal cannot mix keyed and unkeyed elements [recovered]
panic: interface conversion: gnolang.Stmt is *gnolang.ValueDecl, not *gnolang.bodyStmt [recovered]
panic: interface conversion: gnolang.Stmt is *gnolang.ValueDecl, not *gnolang.bodyStmt
The text was updated successfully, but these errors were encountered: