Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Misleading comment on private type abbreviations #6548
Original bug ID: 6548
In "Language extensions", paragraph 7.9.2 says that
"For ambiguity reasons, typexpr cannot be an object or polymorphic variant type, but a similar behaviour can be obtained through private row types."
Actually private row types behave in a different way than what would be expected from private type abbreviation of a polymorphic variant:
: sig type t = private [>
let f (x : T.t) = match x with |
Comment author: @lpw25
This sentence should indeed be removed, but not for the reason suggested. It should be removed because this limitation was removed in version 4.02:
This exhaustivity check is not failing because
Then the exhaustivity check passes as you wanted.
Also note that with a regular private type abbreviation you cannot match directly on the abbreviated type, but must instead use a coercion:
So it is actually private type abbreviations that are more restricted than private row types.