You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6688 Reporter:@alainfrisch Assigned to:@alainfrisch Status: closed (set by @xavierleroy on 2016-12-07T10:37:05Z) Resolution: fixed Priority: normal Severity: minor Fixed in version: 4.03.0+dev / +beta1 Category: ~DO NOT USE (was: OCaml general) Related to:#6681#6698#6703 Monitored by:@gasche@yallop@hcarty
Bug description
I propose to let the parser accept value declarations (val x : ...) as valid syntactic structure items. They can already be encoded in the Parsetree (as Pstr_primitive, which takes a value_description argument), so the impact on the code (Ast_helper, Ast_mapper, print_ast, etc) is minimal.
Such declarations would be rejected by the type-checker, but later, one could give interesting meaning to them (e.g. to specify locally the expected type scheme for a value definition; or even support local forward declarations). The reason to add them now is to give more freedom to what can go into an extension/attribute payload, cf #6681.
(It would also make sense to rename Pstr_primitive to Pstr_value, but then this impacts more existing code.)
A patch is attached. In addition to it, one should get rid of the following comment in parsetree.mli:
"Note: when used under Pstr_primitive, prim cannot be empty"
Original bug ID: 6688
Reporter: @alainfrisch
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2016-12-07T10:37:05Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Related to: #6681 #6698 #6703
Monitored by: @gasche @yallop @hcarty
Bug description
I propose to let the parser accept value declarations (val x : ...) as valid syntactic structure items. They can already be encoded in the Parsetree (as Pstr_primitive, which takes a value_description argument), so the impact on the code (Ast_helper, Ast_mapper, print_ast, etc) is minimal.
Such declarations would be rejected by the type-checker, but later, one could give interesting meaning to them (e.g. to specify locally the expected type scheme for a value definition; or even support local forward declarations). The reason to add them now is to give more freedom to what can go into an extension/attribute payload, cf #6681.
(It would also make sense to rename Pstr_primitive to Pstr_value, but then this impacts more existing code.)
A patch is attached. In addition to it, one should get rid of the following comment in parsetree.mli:
"Note: when used under Pstr_primitive, prim cannot be empty"
File attachments
The text was updated successfully, but these errors were encountered: