aboutsummaryrefslogtreecommitdiff
path: root/tests/iii/identifier-variable-collision
diff options
context:
space:
mode:
Diffstat (limited to 'tests/iii/identifier-variable-collision')
-rw-r--r--tests/iii/identifier-variable-collision/case.json8
-rw-r--r--tests/iii/identifier-variable-collision/notes.md3
-rw-r--r--tests/iii/identifier-variable-collision/program.cps2
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/iii/identifier-variable-collision/case.json b/tests/iii/identifier-variable-collision/case.json
new file mode 100644
index 0000000..b50d602
--- /dev/null
+++ b/tests/iii/identifier-variable-collision/case.json
@@ -0,0 +1,8 @@
+{
+ "errors": [
+ {
+ "reason": "Declaration\\ of\\ counter\\ conflicts\\ with\\ an\\ existing\\ declaration\\ in\\ this\\ scope",
+ "line": 2
+ }
+ ]
+}
diff --git a/tests/iii/identifier-variable-collision/notes.md b/tests/iii/identifier-variable-collision/notes.md
new file mode 100644
index 0000000..a25de06
--- /dev/null
+++ b/tests/iii/identifier-variable-collision/notes.md
@@ -0,0 +1,3 @@
+# identifier-variable-collision
+
+The compiler must reject this program: Declaration of counter conflicts with an existing declaration in this scope. The diagnostic must identify line 2; compilation must preserve existing output.
diff --git a/tests/iii/identifier-variable-collision/program.cps b/tests/iii/identifier-variable-collision/program.cps
new file mode 100644
index 0000000..fc0d743
--- /dev/null
+++ b/tests/iii/identifier-variable-collision/program.cps
@@ -0,0 +1,2 @@
+DECLARE Counter : INTEGER
+DECLARE counter : INTEGER