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/CodeGen.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/cps/CodeGen.h') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index d81a82c..30e6d06 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -155,6 +155,11 @@ class CodeGen { const std::vector> &ArgExprs, int Line); const FuncSig *resolveCall(const std::string &Name, const std::vector> &Args); + struct OperatorResolution { + const FuncSig *Signature = nullptr; + bool Ambiguous = false; + }; + OperatorResolution resolveOperator(int Op, const TypeInfo *Left, const TypeInfo *Right = nullptr); llvm::Value *emitVariadicArgument(ExprAST *Expr, const std::string &Callee, size_t Position); bool marshalCallArgs(const FuncSig &Signature, const std::vector> &ArgExprs, -- cgit v1.3.1-4-g156e