mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
error message for record update and missing module
This commit is contained in:
parent
27317110f2
commit
331a8ed5eb
8 changed files with 153 additions and 8 deletions
|
@ -214,10 +214,17 @@ pub fn canonicalize_expr<'a>(
|
|||
|
||||
(answer, output)
|
||||
} else {
|
||||
panic!(
|
||||
"TODO canonicalize invalid record update (non-Var in update position)\n{:?}",
|
||||
can_update.value
|
||||
);
|
||||
// only (optionally qualified) variables can be updated, not arbitrary expressions
|
||||
|
||||
let error = roc_problem::can::RuntimeError::InvalidRecordUpdate {
|
||||
region: can_update.region,
|
||||
};
|
||||
|
||||
let answer = Expr::RuntimeError(error.clone());
|
||||
|
||||
env.problems.push(Problem::RuntimeError(error));
|
||||
|
||||
(answer, Output::default())
|
||||
}
|
||||
}
|
||||
ast::Expr::Record {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue