I was revisiting the shape design thread and I’ve run into something which is not what I would have expected. This is fine:
module Shape = struct
type t = ..
end
type shape = Shape.t
module Point = struct
type t = { x : int; y : int }
end
type point = Point.t
type Shape.t += Point of point
But if I replace Shape.t
with the type alias shape
like this:
type shape += Point of point
I get the error:
Error: Type definition shape is not extensible
Expected behavior ?