Opened 8 years ago

Closed 8 years ago

#890 closed bug (fixed)

ghc panics on accessing a labeled field

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.4.2
Keywords: Cc:
Operating System: Windows Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

GHC panics about a following code:

class Bar a where
	bar :: Foo a -> Foo a
	bar x = x { foo = [] }
	
data Foo a = Bar a => Foo { foo :: [a] }

GHC says:

Chasing modules from: Main.hs
Compiling Main ( Main.hs, Main.o )
ghc: panic! (the `impossible' happened, GHC version 6.4.2):

types/Type.lhs:(1107,0)-(1108,77): Non-exhaustive patterns in function zip_ty_env

Change History (1)

comment:1 Changed 8 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed

I think this is ok in the HEAD:

Foo10.hs:7:17:
    Record update for the non-Haskell-98 data type `Foo' is not (yet) supported
    Use pattern-matching instead
    In the expression: x {foo = []}
    In the definition of `bar': bar x = x {foo = []}
    In the definition for method `bar'
Note: See TracTickets for help on using tickets.