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
3.12.0+dev18: "module type of" produces unusable signatures for repeated definitions #5037
Original bug ID: 5037
module type S = module type of (struct
module type S = sig val x : int val x : string end
module T : S = struct let x = "abc" end ;;
These don't work either:
module T : S = struct let x = 42 end ;;
module T : S = struct let x = 42 let x = "abc" end ;;
Since repeated module level definitions with the same name are very common, "module type of" should use the same heuristic as "sig ... end" and retain only the last one of repeated definitions.
Comment author: kaustuv
0001441 and 0004487 are not relevant because their error conditions are no longer reproducible:
module type S = sig val x : int val x : string end ;;
module type S = sig val x : string end
That is, it appears that sig ... end now drops all but the last of duplicate definitions.
0004974 is possibly not relevant either, but there isn't enough code there for me to judge.