Raise Invalid_arg if Hashtbl.create is given a negative init size - #13474
Raise Invalid_arg if Hashtbl.create is given a negative init size#13474MisterDA wants to merge 1 commit into
Invalid_arg if Hashtbl.create is given a negative init size#13474Conversation
6d0d20d to
bf7b44c
Compare
bf7b44c to
7b0be0e
Compare
|
The fix LGTM 👍 Strictly speaking this is a backward-incompatible change.
Finally, as a Stdlib change this will require 2 core dev approvals. |
|
I like the fix in principle. Nevertheless, I worry that this fix can break perfectly working code whereas I struggle to imagine a situation where this fix would help identify a meaningful bug. |
|
This seems like a regression to me; it'll potentially raise exceptions in currently working code, but add no real improvements. Wouldn't it be better to document the minimum and maximum values, and add a note that values outside this range will be clamped to those? |
|
We discussed this at our triaging meeting today, and we couldn't really find overwhelming support in favor of the PR -- we agree that programs should not do this, but we don't necessarily agree that breaking them is the right reaction. (Of course if this was like this from scratch it would be fine.) |
|
The majority opinion among maintainers is that the behaviour should not be changed, but the documentation should be. |
…iage discussion of ocaml#13474 concluded that we should allow negative values but document that they are disregarded.
Majority view in the triage discussion of ocaml#13474 concluded that we should allow negative values but document that they are disregarded.
Majority view in the triage discussion of ocaml#13474 concluded that we should allow negative values but document that they are disregarded.
Majority view in the triage discussion of ocaml#13474 concluded that we should allow negative values but document that they are disregarded.
Majority view in the triage discussion of ocaml#13474 concluded that we should allow negative values but document that they are disregarded.
Majority view in the triage discussion of ocaml#13474 concluded that we should allow negative values but document that they are disregarded.
Fix #13469. This is akin to e.g.,
List.init.