Opened 6 years ago

Closed 6 years ago

Last modified 6 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: 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 (4)

comment:1 Changed 6 years ago by simonpj

  • Difficulty set to Unknown

Good point. I have a patch for this. Simon

comment:2 Changed 6 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to typecheck/should_compile/T2494, T2494-2

Fixed by

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

Simon

comment:3 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:4 Changed 6 years ago by simonmar

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