         case .class(let name, let methods):
             resolver.declare(name)
             resolver.define(name)
+            let enclosingClass = resolver.currentClass
+            resolver.currentClass = .class
             
             resolver.begin()
             resolver.defineThis()

                value: value.resolve(resolver: resolver))
        
        case .this(let keyword):
            let depth = resolver.resolveLocal(keyword)
            return .this(keyword: keyword, depth: depth)
        }

            }
            
            resolver.end()
            
            resolver.currentClass = enclosingClass
            
            return .class(name: name, methods: resolvedMethods)
            
