Open vi opened 3 days ago
@yannham (sorry for pinging) may give you a more complete picture, but essentially nickel export
= nickel eval
+ serialization. As for why typecheck succeeds but eval fails, I'd like to make a rather crude analogy to Python: you have a correctly type annotated python script user-schema.py
, which takes an required argument name
. In this scenario, mypy user-schema.py
will succeed (aka "typecheck"), whereas python user-schema.py
will fail because you do not provide the name
argument.
Describe the bug
Cannot export contracts from files (or rather
nickel eval
files that export contracts), even though it is one of the first features demonstrated in the beginning of the documentation.To Reproduce
{ UserSchema = {
)It displays error
error: missing definition for 'name'
.Expected behavior
No error, maybe it displays the scheme back to you.
If I do the tutorial steps locally,
nickel eval users.ncl
succeeds.nickel typecheck users-schema.ncl
also succeeds, but it is confusing thatnickel eval users-schema.ncl
fails - how can import of a module that fails evaluation succeed?It would be understandable if
nickel export
fail to export something incomplete, butnickel eval
should probably just evaluate the code and print also the incomplete result.The error here looks just like the error when source code is invalid.
I think Playground should also have typecheck button and should also show version of Nickel.