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 --- doc/language/keyword/cpsc-keyword-operator.7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/language/keyword/cpsc-keyword-operator.7.md') diff --git a/doc/language/keyword/cpsc-keyword-operator.7.md b/doc/language/keyword/cpsc-keyword-operator.7.md index 6c29370..134d3f2 100644 --- a/doc/language/keyword/cpsc-keyword-operator.7.md +++ b/doc/language/keyword/cpsc-keyword-operator.7.md @@ -29,7 +29,7 @@ OPERATOR is a compiler extension, absent from the CIE guide. Declare unary and b Binary operators are `+ - * / DIV MOD & = <> < <= > >= AND OR`. Unary operators are `- NOT`. A global binary definition takes two parameters and a unary definition takes one; at least one parameter must be a record, class or enum. A pointer alias alone does not qualify. A member binary definition takes one explicit parameter and a unary definition takes none; this supplies the left or sole operand. PUBLIC and PRIVATE precede OVERLOAD as for other methods. -Operands match exact static types, without implicit conversions, following OVERLOAD rules. For example, an INTEGER operand does not match a REAL parameter. Visible global definitions and methods of the left operand's class participate together. The selected method must be accessible: PRIVATE never causes a public fallback. Included units provide operators using the ordinary INCLUDE visibility rules. +Operands prefer exact static types, following OVERLOAD rules. When no exact candidate or directly supported built-in operation applies, BYVAL operands may use IMPLICIT constructors; see [cpsc-keyword-implicit(7)](cpsc-keyword-implicit.7.md). For example, an INTEGER operand does not match a REAL parameter. Visible global definitions and methods of the left operand's class participate together. The selected method must be accessible: PRIVATE never causes a public fallback. Included units provide operators using the ordinary INCLUDE visibility rules. Return types also distinguish operator overloads. When the context requires a result type (assignment, RETURN, condition, CASE comparison, subscript and similar positions), only definitions returning exactly that type match; if the operands match but no result does, the error is `No matching overload for OPERATOR +(T, U) returning R`. A cast `(R) expr` only prefers R and otherwise selects by operands before converting. Without an expected result type, such as OUTPUT or an operand of another operator, a unique operand match is selected; definitions that differ only by return type need a `RETURNS DEFAULT type` declaration to avoid ambiguity. DEFAULT follows the same rules as ordinary functions and does not resolve global/member operator ties; see [cpsc-keyword-default(7)](cpsc-keyword-default.7.md). -- cgit v1.3.1-4-g156e