[fine] Even more resilience, I can stop now

Also fix a bug, could not return from a method OOPS
This commit is contained in:
John Doty 2024-02-01 06:35:43 -08:00
parent 7f30d0ccc3
commit f7acfd588d
3 changed files with 9 additions and 2 deletions

View file

@ -1907,7 +1907,7 @@ fn check_return_statement(s: &Semantics, tree: &Tree) {
let function_type = s.type_of(enclosing_function);
match function_type {
Type::Function(_, expected_type) => {
Type::Function(_, expected_type) | Type::Method(_, _, expected_type) => {
let actual_type = if let Some(expr) = tree.nth_tree(1) {
s.type_of(expr)
} else {