[Git][monnier/typer][graveline] Corrected macro type in default attribute and eval_test.ml
Jonathan Graveline pushed to branch graveline at Stefan / Typer Commits: 81821861 by Jonathan Graveline at 2018-07-11T19:57:31Z Corrected macro type in default attribute and eval_test.ml - - - - - 2 changed files: - src/elab.ml - tests/eval_test.ml Changes: ===================================== src/elab.ml ===================================== @@ -479,8 +479,10 @@ and get_implicit_arg ctx loc oname t = (* get the sexp returned by the macro *) let lsarg = match v with - | Vsexp (sexp) -> sexp - | _ -> value_fatal loc v "default attribute should return a sexp" in + | Vcommand cmd -> ( match (cmd ()) with + | Vsexp (sexp) -> sexp + | _ -> value_fatal loc v "default attribute should return a IO Sexp" ) + | _ -> value_fatal loc v "default attribute should return a IO Sexp" in (* Elaborate the argument *) check lsarg t ctx ===================================== tests/eval_test.ml ===================================== @@ -352,7 +352,8 @@ let _ = test_eval_eqv_named "Implicit Arguments" "default = new-attribute Macro; - default = add-attribute default Int (macro (lambda (lst : List Sexp) -> Sexp_integer (Int->Integer 1))); + default = add-attribute default Int (macro (lambda (lst : List Sexp) -> + (IO_return (Sexp_integer (Int->Integer 1))))); fun = lambda (x : Int) => lambda (y : Int) -> View it on GitLab: https://gitlab.com/monnier/typer/commit/8182186174a37249b5f2671e09aead3e00d3... -- View it on GitLab: https://gitlab.com/monnier/typer/commit/8182186174a37249b5f2671e09aead3e00d3... You're receiving this email because of your account on gitlab.com.
Afficher les réponses par date
participants (1)
-
Jonathan Graveline