fix: forgot to handle None case for other_fun in validator

This commit is contained in:
rvcas 2023-11-29 21:24:30 -05:00
parent 1503b525b2
commit c50d4d1396
No known key found for this signature in database
GPG Key ID: C09B64E263F7D68C
1 changed files with 11 additions and 6 deletions

View File

@ -427,12 +427,6 @@ impl TypedDefinition {
// Note that the fn span covers the function head, not
// the entire statement.
match self {
Definition::Fn(Function { body, .. }) | Definition::Test(Function { body, .. }) => {
if let Some(located) = body.find_node(byte_index) {
return Some(located);
}
}
Definition::Validator(Validator {
fun: Function { body, .. },
other_fun:
@ -450,6 +444,17 @@ impl TypedDefinition {
}
}
Definition::Fn(Function { body, .. })
| Definition::Test(Function { body, .. })
| Definition::Validator(Validator {
fun: Function { body, .. },
..
}) => {
if let Some(located) = body.find_node(byte_index) {
return Some(located);
}
}
_ => (),
}