diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2020-05-31 18:29:03 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2020-05-31 18:29:03 -0400 |
commit | 6cc104634ef64be3be88c1fccbe98208d95d8a1a (patch) | |
tree | 9001e5333e808808125978a52669a8bff3639438 /src/elab_err.sml | |
parent | 82fde07cef0e41b700b9a30137562eb05f2f2c6d (diff) | |
parent | c2f1e1096f602b1cbd4531352f3e1ea6d656a186 (diff) |
Merge branch 'dfsg_clean'
Diffstat (limited to 'src/elab_err.sml')
-rw-r--r-- | src/elab_err.sml | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/elab_err.sml b/src/elab_err.sml index 385caca3..834964ae 100644 --- a/src/elab_err.sml +++ b/src/elab_err.sml @@ -40,11 +40,14 @@ val p_kind = P.p_kind datatype kind_error = UnboundKind of ErrorMsg.span * string + | KDisallowedWildcard of ErrorMsg.span fun kindError env err = case err of UnboundKind (loc, s) => - ErrorMsg.errorAt loc ("Unbound kind variable " ^ s) + ErrorMsg.errorAt loc ("Unbound kind variable: " ^ s) + | KDisallowedWildcard loc => + ErrorMsg.errorAt loc "Wildcard not allowed in signature" datatype kunify_error = KOccursCheckFailed of kind * kind @@ -76,15 +79,16 @@ datatype con_error = | DuplicateField of ErrorMsg.span * string | ProjBounds of con * int | ProjMismatch of con * kind + | CDisallowedWildcard of ErrorMsg.span fun conError env err = case err of UnboundCon (loc, s) => - ErrorMsg.errorAt loc ("Unbound constructor variable " ^ s) + ErrorMsg.errorAt loc ("Unbound constructor variable: " ^ s) | UnboundDatatype (loc, s) => - ErrorMsg.errorAt loc ("Unbound datatype " ^ s) + ErrorMsg.errorAt loc ("Unbound datatype: " ^ s) | UnboundStrInCon (loc, s) => - ErrorMsg.errorAt loc ("Unbound structure " ^ s) + ErrorMsg.errorAt loc ("Unbound structure: " ^ s) | WrongKind (c, k1, k2, env', kerr) => (ErrorMsg.errorAt (#2 c) "Wrong kind"; eprefaces' [("Constructor", p_con env c), @@ -92,7 +96,7 @@ fun conError env err = ("Need kind", p_kind env k2)]; kunifyError env' kerr) | DuplicateField (loc, s) => - ErrorMsg.errorAt loc ("Duplicate record field " ^ s) + ErrorMsg.errorAt loc ("Duplicate record field: " ^ s) | ProjBounds (c, n) => (ErrorMsg.errorAt (#2 c) "Out of bounds constructor projection"; eprefaces' [("Constructor", p_con env c), @@ -101,6 +105,8 @@ fun conError env err = (ErrorMsg.errorAt (#2 c) "Projection from non-tuple constructor"; eprefaces' [("Constructor", p_con env c), ("Kind", p_kind env k)]) + | CDisallowedWildcard loc => + ErrorMsg.errorAt loc "Wildcard not allowed in signature" datatype cunify_error = CKind of kind * kind * E.env * kunify_error @@ -195,9 +201,9 @@ val p_pat = P.p_pat fun expError env err = case err of UnboundExp (loc, s) => - ErrorMsg.errorAt loc ("Unbound expression variable " ^ s) + ErrorMsg.errorAt loc ("Unbound expression variable: " ^ s) | UnboundStrInExp (loc, s) => - ErrorMsg.errorAt loc ("Unbound structure " ^ s) + ErrorMsg.errorAt loc ("Unbound structure: " ^ s) | Unify (e, c1, c2, env', uerr) => (ErrorMsg.errorAt (#2 e) "Unification failure"; eprefaces' [("Expression", p_exp env e), @@ -216,7 +222,7 @@ fun expError env err = eprefaces' [("Have", p_con env c1), ("Need", p_con env c2)]) | DuplicatePatternVariable (loc, s) => - ErrorMsg.errorAt loc ("Duplicate pattern variable " ^ s) + ErrorMsg.errorAt loc ("Duplicate pattern variable: " ^ s) | PatUnify (p, c1, c2, env', uerr) => (ErrorMsg.errorAt (#2 p) "Unification failure for pattern"; eprefaces' [("Pattern", p_pat env p), @@ -350,7 +356,7 @@ val p_sgn = P.p_sgn fun sgnError env err = case err of UnboundSgn (loc, s) => - ErrorMsg.errorAt loc ("Unbound signature variable " ^ s) + ErrorMsg.errorAt loc ("Unbound signature variable: " ^ s) | UnmatchedSgi (loc, sgi) => (ErrorMsg.errorAt loc "Unmatched signature item"; eprefaces' [("Item", p_sgn_item env sgi)]) |