Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Access to the wrong field of aliased module #6726
Original bug ID: 6726
The problem was introduced by the commit 15405 "Fix #6465: allow incremental weakening of module aliases"
When compiling the example containing 3 files: extUnixAll.ml, extUnix.ml, test_endian_string.ml
external unused : unit -> unit = "caml_blit_string"
The module ExtUnixAll compiles to this lambda code:
i.e. the module "BigEndian" is at field 0
With the trunk, test_string_endian compiles to:
i.e. it tries to access to the module at field 1
When looking at the typedtree, before 15405:
i.e. there is an additionnal Tmod_constraint.
My conclusion would be that the external in ExtUnixAll is considered as a regular function when coercing hence shifting the field access.
Steps to reproduce
ocamlc -c extUnixAll.ml