diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-18 06:09:01 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-18 06:09:01 +0000 |
| commit | b17f101cfc75565f9991c856ec62f1e17b0ab104 (patch) | |
| tree | 6c925f06c45dbaa557a0451cfca33f17be71ec67 /tests/iii/operator-member-errors/program.cps | |
| parent | 16231050058131860f710073c17d3bca7c6637eb (diff) | |
feat(operators): add member and unary overloads with explicit calls
Select member and global candidates together, enforce private access, and
reuse argument marshalling. Materialize temporary receivers for chaining
and register them for the existing object cleanup mechanism.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/iii/operator-member-errors/program.cps')
| -rw-r--r-- | tests/iii/operator-member-errors/program.cps | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/iii/operator-member-errors/program.cps b/tests/iii/operator-member-errors/program.cps new file mode 100644 index 0000000..9b48135 --- /dev/null +++ b/tests/iii/operator-member-errors/program.cps @@ -0,0 +1,18 @@ +CLASS Box +Value : INTEGER +OVERLOAD FUNCTION OPERATOR+(rhs : Box) RETURNS INTEGER +RETURN 1 +ENDFUNCTION +PRIVATE OVERLOAD FUNCTION OPERATOR&(rhs : STRING) RETURNS STRING +RETURN rhs +ENDFUNCTION +ENDCLASS +OVERLOAD FUNCTION OPERATOR+(lhs : Box, rhs : Box) RETURNS INTEGER +RETURN 2 +ENDFUNCTION +DECLARE a : Box +OUTPUT a + a +OUTPUT a & "x" +OUTPUT a.OPERATOR&("x") +DECLARE items : ARRAY[1:2] OF Box +OUTPUT NOT items |
