[fine] Even more resilience, I can stop now
Also fix a bug, could not return from a method OOPS
This commit is contained in:
parent
7f30d0ccc3
commit
f7acfd588d
3 changed files with 9 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue