report a Foo.Bar malformed identifier

This commit is contained in:
Folkert 2020-11-12 20:48:34 +01:00
parent 10255a90b1
commit c05ec12be0
3 changed files with 35 additions and 6 deletions

View file

@ -725,10 +725,11 @@ pub fn canonicalize_expr<'a>(
}
ast::Expr::MalformedIdent(name) => {
use roc_problem::can::RuntimeError::*;
(
RuntimeError(MalformedIdentifier((*name).into(), region)),
Output::default(),
)
let problem = MalformedIdentifier((*name).into(), region);
env.problem(Problem::RuntimeError(problem.clone()));
(RuntimeError(problem), Output::default())
}
ast::Expr::Nested(sub_expr) => {
let (answer, output) = canonicalize_expr(env, var_store, scope, region, sub_expr);