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
Fix MPR#7414 #929
Fix MPR#7414 #929
Conversation
@vprevosto linked this fix to a typing regression for his (safe) codebase on the caml-list: module Foo : sig
module M(E: sig type t end) : sig
type t
val u: t -> t -> t
end
end = struct
module M(E: sig type t end) = struct
type t = (E.t, unit) Hashtbl.t
let u = Hashtbl.fold (fun x () h -> Hashtbl.add h x (); h)
end
end If I understand correctly, this regression is expected and users have to change their code -- this is what we concluded for the non-functor case in MPR#7313, MP#7401. |
For the record, other OCaml software that have to be fixed after this change are camomile (opam-builder report) and fury-puyo (opam-builder report). I am planning on sending patches to the affected packages. |
Indeed, this is a typical case of signature annotation outside of module with nesting, which requires a more local annotation since 4.04. |
Coccinelle has also to be fixed. Here is another bit of code that was correctly typed by 4.04 and is now rejected with 4.05 beta.
|
* Fix PR#7414 by adding Mtype.lower_nongen
Changes the caching strategy for assets. All assets {PATH} (e.g. css/main.css) are now served under two URLs: 1. /{PATH} (Cache-control header allows caching for 1 day) 2. /_/{DIGEST}/{PATH} (Cache-control header allows caching for a very long time and declares the file immutable) Digests are looked up via assets.ml (produced by ocaml-crunch with mode plain). They are a hash of the file content. In the templates, there is now a parameter digest_url : string -> string which renders the path containing the digest (only for assets from assets.ml, as we do not expect files from media.ml to change). Note: Cache-control: immutable tells the browser that checking whether the file was modified is unnecessary. Resolves ocaml#839 except for the playground. Note that, since inter.css has a relative import for the font files, all the font files are served under inter.css's digest. So, if anyone ever needs to update the font files, they have to modify inter.css to change its digest.
Fix MPR#7414.
The problem was that non-generalizable variable lowering, introduced in 4.04 for modules, didn't work for functors.
The first attempt uses Subst.modtype for its side-effect.