This kind of functions should be forbidden with a decent error message:
let%client f x = ~%( [%client x] )
Right now, it crashes, but it's not obvious why.
The good way to check for this is to walk the typedtree after typechecking, register the (server) env when entering a client scope and check that each identifier mentioned in a server slice (inside the client scope) is defined in the outer env.
This kind of functions should be forbidden with a decent error message:
Right now, it crashes, but it's not obvious why. The good way to check for this is to walk the typedtree after typechecking, register the (server) env when entering a client scope and check that each identifier mentioned in a server slice (inside the client scope) is defined in the outer env.