summary refs log tree commit diff stats
path: root/tests/objects/tunsafenew.nim
blob: 6c1b33cd94a8abb3c76bec84ef18ea7bffd3b14b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
discard """
  errormsg: "conversion from int literal(-1) to Natural is invalid"
"""

type
  Obj = object
    case b: bool
    else: discard
var o: ref Obj
unsafeNew(o, -1)