[GHC] #11361: Test tc253 doesn't pass with reversed uniques
GHC
ghc-devs at haskell.org
Thu Jan 7 15:15:54 UTC 2016
#11361: Test tc253 doesn't pass with reversed uniques
-------------------------------------+-------------------------------------
Reporter: niteria | Owner: niteria
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.1
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by niteria):
I believe the problem is here:
https://phabricator.haskell.org/diffusion/GHC/browse/master/compiler/typecheck/TcTyClsDecls.hs;c78fedde7055490ca6f6210ada797190f3c35d87$1003
There's no reason to believe that `ktvs` and `mkTyVarTys fam_tc_tvs` will
be in the matching order, and indeed `ktvs` is in the order of uniques.
We start out with:
{{{
type Fam a_a18o3H b_a18o3G :: *
type Fam a_a18o3F x_a18o3E = FamHelper a_a18o3F x_a18o3E
}}}
then when we reach `tcDefaultAssocDecl` we have:
`FamHelper (a_a18o3F |> <*>_N) (x_a18o3E |> <*>_N) |> <*>_N)`
`ktvs` is `[x_a18o3E, a_a18o3F]`
`mkTyVarTys fam_tc_tvs` is `[a_a18o3H, b_a18o3G]`
When we zip them together we end up with a definition that flips the
arguments.
From there it goes downhill, because when we try to compute `Fam Int Bool`
we do it with flipped arguments: `FamHelper Bool Int` which is `(String,
Bool)` which eventually doesn't unify with `Maybe Int`.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11361#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list