From c682f983b0dce3acba76d1f08719a26b9c52c5ec Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 20 Oct 2026 13:07:03 +0000 Subject: test(strings): align error cases with the standard library Co-Authored-By: Claude Opus 5.5 --- tests/iii/operator-global-errors/notes.md | 2 +- tests/iii/operator-global-errors/program.cps | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/iii/operator-global-errors') diff --git a/tests/iii/operator-global-errors/notes.md b/tests/iii/operator-global-errors/notes.md index 24bb113..ef5c9c2 100644 --- a/tests/iii/operator-global-errors/notes.md +++ b/tests/iii/operator-global-errors/notes.md @@ -1,3 +1,3 @@ # operator-global-errors -Reject a STRING comparison result assigned to BOOLEAN, implicit INTEGER-to-REAL overload matching, builtin-only overloads, wrong arity and return-type-only duplicates. +Reject a STRING comparison result assigned to BOOLEAN, implicit INTEGER-to-REAL overload matching, operator overloads with only INTEGER operands, wrong arity and return-type-only duplicates. STRING is a class and can participate in operator overloads, so the invalid declaration uses INTEGER for both operands. diff --git a/tests/iii/operator-global-errors/program.cps b/tests/iii/operator-global-errors/program.cps index 23bfae1..b9d007a 100644 --- a/tests/iii/operator-global-errors/program.cps +++ b/tests/iii/operator-global-errors/program.cps @@ -11,7 +11,7 @@ DECLARE a : Box DECLARE flag : BOOLEAN flag <- a < a OUTPUT a + 1 -OVERLOAD FUNCTION OPERATOR&(a : INTEGER, b : STRING) RETURNS STRING +OVERLOAD FUNCTION OPERATOR&(a : INTEGER, b : INTEGER) RETURNS INTEGER RETURN b ENDFUNCTION OVERLOAD FUNCTION OPERATOR*(a : Box) RETURNS INTEGER -- cgit v1.3.1-4-g156e