diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-21 06:14:00 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-21 06:14:00 +0000 |
| commit | db8c7f14d2f74c3db205782acf8222cb7d91a047 (patch) | |
| tree | 31b6e17c0cb818ba0cc700cd1e0ca896a6b9156f /tests/iii | |
| parent | 25ae363250e479701ed532c55c255e043c8240da (diff) | |
feat(codegen): instantiate class templates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/iii')
| -rw-r--r-- | tests/iii/template-class-errors/case.json | 8 | ||||
| -rw-r--r-- | tests/iii/template-class-errors/program.cps | 13 | ||||
| -rw-r--r-- | tests/iii/template-class-pack-field/case.json | 5 | ||||
| -rw-r--r-- | tests/iii/template-class-pack-field/program.cps | 5 |
4 files changed, 31 insertions, 0 deletions
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 <T> +CLASS Box + Value : T +ENDCLASS +TEMPLATE <T> +FUNCTION Make() RETURNS T + DECLARE Value : T + RETURN Value +ENDFUNCTION +OUTPUT Make<Box<Nope>>() +DECLARE TooMany : Box<INTEGER, REAL> +DECLARE TooFew : Box +DECLARE Unknown : Box<Nope> diff --git a/tests/iii/template-class-pack-field/case.json b/tests/iii/template-class-pack-field/case.json new file mode 100644 index 0000000..2ad0199 --- /dev/null +++ b/tests/iii/template-class-pack-field/case.json @@ -0,0 +1,5 @@ +{ + "errors": [ + {"reason": "pack.*field|field.*pack", "line": 3} + ] +} diff --git a/tests/iii/template-class-pack-field/program.cps b/tests/iii/template-class-pack-field/program.cps new file mode 100644 index 0000000..83f30bb --- /dev/null +++ b/tests/iii/template-class-pack-field/program.cps @@ -0,0 +1,5 @@ +TEMPLATE <Rest...> +CLASS Invalid + Values : Rest... +ENDCLASS +OUTPUT 0 |
