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
Destructive substitution regression #7905
Original bug ID: 7905
The following is accepted in 4.07, but rejected in 4.08.
module M : sig type t = A of t end type t := A.t = A of t File "foo.mli", line 5, characters 34-35: 5 | type t := M.t = A of t ^ Error: Unbound type constructor t
Comment author: @Octachron
As far as I can see, this is a local substitution, a new feature of 4.08? Your code example results in a syntax error with 4.07. Nevertheless, the error message might fall in an unfortunate local minimum: rewriting the local substitution to
type t := A.t = A of A.t
5 | type t := A.t = A of A.t
Comment author: @gasche
octachron, is the behavior you spotted a bug? The message you have (for the intuitively "correct" definition) looks like a parsing-error message delayed to type-checking time (I'm fine with this, but we may move it back to the parser one day if it has proper error messages), but the error of nojebar suggests that type-checking happens before the construction is rejected. Does it mean that the not-allowed rejection happens too late in the pipeline?
Comment author: @trefis
Feel free to move the code checking the shape of the declarations before the actual type-checking part.