don't update const symbol on const section re-sems (#22609)

fixes #19849

(cherry picked from commit 53d9fb259f)
This commit is contained in:
metagn
2023-09-01 09:59:48 +03:00
committed by narimiran
parent 24f3272db3
commit 7335495db7
2 changed files with 20 additions and 5 deletions

10
tests/vm/tconstresem.nim Normal file
View File

@@ -0,0 +1,10 @@
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