diff --git a/crates/aiken-lang/src/ast.rs b/crates/aiken-lang/src/ast.rs index 7e29b40d..34ce3793 100644 --- a/crates/aiken-lang/src/ast.rs +++ b/crates/aiken-lang/src/ast.rs @@ -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); + } + } + _ => (), }