Hello I try to inline some module application. It works when I compile with ocamlopt or ocamlc manually: ocamlopt -w a -warn-error a mat.ml test.ml But fails using dune: dune build gives this error without flambda: File "test.ml", line 12, characters 18-52: 12 | module FloatMat = Mat.Make [@inlined always] (Float) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error (warning 55): Cannot inline: Unknown function and this error with flambda: File "test.ml", line 12, characters 18-52: 12 | module FloatMat = Mat.Make [@inlined always] (Float) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error (warning 55): Cannot inline: [@inlined] attribute was not used on this function application (the optimizer did not know what function was being applied) Am I missing something ? Here are the files to reproduce: ------------------------- mat.ml ---------------------- module type Field = sig type t val zero : t val one : t val ( + ) : t -> t -> t val ( * ) : t -> t -> t end module Make (R:Field) = struct open R type v = t array type m = t array array let ( *. ) v1 v2 = let r = ref zero in for i = 0 to Array.length v1 do r := !r + v1.(i) * v2.(i) done; !r let ( ** ) m v = Array.map (fun w -> w *. v) m end -------------------------------------------------------- ------------------------- test.ml ---------------------- module Float = struct type t = float let zero = 0.0 let one = 1.0 let ( + ) = ( +. ) let ( * ) = ( *. ) end module FloatMat = Mat.Make [@inlined always] (Float) -------------------------------------------------------- ------------------------- dune ------------------------- ; Add project-wide flags here. (env (dev (flags :standard -w -9-32) (ocamlopt_flags -O3)) (release (flags :standard -w -9-32) (ocamlopt_flags -O3))) (executable (name Test) (modules :standard)) ---------------------------------------------------------