Ticket #3227 (closed bug: duplicate)

Opened 4 years ago

Last modified 4 years ago

Can't specify type signature of value typed with type families

Reported by: Ashley Yakeley Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.10.3
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Compiling this:

{-# LANGUAGE TypeFamilies #-}
module Bug where
  class C a where
    type T a
	
  p :: T a
  p = undefined

  q :: T a
  q = p

give this:

$ ghc -c Bug.hs -o Bug.o

Bug.hs:10:6:
    Couldn't match expected type `T a1' against inferred type `T a'
    In the expression: p
    In the definition of `q': q = p

It compiles successfully if the type signature for q is omitted.

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.10.3
$ uname -a
Linux glastonbury 2.6.28-12-generic #43-Ubuntu SMP Fri May 1 19:31:32 UTC 2009 x86_64 GNU/Linux

Change History

Changed 4 years ago by simonpj

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to duplicate

Thanks. This is a duplicate of #1897 -- see extensive comments there.

Simon

Note: See TracTickets for help on using tickets.