Open karan0299 opened 4 years ago
I will pass on what I feel about this.
On one hand, heaps
here are built over arrays, so the Stacktrace
report and BoundsError
looks just fine. On the other hand, you are proposing a layer of indirection to BoundsError
, specifically for the case of heaps. If that's the case, it would make sense to propose the same for every data-structure in cases where it attempts to access non-existent elements. Now that's something, I haven't seen throughout this codebase. It's something to be pondered upon !
Yeah, I agree with you on that point that it to propose the same for every data-structure. I think it is better if we provide abstraction to user using particular datastructure.
Currently for bounds error in heaps , array bounds error is used as
Instead BoundsError for heaps to be displayed as