You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6984 Reporter: pcouderc Status: closed (set by @xavierleroy on 2017-02-16T14:16:36Z) Resolution: fixed Priority: normal Severity: minor Version: 4.02.3 Fixed in version: 4.03.0+dev / +beta1 Category: typing Monitored by:@gasche
Bug description
When extending two different types with the same constructor, only the last one is exported in the signature.
For example:
type t = ..;;
type t = ..
type u = ..;;
type u = ..
module M = struct
type t += M
type u += M
end;;
module M : sig type u += M end
That also means that an exception can be shadowed by a constructor that has the same name. It does not matter if both constructor have a different type.
Is it the expected behavior of extensible types? It also happens with module types. I would have guessed that it should be rejected (like multiple definitions of a type).
If not I suppose it may happen when simplifying the signature of a module to remove duplicate idents (which is problematic with type extensions since they should be ordered by a constructor name and a type path).
The text was updated successfully, but these errors were encountered:
The trunk version already rejects structures that defines multiple extension constructors (including exceptions) with the same name. (This allowed to spot a few bugs here and there.)
Original bug ID: 6984
Reporter: pcouderc
Status: closed (set by @xavierleroy on 2017-02-16T14:16:36Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.3
Fixed in version: 4.03.0+dev / +beta1
Category: typing
Monitored by: @gasche
Bug description
When extending two different types with the same constructor, only the last one is exported in the signature.
For example:
type t = ..;;
type t = ..
type u = ..;;
type u = ..
module M = struct
type t += M
type u += M
end;;
module M : sig type u += M end
That also means that an exception can be shadowed by a constructor that has the same name. It does not matter if both constructor have a different type.
Is it the expected behavior of extensible types? It also happens with module types. I would have guessed that it should be rejected (like multiple definitions of a type).
If not I suppose it may happen when simplifying the signature of a module to remove duplicate idents (which is problematic with type extensions since they should be ordered by a constructor name and a type path).
The text was updated successfully, but these errors were encountered: