Anonymous | Login | Signup for a new account | 2019-02-20 15:02 CET | ![]() |
Main | My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||
0005054 | OCaml | ~DO NOT USE (was: OCaml general) | public | 2010-05-19 03:03 | 2010-05-20 16:57 | |||
Reporter | jeremy | |||||||
Assigned To | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | |||
Status | closed | Resolution | fixed | |||||
Platform | OS | OS Version | ||||||
Product Version | 3.11.2 | |||||||
Target Version | Fixed in Version | 3.12.0+dev | ||||||
Summary | 0005054: simple recursive value not accepted | |||||||
Description | I can't think of any reason this should fail, and the documentation about "statically constructive" expressions would seem to allow it. jeremy:~$ ocamlc -c minimal.ml File "minimal.ml", line 18, characters 21-53: Error: This kind of expression is not allowed as right-hand side of `let rec' Here's minimal.ml: module type POINTED_SET = sig type t val x : t end module IntWith3 : POINTED_SET = struct type t = int let x = 3 end (* all of these are fine *) let rec silly_list = (IntWith3.x :: silly_list) let rec silly_list = (Some IntWith3.x :: silly_list) let rec silly_list = ([ IntWith3.x ] :: silly_list) let rec silly_list = (ref IntWith3.x :: silly_list) (* but this causes an error! *) let rec silly_list = ([| IntWith3.x |] :: silly_list) -Jeremy | |||||||
Additional Information | On Snow Leopard. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
|
(0005457) frisch (developer) 2010-05-19 13:34 edited on: 2010-05-19 13:34 |
This is caused by this case in Translcore.check_recursive_lambda: | Lprim (Pmakearray (Pgenarray), args) -> false This was introduced in rev 7742 ( http://caml.inria.fr/cgi-bin/viewcvs.cgi/ocaml/version/3.09/bytecomp/translcore.ml?rev=7742&r1=7175&r2=7742 [^] ) as part of the fix for 0004141. Damien: do you remember the reason for this case? It seems to me that the default behavior (accepting the array expression if it does not refer to any variable defined in the current let-rec) should be sound. |
(0005472) doligez (administrator) 2010-05-20 16:31 |
I don't remember exactly, but looking at the code I see there is a trap with generic arrays: you don't know their size because it depends on their type (float or not). This pattern should probably be moved up to check_top, and then we can do better than the default case by doing the same as for other arrays (just check all the arguments). I'll implement that and do some testing. |
(0005475) doligez (administrator) 2010-05-20 16:57 |
OK. Seems to work, and I'm reasonably confident that it's sound. |
![]() |
|||
Date Modified | Username | Field | Change |
2010-05-19 03:03 | jeremy | New Issue | |
2010-05-19 13:34 | frisch | Note Added: 0005457 | |
2010-05-19 13:34 | frisch | Note Edited: 0005457 | |
2010-05-20 16:31 | doligez | Note Added: 0005472 | |
2010-05-20 16:57 | doligez | Note Added: 0005475 | |
2010-05-20 16:57 | doligez | Status | new => closed |
2010-05-20 16:57 | doligez | Resolution | open => fixed |
2010-05-20 16:57 | doligez | Fixed in Version | => 3.12.0+dev |
2017-02-23 16:36 | doligez | Category | OCaml general => -OCaml general |
2017-03-03 17:55 | doligez | Category | -OCaml general => -(deprecated) general |
2017-03-03 18:01 | doligez | Category | -(deprecated) general => ~deprecated (was: OCaml general) |
2017-03-06 17:04 | doligez | Category | ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general) |
Copyright © 2000 - 2011 MantisBT Group |