diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-18 06:11:42 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-18 06:11:42 +0000 |
| commit | 5a67f4e3833c2acca4a351f5dd613bc08f04bfc0 (patch) | |
| tree | 6d75f5d13931ba0f7c15d286028049a421a6e974 /tests/iii/operator-result-errors/program.cps | |
| parent | b17f101cfc75565f9991c856ec62f1e17b0ab104 (diff) | |
feat(operators): document overloads and cover remaining operator forms
Add fixed cases for every supported operator, imported global and member
operators, CASE comparisons, and declared result type errors. Document
syntax, exact matching, access rules and temporary receiver lifetimes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/iii/operator-result-errors/program.cps')
| -rw-r--r-- | tests/iii/operator-result-errors/program.cps | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/iii/operator-result-errors/program.cps b/tests/iii/operator-result-errors/program.cps new file mode 100644 index 0000000..8cf9ede --- /dev/null +++ b/tests/iii/operator-result-errors/program.cps @@ -0,0 +1,20 @@ +CLASS Box +Value : INTEGER +OVERLOAD FUNCTION OPERATOR=(rhs : Box) RETURNS STRING +RETURN "text" +ENDFUNCTION +ENDCLASS +DECLARE item : Box +IF item = item THEN +OUTPUT "wrong" +ENDIF +FUNCTION Bad(value : Box) RETURNS BOOLEAN +RETURN value = value +ENDFUNCTION +FUNCTION NeedBool(flag : BOOLEAN) RETURNS INTEGER +RETURN 0 +ENDFUNCTION +OUTPUT NeedBool(item = item) +CASE OF item +item : OUTPUT "wrong" +ENDCASE |
