-
-
Save zah/9f925779e27ec515e4b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type | |
| TData = tuple | |
| letters: seq[string] | |
| numbers: seq[int | |
| const data: TData = (@["aa", "bb"], @[11, 22]) | |
| static: | |
| # the code works with the following line, because in semVarOrLet fitNode is used, which | |
| # produces nkHiddenConv for the tuple type | |
| var m: TData = data | |
| # but the following version won't work | |
| # (no nkHiddenConv is produced and the VM crashes while executing it) | |
| # var m = data | |
| for x in m.letters: | |
| echo x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment