Make explicit {.nimcall.} a seperate calling convention

This commit is contained in:
Clyybber 2020-08-08 12:36:20 +02:00
commit 38068f9778
12 changed files with 29 additions and 17 deletions

View file

@ -1240,7 +1240,7 @@ proc rawGenNew(p: BProc, a: var TLoc, sizeExpr: Rope; needsInit: bool) =
# the prototype of a destructor is ``=destroy(x: var T)`` and that of a
# finalizer is: ``proc (x: ref T) {.nimcall.}``. We need to check the calling
# convention at least:
if bt.destructor.typ == nil or bt.destructor.typ.callConv != ccDefault:
if bt.destructor.typ == nil or bt.destructor.typ.callConv notin ccDefault:
localError(p.module.config, a.lode.info,
"the destructor that is turned into a finalizer needs " &
"to have the 'nimcall' calling convention")