Improve error messages involving ignored variables

Fix #3987
This commit is contained in:
Ajai Nelson 2023-05-23 23:22:52 -04:00 committed by Ajai Nelson
parent 10dd57d45d
commit 2e5fef5231
No known key found for this signature in database
GPG key ID: 8B74EF43FD4CCEFF
14 changed files with 289 additions and 46 deletions

View file

@ -124,18 +124,19 @@ impl<'a> Env<'a> {
Ok(symbol)
}
None => {
let error = RuntimeError::LookupNotInScope(
Loc {
let error = RuntimeError::LookupNotInScope {
loc_name: Loc {
value: Ident::from(ident),
region,
},
scope
suggestion_options: scope
.locals
.ident_ids
.ident_strs()
.map(|(_, string)| string.into())
.collect(),
);
underscored_suggestion_region: None,
};
Err(error)
}
}