Open
Description
Example
type
C = object
heaped: ref array[1, uint8]
proc `=copy`(dst: var C, src: C) =
if dst.heaped != src.heaped:
new(dst.heaped)
dst.heaped[] = src.heaped[]
proc newC(): C =
C(heaped: new(array[1, uint8]))
var c = newC()
Actual Output
$ ./koch.py temp e test.nim
bin/nim_temp e test.nim
compiler/nim.nim(154) nim
compiler/nim.nim(89) handleCmdLine
compiler/front/main.nim(695) mainCommand
compiler/front/scripting.nim(231) runNimScript
compiler/sem/passes.nim(275) processModule
compiler/sem/passes.nim(102) processTopLevelStmt
compiler/vm/compilerbridge.nim(724) myProcess
compiler/vm/compilerbridge.nim(413) evalStmt
compiler/vm/compilerbridge.nim(353) execute
compiler/vm/compilerbridge.nim(329) execute
compiler/vm/vmjit.nim(314) compile
compiler/vm/vmjit.nim(269) genProc
compiler/backend/backends.nim(403) generateIR
compiler/backend/cgirgen.nim(812) generateIR
compiler/backend/cgirgen.nim(796) tb
compiler/backend/cgirgen.nim(776) scopeToIr
compiler/backend/cgirgen.nim(643) stmtToIr
compiler/utils/idioms.nim(36) unreachableImpl
lib/system/assertions.nim(28) raiseAssert
lib/system/fatal.nim(50) sysFatal
Error: unhandled exception: cgirgen.nim(643, 16) unreachable: a 'destroy' that wasn't lowered [AssertionDefect]
Additional Information
- Runs fine with JS and native backends