Ticket #2494 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

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: Difficulty: Unknown
Test Case: typecheck/should_compile/T2494, T2494-2 Blocked By:
Blocking: Related Tickets:

Description

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

{-# RULES

"foo/foo"
  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

Changed 5 years ago by simonpj

  • difficulty set to Unknown

Good point. I have a patch for this. Simon

Changed 5 years ago by simonpj

  • status changed from new to closed
  • testcase set to typecheck/should_compile/T2494, T2494-2
  • resolution set to fixed

Fixed by

Mon Aug 11 03:44:38 PDT 2008  simonpj@microsoft.com
  * Fix Trac #2494: tcSimplifyRuleLhs

Simon

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.