From 7894dbb25d43649c5a893d1de5fe8475cc726948 Mon Sep 17 00:00:00 2001 From: Kathy Gray Date: Thu, 3 Mar 2016 14:43:09 +0000 Subject: Fix typo in manual which had true instead of false on assert documentation Fix bug in local register access --- language/l2.ott | 2 +- language/manual.pdf | Bin 342588 -> 342680 bytes src/type_check.ml | 4 +++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/language/l2.ott b/language/l2.ott index f750832a..345c7707 100644 --- a/language/l2.ott +++ b/language/l2.ott @@ -665,7 +665,7 @@ exp :: 'E_' ::= | exit exp :: :: exit {{ com expression to halt all current execution, potentially calling a system, trap, or interrupt handler with exp }} | assert ( exp , exp' ) :: :: assert - {{ com expression to halt with error, when the first expression is true, reporting the optional string as an error }} + {{ com expression to halt with error, when the first expression is false, reporting the optional string as an error }} | ( exp ) :: S :: paren {{ ichlo [[exp]] }} | ( annot ) exp :: :: internal_cast {{ com This is an internal cast, generated during type checking that will resolve into a syntactic cast after }} | annot :: :: internal_exp {{ com This is an internal use for passing nexp information to library functions, postponed for constraint solving }} diff --git a/language/manual.pdf b/language/manual.pdf index 6dfb546e..605bccbd 100644 Binary files a/language/manual.pdf and b/language/manual.pdf differ diff --git a/src/type_check.ml b/src/type_check.ml index e3cdb4ac..61b94ad3 100644 --- a/src/type_check.ml +++ b/src/type_check.ml @@ -536,7 +536,9 @@ let rec check_exp envs (imp_param:nexp option) (widen:bool) (expect_t:t) (E_aux( | Tapp("register",[TA_typ(t')]),Tuvar _ -> (*let ef' = add_effect (BE_aux(BE_rreg,l)) ef in let tannot = Base(([],t),(if is_alias then tag else External (Some i)),cs,ef',ef',bounds) in*) - let tannot = Base(([],t),(if is_alias then tag else Emp_global),cs,pure_e,pure_e,bounds) in + let tannot = Base(([],t), + (if is_alias then tag else (if tag = Emp_local then tag else Emp_global)), + cs,pure_e,pure_e,bounds) in let _,cs',ef',e' = type_coerce (Expr l) d_env Require false false b_env t' (rebuild tannot) expect_actual in (e',t,t_env,cs@cs',bounds,ef') | Tapp("register",[TA_typ(t')]),_ -> -- cgit v1.2.3