error msg for #13864 (#13962)

Co-authored-by: cooldome <ariabushenko@bk.ru>
This commit is contained in:
cooldome 2020-04-13 13:17:22 +01:00 • committed by GitHub
commit 8ba915e449
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,15 @@
discard """
cmd: "nim c --gc:arc $file"
errormsg: "expression cannot be cast to ref RootObj"
joinable: false
"""
type Variant* = object
refval: ref RootObj
proc newVariant*[T](val: T): Variant =
let pt = T.new()
pt[] = val
result = Variant(refval: cast[ref RootObj](pt))
var v = newVariant(@[1, 2, 3])