Files
Nim/tests/template/tobjectdeclfield.nim
metagn 107ec62baf consider object types as declarative in templates (#22106)
* consider object types as declarative in templates

fixes #16005

* correct logic for nkRecList children, inject fields

* don't actually inject fields

(cherry picked from commit 3ac2d81601)
2023-09-11 13:52:58 +02:00

13 lines
183 B
Nim

var x = 0
block:
type Foo = object
x: float # ok
template main() =
block:
type Foo = object
x: float # Error: cannot use symbol of kind 'var' as a 'field'
main()