Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#1259 closed bug (invalid)

Accessing undefined value in DiffArray returns misleading error message

Reported by: guest Owned by:
Priority: normal Milestone: 6.12 branch
Component: libraries/base Version: 6.6
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:

Description (last modified by igloo)

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.

Change History (6)

comment:1 Changed 10 years ago by igloo

Description: modified (diff)
Milestone: 6.1

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.

comment:2 Changed 9 years ago by simonmar

Architecture: MultipleUnknown/Multiple

comment:3 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:4 Changed 8 years ago by igloo

Milestone: 6.10 branch6.12 branch
Priority: lownormal

Raising priority now that we have extensible exceptions.

comment:5 Changed 8 years ago by igloo

Resolution: invalid
Status: newclosed

diffarray is now in its own package. Ticket moved to here:

comment:6 Changed 8 years ago by simonmar

difficulty: Easy (1 hr)Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.