Add a conversion from our high-level IR to a lower-level one.
This commit is contained in:
@@ -159,17 +159,15 @@ impl From<Error> for Diagnostic<usize> {
|
||||
},
|
||||
|
||||
Error::UnboundVariable(location, name) => match location {
|
||||
Location::Manufactured => Diagnostic::error().with_message(format!(
|
||||
"Unbound variable '{}'",
|
||||
name
|
||||
)),
|
||||
Location::Manufactured => {
|
||||
Diagnostic::error().with_message(format!("Unbound variable '{}'", name))
|
||||
}
|
||||
Location::InFile(file_id, offset) => Diagnostic::error()
|
||||
.with_labels(vec![
|
||||
Label::primary(*file_id, *offset..*offset).with_message("unbound here")
|
||||
])
|
||||
.with_message(format!("Unbound variable '{}'", name)),
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user