aboutsummaryrefslogtreecommitdiff
path: root/tests/i/template-multifile/program.cps
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-21 05:54:26 +0000
committer_ov4 <ov4@ov4.org>2026-10-21 05:54:26 +0000
commitc56877035d6600b463a9cbf0e339f7548c0b46fd (patch)
tree5b2af13b7f8f097d8de5436a729b39e85427b9f0 /tests/i/template-multifile/program.cps
parentdd5bbae055fd34ce2e12ef63f8a261c6b15dc83e (diff)
feat(codegen): instantiate function templates by deduction
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/i/template-multifile/program.cps')
-rw-r--r--tests/i/template-multifile/program.cps14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/i/template-multifile/program.cps b/tests/i/template-multifile/program.cps
new file mode 100644
index 0000000..dd0684f
--- /dev/null
+++ b/tests/i/template-multifile/program.cps
@@ -0,0 +1,14 @@
+INCLUDE "lib.cps"
+TYPE Score
+ DECLARE Value : INTEGER
+ENDTYPE
+OVERLOAD FUNCTION OPERATOR>(Left : Score, Right : Score) RETURNS BOOLEAN
+ RETURN Left.Value > Right.Value
+ENDFUNCTION
+DECLARE Low : Score
+DECLARE High : Score
+Low.Value <- 3
+High.Value <- 9
+DECLARE Best : Score
+Best <- Max(Low, High)
+OUTPUT Best.Value