Skip to content

Commit

Permalink
Implement reviewer suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: jneem <joeneeman@gmail.com>
  • Loading branch information
yannham and jneem committed Feb 15, 2024
1 parent 81018e4 commit 2c206c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions core/src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1324,12 +1324,8 @@ impl IntoDiagnostics<FileId> for EvalError {
);

vec![Diagnostic::error()
.with_message("non-exhaustive pattern matching")
.with_labels(labels)
.with_notes(vec![
format!("This match expression isn't exhaustive"),
"It has been applied to an argument which doesn't match any of the branches".to_owned(),
])]
.with_message("unmatched pattern")
.with_labels(labels)]
}
EvalError::IllegalPolymorphicTailAccess {
action,
Expand Down
4 changes: 2 additions & 2 deletions core/src/term/pattern/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::{
term::{make, BinaryOp, MatchData, RecordExtKind, RecordOpKind, RichTerm, Term, UnaryOp},
};

/// Generate a standard `%record_insert` primop as generated by the parser.
/// Generate a standard `%record_insert%` primop as generated by the parser.
fn record_insert() -> BinaryOp {
BinaryOp::DynExtend {
ext_kind: RecordExtKind::WithValue,
Expand Down Expand Up @@ -393,7 +393,7 @@ impl Compile for MatchData {
//
// let value_id = value in
//
// <for (pattern, body) in branches.rev()
// <fold (pattern, body) in branches.rev()
// - cont is the accumulator
// - initial accumulator is the default branch (or error if not default branch)
// >
Expand Down
2 changes: 1 addition & 1 deletion core/src/typecheck/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ pub fn get_uop_type(
// Note that is_variant breaks parametricity, so it can't get a polymorphic type.
// Dyn -> Bool
UnaryOp::EnumIsVariant() => (mk_uniftype::dynamic(), mk_uniftype::bool()),
// [crate::term::UnaryOp::WithEnv] shouldn't appear anywhere in actual code, because its
// [crate::term::UnaryOp::PatternBranch] shouldn't appear anywhere in actual code, because its
// second argument can't be properly typechecked: it has unbound variables. However, it's
// not hard to come up with a vague working type for it, so we do.
// forall a. {_ : a} -> Dyn -> Dyn
Expand Down

0 comments on commit 2c206c6

Please sign in to comment.