Thicket thicket
ocaml
REPOS 2

Core covers the OCaml compiler and language RFCs.

W26.2026 · 22–28 Junocaml/ocaml

Fixes

  • ctype scope error in modular explicits (merged): A scoping mistake in occur_univar_or_unscoped caused non-dependent applications to erase the result type with the first package type encountered, producing unsound type assignments. Fixed in #14892; the author notes a 5.5.1 release is warranted.

  • Recursive function compilation regression (5.2) (merged): Since #12596, let rec f = let __0 = f in function … generated an extra closure allocation, breaking inlining for ppx_deriving-generated code. Two PRs restore the optimisation: #14885 inlines variable-to-variable renamings; #14894 extends it to module-identifier redefinitions.

  • Assertion failure with external types under module constraints (merged): module Q(P : P) : P with type t = P.t triggered an assertion in out_type when the constrained type was external "int". External types are now treated as always abstract in this path. #14882

  • Pattern-matching switch overflow (open): The integer-overflow guard in the pattern-matching compiler failed to handle abs min_int = min_int. A fix is proposed in #14890.

Features

  • Static linking and link-time linking (open): New compiler options -cclib-static, -static, -cclib-variant, and -linking-variant allow recording per-variant C library lists in .cma files and resolving them at link time via an external command (e.g. pkg-config). Proposed in #14895.

  • RISC-V compressed instructions (merged): The RISC-V backend now emits C-extension instructions when the host supports them, reducing ocamlopt.opt code size by 11%. Register allocation is adjusted to favour x8–x15. #14873

  • Native Iatomic_fetch_add on all backends (merged): Atomic.fetch_add now compiles to a single atomic instruction (lock xadd, ldaddal, amoadd.d.aqrl, or ldarx/stdcx loop) instead of a C call, on amd64, arm64, riscv, and power. #14575

  • Pattern counter-example printing (merged): Constructor patterns with all-underscore fields now print as A _ instead of A (_,_). Nested records collapse similarly. #14887