Struct members should take in pointer to self

This commit is contained in:
2025-09-01 16:00:54 -04:00
parent cf7d0320af
commit d5c7e2826f

View File

@@ -148,7 +148,7 @@ memberFuncP = do
args <- parens (sepBy (Bind <$> identifier <* symbol ":" <*> typeP) (symbol ","))
retType <- (symbol "->" *> typeP) <|> pure VoidType
body <- braces (many stmtP)
return $ Func name (Bind "self" self : args) retType body
return $ Func name (Bind "self" (PtrType self) : args) retType body
organize :: [TL] -> Program
organize tls = Program structs enums funcs