From c56877035d6600b463a9cbf0e339f7548c0b46fd Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 21 Oct 2026 05:54:26 +0000 Subject: feat(codegen): instantiate function templates by deduction Co-Authored-By: Claude Opus 5.5 --- tests/iii/template-deduction-errors/case.json | 1 + tests/iii/template-deduction-errors/program.cps | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 tests/iii/template-deduction-errors/case.json create mode 100644 tests/iii/template-deduction-errors/program.cps (limited to 'tests/iii/template-deduction-errors') diff --git a/tests/iii/template-deduction-errors/case.json b/tests/iii/template-deduction-errors/case.json new file mode 100644 index 0000000..f60833d --- /dev/null +++ b/tests/iii/template-deduction-errors/case.json @@ -0,0 +1 @@ +{"errors": [{"reason": "No matching overload for Max", "line": 9}, {"reason": "No matching overload for Undeducible", "line": 10}]} diff --git a/tests/iii/template-deduction-errors/program.cps b/tests/iii/template-deduction-errors/program.cps new file mode 100644 index 0000000..7ec1584 --- /dev/null +++ b/tests/iii/template-deduction-errors/program.cps @@ -0,0 +1,10 @@ +TEMPLATE +FUNCTION Max(A : T, B : T) RETURNS T + RETURN A +ENDFUNCTION +TEMPLATE +FUNCTION Undeducible() RETURNS T + RETURN 0 +ENDFUNCTION +OUTPUT Max(1, 2.5) +OUTPUT Undeducible() -- cgit v1.3.1-4-g156e