Use typeflag instead

This commit is contained in:
Clyybber 2020-08-10 12:57:32 +02:00
commit b022576ce9
11 changed files with 29 additions and 18 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 notin ccDefault:
if bt.destructor.typ == nil or bt.destructor.typ.callConv != ccNimCall:
localError(p.module.config, a.lode.info,
"the destructor that is turned into a finalizer needs " &
"to have the 'nimcall' calling convention")