From 16231050058131860f710073c17d3bca7c6637eb Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sun, 18 Oct 2026 06:05:53 +0000 Subject: feat(operators): support global binary operator overloads Resolve exact operand types and preserve declared operator return types. Reject implicit STRING to BOOLEAN conversion at typed expression boundaries. Co-Authored-By: Claude Opus 5.5 --- include/cps/FunctionAST.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/cps/FunctionAST.h') diff --git a/include/cps/FunctionAST.h b/include/cps/FunctionAST.h index 716f004..90ef5c4 100644 --- a/include/cps/FunctionAST.h +++ b/include/cps/FunctionAST.h @@ -34,6 +34,7 @@ class PrototypeAST { std::string OwnerClass; bool IsPublic; bool IsVariadic = false; + int Operator = 0; public: PrototypeAST(const std::string &Name, @@ -47,6 +48,8 @@ public: const std::vector &getParams() const { return Params; } const std::string &getReturnType() const { return ReturnType; } bool isOverload() const { return IsOverload; } + int getOperator() const { return Operator; } + void setOperator(int Op) { Operator = Op; } bool isExternal() const { return IsExternal; } bool isVariadic() const { return IsVariadic; } void setVariadic(bool V) { IsVariadic = V; } -- cgit v1.3.1-4-g156e