first steps of making 'opt' a first class type for Nim

This commit is contained in:
Andreas Rumpf 2017-09-25 13:19:36 +02:00
commit f7f3a25be8
20 changed files with 198 additions and 35 deletions

View file

@ -144,7 +144,7 @@ proc storeAux(dest, src: pointer, mt: PNimType, t: PRawChannel,
for i in 0..(mt.size div mt.base.size)-1:
storeAux(cast[pointer](d +% i*% mt.base.size),
cast[pointer](s +% i*% mt.base.size), mt.base, t, mode)
of tyRef:
of tyRef, tyOptAsRef:
var s = cast[PPointer](src)[]
var x = cast[PPointer](dest)
if s == nil: