summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-05-20 20:24:15 +0000
committerkrasimir <krasimir@chalmers.se>2009-05-20 20:24:15 +0000
commit8f2fb8275049f7622e8d95abf33b48b80ad887e5 (patch)
treed66faa43c6d8936ce43095dda49d58916b9fb30c /testsuite
parent6de94f53002263878bfb03e31d26caefa4872f20 (diff)
more friendly error message when renaming patterns
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/compiler/renamer/funpatt.gf14
-rw-r--r--testsuite/compiler/renamer/funpatt.gfs1
-rw-r--r--testsuite/compiler/renamer/funpatt.gfs.gold7
-rw-r--r--testsuite/compiler/renamer/varpatt.gf13
-rw-r--r--testsuite/compiler/renamer/varpatt.gfs4
-rw-r--r--testsuite/compiler/renamer/varpatt.gfs.gold4
6 files changed, 43 insertions, 0 deletions
diff --git a/testsuite/compiler/renamer/funpatt.gf b/testsuite/compiler/renamer/funpatt.gf
new file mode 100644
index 000000000..8406e1e3b
--- /dev/null
+++ b/testsuite/compiler/renamer/funpatt.gf
@@ -0,0 +1,14 @@
+abstract funpatt = {
+
+-- this should raise error
+-- we cannot pattern match on functions
+
+cat D ;
+fun D1 : D ;
+ D2 : D ;
+
+fun d : D -> Int ;
+def d D1 = 1 ;
+ d D2 = 2 ;
+
+} \ No newline at end of file
diff --git a/testsuite/compiler/renamer/funpatt.gfs b/testsuite/compiler/renamer/funpatt.gfs
new file mode 100644
index 000000000..c7692083e
--- /dev/null
+++ b/testsuite/compiler/renamer/funpatt.gfs
@@ -0,0 +1 @@
+i -src testsuite/compiler/renamer/funpatt.gf
diff --git a/testsuite/compiler/renamer/funpatt.gfs.gold b/testsuite/compiler/renamer/funpatt.gfs.gold
new file mode 100644
index 000000000..b64278900
--- /dev/null
+++ b/testsuite/compiler/renamer/funpatt.gfs.gold
@@ -0,0 +1,7 @@
+
+
+data constructor expected but funpatt.D1 is found instead
+OCCURRED IN
+renaming definition of d in funpatt.gf, line 12
+OCCURRED IN
+renaming module funpatt
diff --git a/testsuite/compiler/renamer/varpatt.gf b/testsuite/compiler/renamer/varpatt.gf
new file mode 100644
index 000000000..93bddd63e
--- /dev/null
+++ b/testsuite/compiler/renamer/varpatt.gf
@@ -0,0 +1,13 @@
+abstract varpatt = {
+
+-- this should raise error
+-- we cannot pattern match on functions
+
+cat D ;
+fun D1 : D ;
+ D2 : D ;
+
+fun d : D -> Int ;
+def d x = 1 ;
+
+} \ No newline at end of file
diff --git a/testsuite/compiler/renamer/varpatt.gfs b/testsuite/compiler/renamer/varpatt.gfs
new file mode 100644
index 000000000..f3422103e
--- /dev/null
+++ b/testsuite/compiler/renamer/varpatt.gfs
@@ -0,0 +1,4 @@
+i -src testsuite/compiler/renamer/varpatt.gf
+
+pt -compute d D1
+pt -compute d D2
diff --git a/testsuite/compiler/renamer/varpatt.gfs.gold b/testsuite/compiler/renamer/varpatt.gfs.gold
new file mode 100644
index 000000000..8d4409e5d
--- /dev/null
+++ b/testsuite/compiler/renamer/varpatt.gfs.gold
@@ -0,0 +1,4 @@
+1
+
+1
+