mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
throw error in canonicalization
This commit is contained in:
parent
28ba645121
commit
46ab922dd1
1 changed files with 11 additions and 3 deletions
|
@ -409,9 +409,17 @@ pub fn canonicalize_expr<'a>(
|
||||||
ast::Expr::Var { module_name, ident } => {
|
ast::Expr::Var { module_name, ident } => {
|
||||||
canonicalize_lookup(env, scope, module_name, ident, region)
|
canonicalize_lookup(env, scope, module_name, ident, region)
|
||||||
}
|
}
|
||||||
ast::Expr::Underscore(_) => {
|
ast::Expr::Underscore(name) => {
|
||||||
// we parse underscored, but they are not valid expression syntax
|
// we parse underscores, but they are not valid expression syntax
|
||||||
todo!("todo")
|
let problem = roc_problem::can::RuntimeError::MalformedIdentifier(
|
||||||
|
(*name).into(),
|
||||||
|
roc_parse::ident::BadIdent::Underscore(region.start_line, region.start_col),
|
||||||
|
region,
|
||||||
|
);
|
||||||
|
|
||||||
|
env.problem(Problem::RuntimeError(problem.clone()));
|
||||||
|
|
||||||
|
(RuntimeError(problem), Output::default())
|
||||||
}
|
}
|
||||||
ast::Expr::Defs(loc_defs, loc_ret) => {
|
ast::Expr::Defs(loc_defs, loc_ret) => {
|
||||||
can_defs_with_return(
|
can_defs_with_return(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue