diff options
author | Ulya Trofimovich <skvadrik@gmail.com> | 2015-08-03 17:45:56 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-08-03 17:45:57 +0200 |
commit | 30c981e135033840fe1b4bcab697b412369739d7 (patch) | |
tree | b377c147ff3ab4d855a42774648a711071ab7292 /testsuite/tests/gadt | |
parent | 64b6733e217f32feb8c4872096749c6f417d0c39 (diff) | |
download | haskell-30c981e135033840fe1b4bcab697b412369739d7.tar.gz |
Removed deprecated syntax for GADT constuctors.
Old syntax was deprecated 6 years ago in this commit
432b9c9322181a3644083e3c19b7e240d90659e7 by simonpj:"New syntax for
GADT-style record declarations, and associated refactoring" discussed
in Trac #3306.
This patch removes 2 reduce/reduce conflicts in parser. Conflicting
productions were:
```
gadt_constr -> con_list '::' sigtype
gadt_constr -> oqtycon '{' fielddecls '}' '::' sigtype
```
Recursive inlining of `con_list` and `oqtycon` helped reveal the
conflict:
```
gadt_constr -> '(' CONSYM ')' '::' sigtype
gadt_constr -> '(' CONSYM ')' '{' fielddecls '}' '::' sigtype
```
between two types of GADT constructors (second form stands for
deprecated syntax).
Test Plan: `make fasttest`, one breakage TEST="records-fail" (parse
error instead of typecheck error due to removal of deprecated syntax).
Updated test.
Reviewers: simonmar, bgamari, austin, simonpj
Reviewed By: simonpj
Subscribers: thomie, mpickering, trofi
Differential Revision: https://phabricator.haskell.org/D1118
GHC Trac Issues: #3306
Diffstat (limited to 'testsuite/tests/gadt')
-rw-r--r-- | testsuite/tests/gadt/records-fail1.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/gadt/records-fail1.stderr | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/testsuite/tests/gadt/records-fail1.hs b/testsuite/tests/gadt/records-fail1.hs index 8eefee51e7..b26404afd3 100644 --- a/testsuite/tests/gadt/records-fail1.hs +++ b/testsuite/tests/gadt/records-fail1.hs @@ -2,10 +2,18 @@ -- Tests record syntax for GADTs +-- Record syntax in GADTs has been deprecated since July 2009 +-- see commit 432b9c9322181a3644083e3c19b7e240d90659e7 by simonpj: +-- "New syntax for GADT-style record declarations, and associated refactoring" +-- and Trac #3306 + +-- It's been removed in August 2015 +-- see Phab D1118 + +-- test should result into parse error + module ShouldFail where data T a where T1 { x :: a, y :: b } :: T (a,b) T4 { x :: Int } :: T [a] - -
\ No newline at end of file diff --git a/testsuite/tests/gadt/records-fail1.stderr b/testsuite/tests/gadt/records-fail1.stderr index 6fd871cbf7..9e8c80bb3b 100644 --- a/testsuite/tests/gadt/records-fail1.stderr +++ b/testsuite/tests/gadt/records-fail1.stderr @@ -1,5 +1,2 @@ -
-records-fail1.hs:7:1: error:
- Constructors T1 and T4 have a common field ‘x’,
- but have different result types
- In the data type declaration for ‘T’
+ +records-fail1.hs:18:6: error: parse error on input ‘{’ |