Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#708 closed bug (fixed)

Compiler error

Reported by: r.j.rorije@… Owned by: simonpj
Priority: normal Milestone: 6.4.2
Component: Compiler Version: 6.4.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:



I am using Data.Generics and type classes to be able to compare values on their most inner type. Doing this a compiler bug occurred. I have tried to find a minimum example that crashed. The example I found may be not as minimal as you would like, though. I can not track down the exact source of the error, but the error occurs only when using the function mycast. when both implementations of mycast are removed no error occurs.

I hope I made the problem clear enough, otherwise, feel free to contact me.

source of the bug-example:

Attachments (1)

Test.hs (1.6 KB) - added by guest 12 years ago.
source (again)

Download all attachments as: .zip

Change History (9)

Changed 12 years ago by guest

Attachment: Test.hs added

source (again)

comment:1 Changed 12 years ago by r.j.rorije@…

Summary: Error: Data.Generics / CastCompiler error


Ralf Lammel simplified the test case considerably, even without using Data.Generics or cast, so I do not know where the error comes from anymore, but it should limit the search area.

module Test where

  class C a where
    mycast :: (C b) => a -> Maybe b
    mycast = undefined
    equals :: (C b) => a -> b -> Bool
    equals = undefined

  instance C Int

  data T1 = N11 Int

  instance C T1 where
    mycast (N11 x) = undefined
    x `equals` y = (mycast x :: Maybe Int) == undefined
  *Test> N11 5 `equals` N11 5
  : panic! (the `impossible' happened, GHC version 6.4.1):
          nameModule mycast{v a1Gt}

comment:2 Changed 12 years ago by simonmar

Milestone: 6.4.2

comment:3 Changed 12 years ago by simonmar

Architecture: x86Multiple
Operating System: WindowsMultiple

Confirmed - in fact, the test module elicits an error from -dcore-lint when compiled.

comment:4 Changed 12 years ago by simonpj

Owner: set to simonpj

comment:5 Changed 12 years ago by simonmar

already fixed in 6.4.2, thanks (test tc200).

comment:6 Changed 12 years ago by simonmar

Resolution: fixed
Status: newclosed

comment:7 Changed 9 years ago by simonmar

Architecture: MultipleUnknown/Multiple

comment:8 Changed 9 years ago by simonmar

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