-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Description
Nim Version
Nim Compiler Version 2.3.1 [Linux: amd64]
Compiled at 2025-09-25
Copyright (c) 2006-2025 by Andreas Rumpf
git hash: 9f74712
active boot switches: -d:release
Description
It used to work in Nim 2.0.8.
iterator it(x: var int): var int =
yield x
proc it(x: var int): var int =
x
proc main() =
type Obj = object
field: ref int
var obj = Obj(field: new(int))
obj.field[] = 123
echo it(obj.field[]) # fails
for x in it(obj.field[]): # fails
echo x
static:
main()
Current Output
Error: attempt to access a nil address kind: rkInt
Expected Output
123
123
Known Workarounds
No response
Additional Information
The iterator issue was found when using nim-stew.