summary refs log tree commit diff stats
path: root/tests/template/tobjectdeclfield.nim
blob: afce2cae81125a27b9009a51fe138c726c62304c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
block: # issue #16005
  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()

block: # issue #19552
  template test =
    type
      test2 = ref object
        reset: int

  test()