fix: some bugs

Fixed:

* argument `_` of anonymous function disappears
* els crashes
* incomplete `.update!` codegen
This commit is contained in:
Shunsuke Shibayama 2023-02-13 15:06:50 +09:00
parent da7ff0a258
commit 2574de3a68
7 changed files with 121 additions and 50 deletions

View file

@ -38,7 +38,9 @@ impl<Checker: BuildRunnable> Server<Checker> {
.filter(|warn| warn.core.main_message.ends_with("is not used"))
.collect::<Vec<_>>();
for warn in warns {
let range = util::loc_to_range(warn.core.loc).unwrap();
let Some(range) = util::loc_to_range(warn.core.loc) else {
continue;
};
match visitor.get_min_expr(range) {
Some(Expr::Def(def)) => {
let Some(mut range) = util::loc_to_range(def.loc()) else {