You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But this code gives meaningful error message during compilation:
procfinalize[T](x: ref T) =discardprocfinfin[T](customFin: proc (x: ref T)): proc (x: ref T) =# proc out0(x: ref T) =# customFin(x)# finalize(x)
finalize
procnewNew*[T](customFin: proc (x: ref T)): ref T =new(result, finfin(customFin))
let i =newNew[int](nil)
echo i
noncompiles2.nim(12, 15) template/generic instantiation from here
noncompiles2.nim(10, 6) Error: type mismatch: got (ref int, proc (x: ref int){.closure.})
but expected one of:
system.new(a: var ref T, finalizer: proc (x: ref T))
system.new(T: typedesc)
system.new(a: var ref T)
> git log -1
commit 68f583ddb7a3e1a9fe8d004fef199d3e1c0bb342
Author: Dominik Picheta <dominikpicheta@googlemail.com>
Date: Mon Jun 22 21:40:38 2015 +0100
Adjustments to #2610.
The text was updated successfully, but these errors were encountered:
yekimov
changed the title
Compiler crushed, but there have to be error meaningful message
Compiler crushed, but there have to be meaningful error message
Jun 23, 2015
reactormonk
changed the title
Compiler crushed, but there have to be meaningful error message
Compiler crashed, but there have to be meaningful error message
Jun 23, 2015
Here is the snippet of code, which leads to compiler crush:
But this code gives meaningful error message during compilation:
The text was updated successfully, but these errors were encountered: