mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 02:12:11 +00:00
@@ -2130,7 +2130,10 @@ proc gen(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags = {}) =
|
||||
of nkComesFrom:
|
||||
discard "XXX to implement for better stack traces"
|
||||
else:
|
||||
globalError(c.config, n.info, "cannot generate VM code for " & $n)
|
||||
if n.typ != nil and n.typ.isCompileTimeOnly:
|
||||
genTypeLit(c, n.typ, dest)
|
||||
else:
|
||||
globalError(c.config, n.info, "cannot generate VM code for " & $n)
|
||||
|
||||
proc removeLastEof(c: PCtx) =
|
||||
let last = c.code.len-1
|
||||
|
||||
@@ -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[]
|
||||
|
||||
Reference in New Issue
Block a user