summary refs log tree commit diff stats
path: root/tests/vm/tcastnil.nim
blob: 5a4684f9542ddf4926376bdac58218df555084b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
discard """
  nimout: '''nil
nil
nil
nil
nil
'''
"""

block:
  static:
    let a = cast[pointer](nil)
    echo a.repr

block:
  static:
    echo cast[ptr int](nil).repr

block:
  const str = cast[ptr int](nil)
  static:
    echo str.repr

block:
  static:
    echo cast[ptr int](nil).repr

block:
  static:
    echo cast[RootRef](nil).repr