From 406400bf71d87bb6976fa4f8198b0a4888f5fc69 Mon Sep 17 00:00:00 2001
From: Emmanuel Benoit <tseeker@nocternity.net>
Date: Wed, 11 Jan 2023 15:29:48 +0100
Subject: [PATCH] Resolver - Don't reset scope types while parsing function
 blocks

---
 src/resolver.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/resolver.rs b/src/resolver.rs
index fa47279..ecc6d83 100644
--- a/src/resolver.rs
+++ b/src/resolver.rs
@@ -262,7 +262,7 @@ where
     }
     // Unlike the original Lox, function arguments and function bodies do
     // 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.