Ticket #4917 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

ghc7 does not equate type synonyms under RankNTypes

Reported by: kyagrd Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 7.0.1
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: GHC rejects valid program Difficulty:
Test Case: typecheck/should_compile/T4917 Blocked By:
Blocking: Related Tickets:

Description (last modified by simonpj) (diff)

See the source at

 http://hpaste.org/43297/ghc7_problem_with_rankntypes_a

It works on ghc6 but not on ghc 7

The type error message is

ghc7rankn.hs:23:20:
    Couldn't match expected type `forall a'1.
                                  x a'1 -> Const (Const b a') a'1'
                with actual type `forall a'1. x1 a'1 -> Const b a'1'
    Expected type: (forall a'1. x a'1 -> Const (Const b a') a'1)
                   -> f x a
                   -> Const (Const b a') a
      Actual type: (forall a'1. x1 a'1 -> Const b a'1)
                   -> f1 x1 a1
                   -> Const b a1
    In the first argument of `mcata', namely `f'
    In the first argument of `f', namely `(mcata f)'

Attachments

ghc7rankn.hs Download (0.7 KB) - added by kyagrd 2 years ago.

Change History

Changed 2 years ago by kyagrd

Changed 2 years ago by kyagrd

  • component changed from Compiler to Compiler (Type checker)

Changed 2 years ago by simonpj

  • status changed from new to merge
  • testcase set to typecheck/should_compile/T4917
  • description modified (diff)

Very good point, thank you. Fixed by

Tue Jan 25 11:01:12 GMT 2011  simonpj@microsoft.com
  * Fix Trac #4917: try a bit harder to unify on-the-fly
  
  This is generally a modest improvement but, more important,
  it fixes a "unify-under-forall" problem.  See Note [Avoid deferring].
  
  There's still a lurking unsatisfactory-ness in that we can't
  defer arbitrary constraints that are trapped under a forall.

    M ./compiler/typecheck/TcUnify.lhs -8 +28

Ian, please merge.

Simon

Changed 2 years ago by igloo

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

Merged

Note: See TracTickets for help on using tickets.