Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#2494 closed bug (fixed)

Panic in tcSimplifyRuleLhs

Reported by: rl Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.8.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: typecheck/should_compile/T2494, T2494-2
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


With this module, both 6.8.3 and the HEAD panic in tcSimplifyRuleLhs:

{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
module Foo where

foo :: (forall m. Monad m => Maybe (m a) -> Maybe (m a)) -> Maybe a -> Maybe a
foo _ x = x


  forall (f :: forall m. Monad m => Maybe (m a) -> Maybe (m a))
         (g :: forall m. Monad m => Maybe (m b) -> Maybe (m b)) x.
  foo f (foo g x) = foo (f . g) x

Note that the rule is incorrectly typed; with the correct types, no panic happens.

Incidentially, I'm not sure if ScopedTypeVariables should be required here.

Change History (4)

comment:1 Changed 9 years ago by simonpj

difficulty: Unknown

Good point. I have a patch for this. Simon

comment:2 Changed 9 years ago by simonpj

Resolution: fixed
Status: newclosed
Test Case: typecheck/should_compile/T2494, T2494-2

Fixed by

Mon Aug 11 03:44:38 PDT 2008
  * Fix Trac #2494: tcSimplifyRuleLhs


comment:3 Changed 8 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:4 Changed 8 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.