parent
6b8baab536
commit
66cd9c2e57
2 changed files with 14 additions and 2 deletions
|
|
@ -527,7 +527,7 @@ proc magicsAfterOverloadResolution(c: PContext, n: PNode,
|
|||
if n[^1].kind == nkSym and n[^1].sym.kind notin {skProc, skFunc}:
|
||||
localError(c.config, n.info, "finalizer must be a direct reference to a proc")
|
||||
elif optTinyRtti in c.config.globalOptions:
|
||||
let fin = if n[^1].kind == nkLambda: n[^1][namePos].sym
|
||||
let fin = if n[^1].kind in {nkLambda, nkDo}: n[^1][namePos].sym
|
||||
else: n[^1].sym
|
||||
# check if we converted this finalizer into a destructor already:
|
||||
let t = whereToBindTypeHook(c, fin.typ[1].skipTypes(abstractInst+{tyRef}))
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ new line after - @['a']
|
|||
finalizer
|
||||
aaaaa
|
||||
hello
|
||||
ok
|
||||
closed
|
||||
destroying variable: 20
|
||||
destroying variable: 10
|
||||
|
|
@ -377,4 +378,15 @@ proc text_parser(xml: var XmlParser) =
|
|||
doAssert(test_passed)
|
||||
|
||||
text_parser(xml)
|
||||
text_parser(xml2)
|
||||
text_parser(xml2)
|
||||
|
||||
# bug #15599
|
||||
type
|
||||
PixelBuffer = ref object
|
||||
|
||||
proc newPixelBuffer(): PixelBuffer =
|
||||
new(result) do (buffer: PixelBuffer):
|
||||
echo "ok"
|
||||
|
||||
discard newPixelBuffer()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue