#5424: Validate error under 7.2.1 caused by incomplete pattern warnings in new
code gen (GADTs)
---------------------------------+------------------------------------------
Reporter: dterei | Owner: simonpj
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.2.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Building GHC failed
---------------------------------+------------------------------------------
Comment(by simonpj@…):
commit de9b85fa3fb6d4cd593366e1f2383cd0b492c056
{{{
Author: Simon Peyton Jones <[email protected]>
Date: Fri Sep 2 17:43:53 2011 +0100
Export a tiny bit more info with AbstractTyCon (fixes #5424)
When we compile -O0 we put type constructors in the interface file
without their data constructors -- an AbstractTyCon. But in a
client module, to give good pattern-match exhaustiveness warnings,
we need to know the difference between a data type and a newtype.
(The latter can be coerced to another type, but a data type can't.)
See Note [Pruning dead case alternatives] in Unify.
Because we weren't conveying this info, we were getting bogus
warnings about inexhaustive patterm matches with GADTs, and
(confusingly) these warnings woudl come and go depending on
whether you were compiling with -O.
This patch makes AbstractTyCon carry a flag indicating whether
the type constructor is "distinct"; two distinct TyCons cannot
be coerced into eachother (except by unsafeCoerce, in which case
all bets are off).
HEADS UP: interface file format changes slightly, so you need
to make clean.
compiler/iface/BinIface.hs | 4 +-
compiler/iface/BuildTyCl.lhs | 7 ++--
compiler/iface/IfaceSyn.lhs | 24 +++++++-------
compiler/iface/MkIface.lhs | 2 +-
compiler/iface/TcIface.lhs | 2 +-
compiler/typecheck/TcDeriv.lhs | 2 +-
compiler/typecheck/TcRnDriver.lhs | 4 ++-
compiler/typecheck/TcTyClsDecls.lhs | 4 +-
compiler/types/TyCon.lhs | 57
+++++++++++++++++++++++++++-------
compiler/types/Unify.lhs | 10 +++---
10 files changed, 76 insertions(+), 40 deletions(-)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5424#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs