You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typePoint=tuple[x, y: int]
constOrigin: Point= (0, 0)
templatenext(point: Point): Point=
(point.x +1, point.y +1)
echoOrigin.x # OK: the field is visible.echonext(Origin) # Compilation error: the field is not visible.
Nim Version
Nim Compiler Version 2.2.2 [Linux: amd64]
Compiled at 2025-02-06
Copyright (c) 2006-2025 by Andreas Rumpf
git hash: 6c34f62
active boot switches: -d:release
The issue is also present in the development version.
Current Output
/tmp/z.nim(9, 10) template/generic instantiation of `next` from here
/tmp/z.nim(6, 9) Error: undeclared field: 'x'
Expected Output
Successful compilation.
Known Workarounds
If the value is provided with explicit field names, the compilation is successful.
Additional Information
The problem occurs only for constant tuples with explicit field names initialized with a tuple without explicit field names.
The text was updated successfully, but these errors were encountered:
Description
The following program doesn't compile:
Nim Version
Nim Compiler Version 2.2.2 [Linux: amd64]
Compiled at 2025-02-06
Copyright (c) 2006-2025 by Andreas Rumpf
git hash: 6c34f62
active boot switches: -d:release
The issue is also present in the development version.
Current Output
Expected Output
Known Workarounds
If the value is provided with explicit field names, the compilation is successful.
Additional Information
The problem occurs only for constant tuples with explicit field names initialized with a tuple without explicit field names.
The text was updated successfully, but these errors were encountered: