
As for the patch: I would expect that the solution to this problem would be in the type-checker, not the renamer. As it stands, I'm pretty sure
#15591: Inconsistent kind variable binder visibility between associated and non- associated type families -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: | TypeApplications, TypeFamilies Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Replying to [comment:5 goldfire]: that the renamer identifies the `a` in these associated type definitions with the same unique as the `a` in the class. Well, it does identify the `a` in `T2` to be the same `a` as in `C`. But after it does so, it immediately filters it out! That's problematic, because by the time you reach `kcLHsQTyVars`, the `hsq_implicit` field of the `LHsQTyVars` argument only contains `f`—`a` is no longer within reach. (You can verify this for yourself by compiling this program with `-ddump- tc-trace` and searching for `kcLHsQTyVars: cusk`.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15591#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler