Merge pull request #8996 from LemonBoy/fix-2574

The VM cannot call methods
This commit is contained in:
Andreas Rumpf 2018-09-18 10:29:49 +02:00 • committed by GitHub
commit a5d014233a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1842,6 +1842,9 @@ proc gen(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags = {}) =
let s = n.sons[0].sym
if s.magic != mNone:
genMagic(c, n, dest, s.magic)
elif s.kind == skMethod:
localError(c.config, n.info, "cannot call method " & s.name.s &
" at compile time")
elif matches(s, "stdlib", "marshal", "to"):
# XXX marshal load&store should not be opcodes, but use the
# general callback mechanisms.