From db8c7f14d2f74c3db205782acf8222cb7d91a047 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 21 Oct 2026 06:14:00 +0000 Subject: feat(codegen): instantiate class templates Co-Authored-By: Claude Opus 5.5 --- tests/iii/template-class-errors/case.json | 8 ++++++++ tests/iii/template-class-errors/program.cps | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/iii/template-class-errors/case.json create mode 100644 tests/iii/template-class-errors/program.cps (limited to 'tests/iii/template-class-errors') diff --git a/tests/iii/template-class-errors/case.json b/tests/iii/template-class-errors/case.json new file mode 100644 index 0000000..100438f --- /dev/null +++ b/tests/iii/template-class-errors/case.json @@ -0,0 +1,8 @@ +{ + "errors": [ + {"reason": "No matching overload for Make", "line": 10}, + {"reason": "Wrong number of template arguments for Box", "line": 11}, + {"reason": "Class template Box requires template arguments", "line": 12}, + {"reason": "Unknown or invalid template argument Nope for Box", "line": 13} + ] +} diff --git a/tests/iii/template-class-errors/program.cps b/tests/iii/template-class-errors/program.cps new file mode 100644 index 0000000..67f8db4 --- /dev/null +++ b/tests/iii/template-class-errors/program.cps @@ -0,0 +1,13 @@ +TEMPLATE +CLASS Box + Value : T +ENDCLASS +TEMPLATE +FUNCTION Make() RETURNS T + DECLARE Value : T + RETURN Value +ENDFUNCTION +OUTPUT Make>() +DECLARE TooMany : Box +DECLARE TooFew : Box +DECLARE Unknown : Box -- cgit v1.3.1-4-g156e