forked from GitHub/gf-core
more friendly error message when renaming patterns
This commit is contained in:
14
testsuite/compiler/renamer/funpatt.gf
Normal file
14
testsuite/compiler/renamer/funpatt.gf
Normal file
@@ -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 ;
|
||||
|
||||
}
|
||||
1
testsuite/compiler/renamer/funpatt.gfs
Normal file
1
testsuite/compiler/renamer/funpatt.gfs
Normal file
@@ -0,0 +1 @@
|
||||
i -src testsuite/compiler/renamer/funpatt.gf
|
||||
7
testsuite/compiler/renamer/funpatt.gfs.gold
Normal file
7
testsuite/compiler/renamer/funpatt.gfs.gold
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
data constructor expected but funpatt.D1 is found instead
|
||||
|
||||
OCCURRED IN
|
||||
13
testsuite/compiler/renamer/varpatt.gf
Normal file
13
testsuite/compiler/renamer/varpatt.gf
Normal file
@@ -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 ;
|
||||
|
||||
}
|
||||
4
testsuite/compiler/renamer/varpatt.gfs
Normal file
4
testsuite/compiler/renamer/varpatt.gfs
Normal file
@@ -0,0 +1,4 @@
|
||||
i -src testsuite/compiler/renamer/varpatt.gf
|
||||
|
||||
pt -compute d D1
|
||||
pt -compute d D2
|
||||
4
testsuite/compiler/renamer/varpatt.gfs.gold
Normal file
4
testsuite/compiler/renamer/varpatt.gfs.gold
Normal file
@@ -0,0 +1,4 @@
|
||||
1
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user