mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
11 lines
195 B
Nim
11 lines
195 B
Nim
block: # issue #19849
|
|
type
|
|
Vec2[T] = object
|
|
x, y: T
|
|
Vec2i = Vec2[int]
|
|
template getX(p: Vec2i): int = p.x
|
|
let x = getX:
|
|
const t = Vec2i(x: 1, y: 2)
|
|
t
|
|
doAssert x == 1
|