Opened 14 years ago

Closed 14 years ago

Last modified 48 years ago

#151 closed bug (Fixed)

Unboxed tuples as values

Reported by: simonpj Owned by: nobody
Priority: normal Milestone:
Component: Compiler (Type checker) Version: None
Keywords: Cc:
Operating System: Architecture:
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:



  type T a = Int -> (# Int, Int #)

  f :: T a -> T a
  f t = \x -> case t x of r -> r

gives the following error message:

  ghc-5.04.1: panic! (the `impossible' happened, GHC 
version 5.04.1):
	  codeGen/CgRetConv.lhs:83: Non-exhaustive 
patterns in function

Trouble is that 'r' is bound to an unboxed tuple.  This 
should fail, but in 5.04.1 it crashes the compiler.  In 6.0 
it's worse: the code will core dump because it enters R1.

But it should be rejected in the type checker.

Change History (1)

comment:1 Changed 14 years ago by simonpj

Status: assignedclosed
Logged In: YES 

Fixed, at last. Test is tcfail115.hs

The error message is still poor, but at least it now fails 
Note: See TracTickets for help on using tickets.