ocaml-doc / doc-ock

(DEPRECATED) Documentation generation for OCaml
ISC License
15 stars 4 forks source link

Type extensions aren't named #7

Closed dsheets closed 10 years ago

dsheets commented 10 years ago
type x = ..
type x+= X
let x = X
type x+= X
let x'= X

The extensions on lines 2 and 4 aren't uniquely identified so there seems to be no way to refer to an extension rather than the type being extended or the constructors being declared.

I don't really know if this would be used but it doesn't seem parallel to the other signature elements which all have element ids.

lpw25 commented 10 years ago

Luckily, the above code produces an error on trunk because we now ban multiple extensions with the same name. So the constructor names are unique and can be reliably be used as identifiers.

dsheets commented 10 years ago

Oh, cool. So this weirdness only works on 4.02.0 and 4.02.1? Does it cause an error if the extensions are in the sides of a diamond? Does this extend to exceptions as well?

lpw25 commented 10 years ago

So this weirdness only works on 4.02.0 and 4.02.1?

Yes

Does it cause an error if the extensions are in the sides of a diamond?

I'm not quite sure what you mean here, but if you mean does include do the same check then yes it does.

Does this extend to exceptions as well?

Yes. Damien ran a test over the main opam repository and there were only about 5 occurrences of this kind of thing and all of them were bugs. So it was considered a reasonable break in backwards compatibility.