[commit: ghc] master: Describe symptoms of (and the cure for) #12768 in 8.0.2 release notes (ead83db)
git at git.haskell.org
git at git.haskell.org
Sun Nov 6 14:47:09 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/ead83db8a7db772a9f248af9767a4283218a5c9f/ghc
>---------------------------------------------------------------
commit ead83db8a7db772a9f248af9767a4283218a5c9f
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Sun Nov 6 09:40:48 2016 -0500
Describe symptoms of (and the cure for) #12768 in 8.0.2 release notes
GHC 8.0.2 introduced a bugfix involving GeneralizedNewtypeDeriving in
96d451450923a80b043b5314c5eaaa9d0eab7c56. This made typechecking of
GND-produced code a bit stricter, and an unfortunate side effect of this was
that there were a couple of corner-case programs that stopped compiling
when transitioning from GHC 8.0.1 to 8.0.2.
Since the number of affected programs seems quite small, and since the fix
is so straightforward, we opt to simply note this discrepancy in the 8.0.2
release notes.
Resolves #12768.
>---------------------------------------------------------------
ead83db8a7db772a9f248af9767a4283218a5c9f
docs/users_guide/8.0.2-notes.rst | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/docs/users_guide/8.0.2-notes.rst b/docs/users_guide/8.0.2-notes.rst
index c8e76ed..43ee70f 100644
--- a/docs/users_guide/8.0.2-notes.rst
+++ b/docs/users_guide/8.0.2-notes.rst
@@ -29,6 +29,23 @@ Language
presence of :ghc-flag:`-XRebindableSyntax` and
:ghc-flag:`-XOverloadedStrings` (:ghc-ticket:`12688`).
+- GHC is now a bit more strict in typechecking code generated by
+ :ghc-flag:`-XGeneralizedNewtypeDeriving`. For example, GHC will now reject
+ this program: ::
+
+ class C m where
+ foo :: C m => m ()
+
+ newtype N m a = N (m a)
+ deriving C -- This is now an error
+
+ This is in contrast to GHC 8.0.1 and earlier, which would accept this code.
+ To fix this code, simply remove the ``C m`` constraint from ``foo``, as it
+ is wholly unnecessary: ::
+
+ class C m where
+ foo :: m ()
+
Compiler
~~~~~~~~
More information about the ghc-commits
mailing list