summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2018-10-04 11:18:54 -0400
committerRyan Scott <ryan.gl.scott@gmail.com>2018-10-04 11:19:22 -0400
commitfeb8a671a4e92922ddac108686f0eace97dd331f (patch)
treebfe8aaa472f25d2f6a936418b03c57d04e62ff4e /testsuite
parent60b547b583f27f436912acd70e674cd9f34d72b2 (diff)
downloadhaskell-feb8a671a4e92922ddac108686f0eace97dd331f.tar.gz
Improve generated `GHC.Prim` docs
Summary: * Extended `genprimcode` to generate Haddock-compatible deprecations, as well as displaying information about which functions are LLVM-only and which functions can fail with an unchecked exception. * Ported existing deprecations to the new format, and also added a deprecation on `par#` (see Trac #15227). * Emit an error on fixity/deprecation of builtins, unless we are processing the module in which that name is defined (see Trac #15233). That means the following is no longer accepted (outside of `GHC.Types`): ``` infixr 7 : {-# DEPRECATED (:) "cons is deprecated" #-} ``` * Generate `data (->) a b` with docs and fixity in `GHC.Prim`. This means: GHC can now parse `data (->) a b` and `infixr 0 ->` (only in `GHC.Prim`) and `genprimcode` can digest `primtype (->) a b` (See Trac #4861) as well as some misc fixes along the way. Reviewers: bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, mpickering, carter GHC Trac Issues: #15227, #15233, #4861 Differential Revision: https://phabricator.haskell.org/D5167
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/parser/should_fail/T15233.hs9
-rw-r--r--testsuite/tests/parser/should_fail/T15233.stderr8
-rw-r--r--testsuite/tests/parser/should_fail/all.T1
3 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_fail/T15233.hs b/testsuite/tests/parser/should_fail/T15233.hs
new file mode 100644
index 0000000000..ee369cd189
--- /dev/null
+++ b/testsuite/tests/parser/should_fail/T15233.hs
@@ -0,0 +1,9 @@
+module T15233 where
+
+-- ghc-8.6 would accept (but silently ignore) both of the following:
+infixl 7 :
+{-# DEPRECATED (:) "Deprecting cons" #-}
+
+-- this was never accepted by ghc-8.6, but now that GHC.Prim emits a fixity
+-- declaration for `(->)`, we need to make sure it is disallowed elsewhere.
+infixr 4 ->
diff --git a/testsuite/tests/parser/should_fail/T15233.stderr b/testsuite/tests/parser/should_fail/T15233.stderr
new file mode 100644
index 0000000000..3371bef758
--- /dev/null
+++ b/testsuite/tests/parser/should_fail/T15233.stderr
@@ -0,0 +1,8 @@
+
+T15233.hs:4:10: error:
+ Illegal fixity signature of built-in syntax: :
+
+T15233.hs:5:16: error: Illegal deprecation of built-in syntax: :
+
+T15233.hs:9:10: error:
+ Illegal fixity signature of built-in syntax: ->
diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T
index 1ae1abb709..4612b78e0f 100644
--- a/testsuite/tests/parser/should_fail/all.T
+++ b/testsuite/tests/parser/should_fail/all.T
@@ -129,6 +129,7 @@ test('typeops_B', normal, compile_fail, [''])
test('typeops_C', normal, compile_fail, [''])
test('typeops_D', normal, compile_fail, [''])
test('T15053', normal, compile_fail, [''])
+test('T15233', normal, compile_fail, [''])
test('typeopsDataCon_A', normal, compile_fail, [''])
test('typeopsDataCon_B', normal, compile_fail, [''])
test('strictnessDataCon_A', normal, compile_fail, [''])