Checkpoint
This commit is contained in:
@@ -85,9 +85,9 @@ impl Location {
|
||||
/// the user with some guidance. That being said, you still might want to add
|
||||
/// even more information to ut, using [`Diagnostic::with_labels`],
|
||||
/// [`Diagnostic::with_notes`], or [`Diagnostic::with_code`].
|
||||
pub fn labelled_error(&self, msg: &str) -> Diagnostic<usize> {
|
||||
pub fn labelled_error<T: AsRef<str>>(&self, msg: T) -> Diagnostic<usize> {
|
||||
Diagnostic::error().with_labels(vec![
|
||||
Label::primary(self.file_idx, self.location.clone()).with_message(msg)
|
||||
Label::primary(self.file_idx, self.location.clone()).with_message(msg.as_ref())
|
||||
])
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ impl TopLevel {
|
||||
for arg in arguments.iter() {
|
||||
bound_variables.insert(arg.name.clone(), arg.location.clone());
|
||||
}
|
||||
let result = body.validate(&bound_variables);
|
||||
let result = body.validate(bound_variables);
|
||||
bound_variables.release_scope();
|
||||
result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user