From 9b2d82dadbb465de71985a8db3aa8df454579b72 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 30 Oct 2026 14:33:33 +0000 Subject: docs(types): explain implicit constructors and raw text literals Co-Authored-By: Claude Opus 5.5 --- AGENTS/SUBSYSTEMS/FUNCTIONS.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'AGENTS/SUBSYSTEMS/FUNCTIONS.md') diff --git a/AGENTS/SUBSYSTEMS/FUNCTIONS.md b/AGENTS/SUBSYSTEMS/FUNCTIONS.md index 9555f1d..222d4da 100644 --- a/AGENTS/SUBSYSTEMS/FUNCTIONS.md +++ b/AGENTS/SUBSYSTEMS/FUNCTIONS.md @@ -27,7 +27,9 @@ internal __cps_main). - `emitPrototype` records each function's pseudocode signature in a `FuncSig` overload-set map (`FunctionGen::getOverloads`, filtered by unit visibility). -- `resolveCall` selects exact static parameter types/ranks for OVERLOAD. When the call +- `resolveCall` prefers exact static parameter types/ranks for OVERLOAD, then + marked constructor conversions for scalar BYVAL parameters. BYREF and arrays + remain exact; a single call never chains IMPLICIT constructors. When the call site has an expected result type, the candidate must also return exactly that type; a cast only prefers it. Without a context, return-only-distinct candidates use the unique DEFAULT return, otherwise they are ambiguous. A single ordinary definition keeps implicit conversions. @@ -57,7 +59,8 @@ internal __cps_main). - PrototypeAST retains the operator token; FunctionGen validates operand count and requires a record/class/enum operand. -- Global signatures and left-class methods share exact-type selection, used by +- Global signatures and left-class methods share exact-first selection with + marked BYVAL construction as fallback, used by ValueTypeGen and ExpressionGen before builtin operations and filtered by an expected result type where present. A strict context whose operands match but whose result does not sets `WrongResult`. Missing candidates leave builtin rules intact; ties are -- cgit v1.3.1-4-g156e