Ticket #5852 (closed feature request: fixed)

Opened 16 months ago

Last modified 16 months ago

methods and associated types treated differently wrt. qualification

Reported by: jeltsch Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.0.4
Keywords: type families, qualified import Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Say I have the following module:

{-# LANGUAGE TypeFamilies #-}
module M where

    class C a where

        type T a :: *

        m :: a

Now I use this module in another module via a qualified import:

{-# LANGUAGE TypeFamilies #-}
module U where

    import qualified M

    instance M.C Integer where

        type M.T Integer = Integer

        m = 0

Note that in the instance declaration, the associated type T is qualified, while the method m is not. Removing the qualification of T is not accepted by GHC, but neither is adding a qualification to m. I think this inconsistency is unfortunate, so that it might be good to remove it.

Change History

Changed 16 months ago by jeltsch

  • status changed from new to closed
  • resolution set to fixed

Now that I have installed GHC 7.4.1 (for a different reason than this bug), I see that this problem is fixed in this GHC version.

Note: See TracTickets for help on using tickets.