ocsigen / eliomlang

Runtime and tools for the eliom language
ISC License
9 stars 1 forks source link

Forbid wrong form of injections #13

Open Drup opened 8 years ago

Drup commented 8 years ago

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.