tarraycons.nim 338 B

12345678910111213141516171819202122
  1. discard """
  2. errormsg: "invalid order in array constructor"
  3. file: "tarraycons.nim"
  4. line: 14
  5. """
  6. type
  7. TEnum = enum
  8. eA, eB, eC, eD, eE, eF
  9. const
  10. myMapping: array[TEnum, array[0..1, int]] = [
  11. eA: [1, 2],
  12. eC: [3, 4],
  13. eB: [5, 6],
  14. eD: [0: 8, 1: 9],
  15. eE: [0: 8, 9],
  16. eF: [2, 1: 9]
  17. ]
  18. echo myMapping[eC][1]