[GHC] #7512: GHC crashes with multiple = in instance

2012-12-19 Thread GHC
#7512: GHC crashes with multiple = in instance
---+
Reporter:  jvictor |  Owner:
Type:  bug | Status:  new   
Priority:  normal  |  Component:  Compiler  
 Version:  7.6.1   |   Keywords:
  Os:  Linux   |   Architecture:  x86_64 (amd64)
 Failure:  Compile-time crash  |  Blockedby:
Blocking:  |Related:
---+
 GHC will crash (rather than a syntax error) if you write



 {{{
 import Data.Array.Unboxed

 newtype Vector r = Vector (UArray Int r)

 instance (IArray UArray r) = (Num r) = Num (Vector r) where
   (Vector v1) + (Vector v2) = Vector $ listArray (0,0) []

 }}}

 This is unfortunately the smallest program I found that crashes the
 compiler; removing the definition of (+) yields a syntax error as
 expected.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7512
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #7512: GHC crashes with multiple = in instance

2012-12-19 Thread GHC
#7512: GHC crashes with multiple = in instance
-+--
  Reporter:  jvictor |  Owner:
  Type:  bug | Status:  closed
  Priority:  normal  |  Milestone:
 Component:  Compiler|Version:  7.6.1 
Resolution:  worksforme  |   Keywords:
Os:  Linux   |   Architecture:  x86_64 (amd64)
   Failure:  Compile-time crash  | Difficulty:  Unknown   
  Testcase:  |  Blockedby:
  Blocking:  |Related:
-+--
Changes (by simonpj):

  * status:  new = closed
  * difficulty:  = Unknown
  * resolution:  = worksforme


Comment:

 Really?  With 7.6.1 I get
 {{{
 bash$ c:/fp/ghc-7.6.1/bin/ghc -c T7512.hs

 T7512.hs:7:10:
 Malformed instance: IArray UArray r = Num r = Num (Vector r)
 }}}
 GHC 7.4.1 indeed crashes with
 {{{
 bash-3.1$ c:/fp/ghc-7.4.1/bin/ghc -c T7512.hs
 ghc.exe: panic! (the 'impossible' happened)
   (GHC version 7.4.1 for i386-unknown-mingw32):
 compiler\rename\RnSource.lhs:429:14-81: Irrefutable pattern failed
 for pattern Data.Maybe.Just (inst_tyvars,
 _,
 SrcLoc.L _ cls,
 _)
 }}}
 So I'll close this as already fixed.  Re-open if you disagree.

 Simon

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7512#comment:1
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs