#5716: Failure when using promoted data family instances
-------------------------------+--------------------------------------------
Reporter: dreixel | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.4.2
Component: Compiler | Version: 7.5
Resolution: | Keywords: PolyKinds
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Difficulty: Unknown
Testcase: polykinds/T5716 | Blockedby:
Blocking: | Related:
-------------------------------+--------------------------------------------
Comment(by simonpj):
The reference to "#5715" in the commit is wrong: it's 5716!
{{{
commit fa9fdc283be5429ec65c625d35daf2d7e65e2227
Author: Simon Peyton Jones <[email protected]>
Date: Fri Apr 20 17:05:15 2012 +0100
Do SCC on instance declarations (fixes Trac #5715)
The trouble here is that given
{-# LANGUAGE DataKinds, TypeFamilies #-}
data instance Foo a = Bar (Bar a)
we want to get a sensible message that we can't use the promoted 'Bar'
constructor until after its definition; it's a staging error. Bud the
staging mechanism that we use for vanilla data declarations don't work
here.
Solution is to perform strongly-connected component analysis on the
instance declarations. But that in turn means that we need to track
free-variable information on more HsSyn declarations, which is why
so many files are touched. All the changes are boiler-platey except
the ones in TcInstDcls.
compiler/basicTypes/NameEnv.lhs | 32 +++++++++++-
compiler/basicTypes/SrcLoc.lhs | 7 ++-
compiler/hsSyn/Convert.lhs | 13 +++--
compiler/hsSyn/HsDecls.lhs | 30 ++++++-----
compiler/hsSyn/HsTypes.lhs | 2 +-
compiler/hsSyn/HsUtils.lhs | 2 +-
compiler/main/HscStats.hs | 7 ++-
compiler/parser/Parser.y.pp | 14 +++--
compiler/parser/RdrHsSyn.lhs | 13 +++--
compiler/rename/RnBinds.lhs | 17 ++-----
compiler/rename/RnNames.lhs | 2 +-
compiler/rename/RnSource.lhs | 38 ++++++++------
compiler/typecheck/TcDeriv.lhs | 2 +-
compiler/typecheck/TcInstDcls.lhs | 96
++++++++++++++++++++++++++++-------
compiler/typecheck/TcTyClsDecls.lhs | 15 +----
compiler/typecheck/TcTyDecls.lhs | 6 +-
16 files changed, 193 insertions(+), 103 deletions(-)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5716#comment:6>
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