repro:
using import Array
using import Rc
using import enum
enum StorageKind
Pointer : (Rc this-type)
Function : (Rc (Array this-type))
TypeReference : Symbol
inline __copy (self)
'apply self
inline (T ...)
# uncomment next line to see corruption
# print ...
T
va-map
inline (arg)
copy arg
...
fn myfn (n)
returning (uniqueof StorageKind -1)
# ONLY HAPPENS WITH MATCH! NO SWITCH
match n
case 0
let newST =
copy
this-function (n + 1)
StorageKind.Pointer (Rc.wrap newST)
case 1
local args : (Array StorageKind)
'append args
copy
this-function (n + 1)
# doesn't happen without this return.
return
StorageKind.Function (Rc.wrap (deref args))
default
StorageKind.TypeReference 'unknown
myfn 0
none
Doesn't reproduce anymore. Probably fixed together with #12.