Ticket #4135 (new bug)
Can't Quote Instance Associated Types in Template Haskell
| Reported by: | Ashley Yakeley | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 7.6.2 |
| Component: | Template Haskell | Version: | 6.12.1 |
| Keywords: | Cc: | jwlato@…, acfoltzer@… | |
| Operating System: | Linux | Architecture: | x86_64 (amd64) |
| Type of failure: | GHC rejects valid program | Difficulty: | |
| Test Case: | Blocked By: | #4230 | |
| Blocking: | Related Tickets: |
Description
Give this a whirl:
{-# LANGUAGE TypeFamilies,TemplateHaskell #-}
module Bug where
class C a where
type T a
$([d|
instance C (Maybe a) where
type T (Maybe a) = Char
|])
$ ghc -c Bug.hs
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Loading package array-0.3.0.0 ... linking ... done.
Loading package containers-0.3.0.0 ... linking ... done.
Loading package pretty-1.0.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Bug.hs:7:6:
Type indexes must match class instance head
Found `Maybe a[aMy]' but expected `Maybe a[aMx]'
In the associated type instance for `T'
In the instance declaration for `C (Maybe a[aMx])'
[glastonbury:~/Projects/Haskell/Truth/Core]$
Change History
Note: See
TracTickets for help on using
tickets.
