fixes #12488 [backport]

This commit is contained in:
Araq
2019-11-28 10:11:25 +01:00
committed by Andreas Rumpf
parent 2dea920379
commit 87f0d534d6
2 changed files with 21 additions and 1 deletions

View File

@@ -15,6 +15,9 @@ Done!
foo4
foo4
foo4
(a: 0, b: 0)
(a: 0, b: 0)
(a: 0, b: 0)
'''
"""
@@ -234,3 +237,17 @@ static:
echo foo()
echo foo()
echo foo()
# bug #12488
type
MyObject = object
a,b: int
MyObjectRef = ref MyObject
static:
let x1 = new(MyObject)
echo x1[]
let x2 = new(MyObjectRef)
echo x2[]
let x3 = new(ref MyObject) # cannot generate VM code for ref MyObject
echo x3[]