{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/832","repository_url":"https://api.github.com/repos/ocaml/ocaml","labels_url":"https://api.github.com/repos/ocaml/ocaml/issues/832/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/ocaml/issues/832/comments","events_url":"https://api.github.com/repos/ocaml/ocaml/issues/832/events","html_url":"https://github.com/ocaml/ocaml/pull/832","id":180600343,"number":832,"title":"Improve compilation time for toplevel include(struct ... end : sig ... end)","user":{"login":"alainfrisch","id":3305274,"avatar_url":"https://avatars.githubusercontent.com/u/3305274?v=3","gravatar_id":"","url":"https://api.github.com/users/alainfrisch","html_url":"https://github.com/alainfrisch","followers_url":"https://api.github.com/users/alainfrisch/followers","following_url":"https://api.github.com/users/alainfrisch/following{/other_user}","gists_url":"https://api.github.com/users/alainfrisch/gists{/gist_id}","starred_url":"https://api.github.com/users/alainfrisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alainfrisch/subscriptions","organizations_url":"https://api.github.com/users/alainfrisch/orgs","repos_url":"https://api.github.com/users/alainfrisch/repos","events_url":"https://api.github.com/users/alainfrisch/events{/privacy}","received_events_url":"https://api.github.com/users/alainfrisch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-03T09:46:14Z","updated_at":"2016-10-03T14:34:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ocaml/ocaml/pulls/832","html_url":"https://github.com/ocaml/ocaml/pull/832","diff_url":"https://github.com/ocaml/ocaml/pull/832.diff","patch_url":"https://github.com/ocaml/ocaml/pull/832.patch"},"body":"This is intended to fix MPR#7357, which uses the natural way of specifying an inline signature for a unit without using an external .mli file.\r\n\r\nThe trick is similar to the one applied for compiling `module X = (struct ... end : sig ... end)`. Identifiers of the inner structure are \"lifted\" as extra fields of the top-level structure.\r\n\r\nI'd argue this special case is relevant since it corresponds to the natural way of restricting a unit's signature without specifying an external .mli file.  For instance, the change would be beneficial to #217 or to people using that encoding manually.\r\n\r\nThe trick is currently not applied to `include (struct .... end)`; it would not be difficult to do so, but there is no real reason to use that form anyway (except perhaps to simplify code generators, or to customize warnings locally in a section), and one might argue that simplifying that to just the inner structure should be done earlier in the compilation process.\r\n\r\nA minor point: I'm not sure about the call to `Translattribute.check_attribute_on_module`.  In the current version, attributes on the include structure item are considered, not attributes on the either of the two module expression (the Tmod_structure and Tmod_constraint nodes).  This is similar to what was done for the Tstr_module cases (starting from 58d6da114e8e5025b98c9e0127186db5b1463310), but it does not look right to me.  @chambart Can you comment?"},"comment":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/comments/251122014","html_url":"https://github.com/ocaml/ocaml/pull/832#issuecomment-251122014","issue_url":"https://api.github.com/repos/ocaml/ocaml/issues/832","id":251122014,"user":{"login":"bobzhang","id":747051,"avatar_url":"https://avatars.githubusercontent.com/u/747051?v=3","gravatar_id":"","url":"https://api.github.com/users/bobzhang","html_url":"https://github.com/bobzhang","followers_url":"https://api.github.com/users/bobzhang/followers","following_url":"https://api.github.com/users/bobzhang/following{/other_user}","gists_url":"https://api.github.com/users/bobzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/bobzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobzhang/subscriptions","organizations_url":"https://api.github.com/users/bobzhang/orgs","repos_url":"https://api.github.com/users/bobzhang/repos","events_url":"https://api.github.com/users/bobzhang/events{/privacy}","received_events_url":"https://api.github.com/users/bobzhang/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T14:34:07Z","updated_at":"2016-10-03T14:34:07Z","body":"thanks for the quick fix.\r\nNote that `include (struct .. end )` is still useful for `local open`, but it is not a high  priority."}}
{"actor":{"display_login":"bobzhang"}}