aboutsummaryrefslogtreecommitdiff
path: root/tests/iii/template-pack-errors
diff options
context:
space:
mode:
Diffstat (limited to 'tests/iii/template-pack-errors')
-rw-r--r--tests/iii/template-pack-errors/case.json32
-rw-r--r--tests/iii/template-pack-errors/program.cps32
2 files changed, 64 insertions, 0 deletions
diff --git a/tests/iii/template-pack-errors/case.json b/tests/iii/template-pack-errors/case.json
new file mode 100644
index 0000000..53b5a23
--- /dev/null
+++ b/tests/iii/template-pack-errors/case.json
@@ -0,0 +1,32 @@
+{
+ "errors": [
+ {
+ "reason": "A pack parameter must be last",
+ "line": 2
+ },
+ {
+ "reason": "pack parameter must use the current template pack and cannot be ARRAY",
+ "line": 6
+ },
+ {
+ "reason": "pack parameter must use the current template pack and cannot be ARRAY",
+ "line": 10
+ },
+ {
+ "reason": "parameter pack must be expanded",
+ "line": 15
+ },
+ {
+ "reason": "Only a parameter pack may be expanded",
+ "line": 20
+ },
+ {
+ "reason": "Only the current template parameter pack may use",
+ "line": 25
+ },
+ {
+ "reason": "template parameter pack requires",
+ "line": 29
+ }
+ ]
+}
diff --git a/tests/iii/template-pack-errors/program.cps b/tests/iii/template-pack-errors/program.cps
new file mode 100644
index 0000000..51ffa46
--- /dev/null
+++ b/tests/iii/template-pack-errors/program.cps
@@ -0,0 +1,32 @@
+TEMPLATE <Rest...>
+PROCEDURE NotLast(Values : Rest..., Extra : INTEGER)
+ENDPROCEDURE
+
+TEMPLATE <Rest...>
+PROCEDURE ArrayPack(Values : ARRAY OF Rest...)
+ENDPROCEDURE
+
+TEMPLATE <T>
+PROCEDURE WrongPack(Values : T...)
+ENDPROCEDURE
+
+TEMPLATE <Rest...>
+PROCEDURE BarePack(Values : Rest...)
+ OUTPUT Values
+ENDPROCEDURE
+
+TEMPLATE <T>
+PROCEDURE ScalarExpansion(Value : T)
+ CALL Missing(Value...)
+ENDPROCEDURE
+
+TEMPLATE <T>
+PROCEDURE WrongTypeExpansion(Value : T)
+ CALL Missing<T...>(Value)
+ENDPROCEDURE
+
+TEMPLATE <Rest...>
+PROCEDURE MissingDots(Values : Rest)
+ENDPROCEDURE
+
+OUTPUT 0