mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
parent
10dd57d45d
commit
2e5fef5231
14 changed files with 289 additions and 46 deletions
|
@ -1019,9 +1019,18 @@ pub fn canonicalize_expr<'a>(
|
|||
}
|
||||
ast::Expr::Underscore(name) => {
|
||||
// we parse underscores, but they are not valid expression syntax
|
||||
|
||||
let problem = roc_problem::can::RuntimeError::MalformedIdentifier(
|
||||
(*name).into(),
|
||||
roc_parse::ident::BadIdent::Underscore(region.start()),
|
||||
if name.is_empty() {
|
||||
roc_parse::ident::BadIdent::UnderscoreAlone(region.start())
|
||||
} else {
|
||||
roc_parse::ident::BadIdent::UnderscoreAtStart {
|
||||
position: region.start(),
|
||||
// Check if there's an ignored identifier with this name in scope (for better error messages)
|
||||
declaration_region: scope.lookup_ignored_local(name),
|
||||
}
|
||||
},
|
||||
region,
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue