#1259: Accessing undefined value in DiffArray returns misleading error message
-------------------------------+--------------------------------------------
    Reporter:  guest           |        Owner:             
        Type:  bug             |       Status:  new        
    Priority:  low             |    Milestone:  6.10       
   Component:  libraries/base  |      Version:  6.6        
    Severity:  normal          |   Resolution:             
    Keywords:                  |   Difficulty:  Easy (1 hr)
          Os:  Unknown         |     Testcase:             
Architecture:  Multiple        |  
-------------------------------+--------------------------------------------
Changes (by igloo):

  * milestone:  => 6.10

Old description:

> Prelude> :m + Data.Array.Diff
> Prelude Data.Array.Diff> :t array
> array :: (Ix i, IArray a e) => (i, i) -> [(i, e)] -> a i e
> Prelude Data.Array.Diff> array (1,1) [] :: DiffArray Int Int
> array (1,1) [(1,*** Exception: MArray: undefined array element
>
> Since DiffArray isn't a MArray(it implements IArray), this is misleading.
> It should either say IArray or better DiffArray: undefined array element.

New description:

 {{{
 Prelude> :m + Data.Array.Diff
 Prelude Data.Array.Diff> :t array
 array :: (Ix i, IArray a e) => (i, i) -> [(i, e)] -> a i e
 Prelude Data.Array.Diff> array (1,1) [] :: DiffArray Int Int
 array (1,1) [(1,*** Exception: MArray: undefined array element
 }}}
 Since DiffArray isn't a MArray(it implements IArray), this is misleading.
 It should either say IArray or better DiffArray: undefined array element.

Comment:

 I think the right way to fix this is to wait until we have extensible
 exceptions, so MArray throws a structured exception. DiffArray can then
 s/MArray/DiffArray/ without having to duplicate all the checks.

 As such, it's probably something for 6.10.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1259>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to