From 98b02446ba4d8ab4d032b250c5a53db1db6feefd Mon Sep 17 00:00:00 2001 From: fanoll Date: Mon, 10 Jun 2024 12:53:59 +0200 Subject: [PATCH] remove unused thisMeth type. Returns are combined and already checked against return Type --- src/Typecheck.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Typecheck.hs b/src/Typecheck.hs index ac08d39..fd58f17 100644 --- a/src/Typecheck.hs +++ b/src/Typecheck.hs @@ -21,7 +21,7 @@ typeCheckMethodDeclaration (MethodDeclaration retType name params body) classFie let -- Combine class fields with method parameters to form the initial symbol table for the method methodParams = [(identifier, dataType) | ParameterDeclaration dataType identifier <- params] - initialSymtab = ("thisMeth", retType) : classFields ++ methodParams + initialSymtab = classFields ++ methodParams checkedBody = typeCheckStatement body initialSymtab classes bodyType = getTypeFromStmt checkedBody -- Check if the type of the body matches the declared return type