Open bhansconnect opened 1 year ago
@ayazhafiz I thought I would ping you directly to point you to this issue. This is work specifically related to inspect (Richard wants to look into giving inspect a more powerful api). Currently, the api isn't fully possible because it is causing the compiler to crash. Any ideas/workarounds?
let's discuss on Zulip. I have some thoughts on this.
So as a workaround, just inspectPerson
needs to be modified.
Instead of just returning appendRecord
, it needs to wrap everything in a lambda and apply it.
inspectPerson = \@Person { firstName } ->
f <- custom
fields : List {key: Inspector f, value: Inspector f}
fields = [
{
key: appendStr "firstName",
value: appendStr firstName,
},
]
apply (appendRecord fields) f
The below ability works with simpler functions, like
appendStr
, butappendRecord
will not compile. I am assuming it is related to taking anInspector f
as part of the input type. Don't really know though. I tried to minimize what I could.Just run
roc test
on:The specific error is:
As an extra notes, as I was testing, I also hit some stack overflows. So there may be more than one issue/error.