Resolver - Don't reset scope types while parsing function blocks

This commit is contained in:
Emmanuel BENOîT 2023-01-11 15:29:48 +01:00
parent aa48973e23
commit 406400bf71

View file

@ -262,7 +262,7 @@ where
} }
// Unlike the original Lox, function arguments and function bodies do // Unlike the original Lox, function arguments and function bodies do
// not use the same environment. // not use the same environment.
rs.with_scope(|rs| body.resolve(rs), ScopeType::Function) rs.with_scope(|rs| body.resolve(rs), rs.current_type())
} }
/// Process all method definitions in a class. /// Process all method definitions in a class.