Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array.init raises the wrong exception for invalid argument #4950

Closed
vicuna opened this issue Dec 31, 2009 · 3 comments
Closed

Array.init raises the wrong exception for invalid argument #4950

vicuna opened this issue Dec 31, 2009 · 3 comments
Labels
Milestone

Comments

@vicuna
Copy link

vicuna commented Dec 31, 2009

Original bug ID: 4950
Reporter: hennequi
Status: closed (set by @xavierleroy on 2017-02-16T14:18:26Z)
Resolution: fixed
Priority: normal
Severity: text
Version: 3.10.2
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Related to: #6575

Bug description

Array.make (-1) 0;;
Exception: Invalid_argument "Array.make".

Array.init (-1) (fun _ -> 0);;
Exception: Invalid_argument "Array.make".

it would be great for debugging purposes to see an "Array.init" in the second exception.

cheers,
Guillaume.

@vicuna
Copy link
Author

vicuna commented Jan 7, 2010

Comment author: @damiendoligez

Not sure we want to fix this, as it would add the overhead of catching the exception.

@vicuna
Copy link
Author

vicuna commented Sep 17, 2012

Comment author: @damiendoligez

Another possibility would be to change the exception to (Invalid_argument "Array.make/Array.init").

@vicuna
Copy link
Author

vicuna commented Dec 6, 2015

Comment author: @xavierleroy

Fixed as part of #6575

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant