From 8f2fb8275049f7622e8d95abf33b48b80ad887e5 Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 20 May 2009 20:24:15 +0000 Subject: more friendly error message when renaming patterns --- testsuite/compiler/renamer/funpatt.gf | 14 ++++++++++++++ testsuite/compiler/renamer/funpatt.gfs | 1 + testsuite/compiler/renamer/funpatt.gfs.gold | 7 +++++++ testsuite/compiler/renamer/varpatt.gf | 13 +++++++++++++ testsuite/compiler/renamer/varpatt.gfs | 4 ++++ testsuite/compiler/renamer/varpatt.gfs.gold | 4 ++++ 6 files changed, 43 insertions(+) create mode 100644 testsuite/compiler/renamer/funpatt.gf create mode 100644 testsuite/compiler/renamer/funpatt.gfs create mode 100644 testsuite/compiler/renamer/funpatt.gfs.gold create mode 100644 testsuite/compiler/renamer/varpatt.gf create mode 100644 testsuite/compiler/renamer/varpatt.gfs create mode 100644 testsuite/compiler/renamer/varpatt.gfs.gold (limited to 'testsuite') 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 + -- cgit v1.2.3