tconstresem.nim 195 B

1234567891011
  1. block: # issue #19849
  2. type
  3. Vec2[T] = object
  4. x, y: T
  5. Vec2i = Vec2[int]
  6. template getX(p: Vec2i): int = p.x
  7. let x = getX:
  8. const t = Vec2i(x: 1, y: 2)
  9. t
  10. doAssert x == 1