fixes #20836; fixes #20833; fixes unsafeNew (#20841)

* fixes #20836; fixes `unsafeNew`

* fixes #20833
This commit is contained in:
ringabout
2022-11-14 22:59:37 +08:00
committed by GitHub
parent 3eef0491a8
commit d901d3b8c5
2 changed files with 14 additions and 1 deletions

View File

@@ -0,0 +1,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)