-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generative functors are allowed to be applicative ! #7611
Comments
Comment author: @lpw25 I noticed this one a while ago and tried to use it to break soundness, but it appears that this bug is not sufficient to break soundness. Of course it is still a bug. |
Comment author: @garrigue Thanks for the report. Indeed, there is no soundness problem here, since what this code says is just that "if there were values of type F(List).t, then we would be able to compare them". However, the code for generative functor does not allow to create values of this type. A more correct statement would be "generative functors can be used as applicative constructors in type paths". I agree that allowing to write this meaningless type is confusing, and this should be eventually rejected. |
Comment author: @lpw25 Well, you can actually create values of some of these nonsense types:
but I think it is still not enough to break soundness. |
Comment author: @Octachron This was fixed in #1491,
now raises an error:
|
Original bug ID: 7611
Reporter: lavi
Assigned to: @garrigue
Status: resolved (set by @Octachron on 2017-12-13T19:52:31Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.07.0+dev/beta2/rc1/rc2
Category: typing
Related to: #7726
Monitored by: @gasche @yallop
Bug description
in type expression, it is possible to use generative functors as applicative:
module F () = struct type t end
let f (x: F(List).t) (y: F(List).t) = x=y
Even if safe, I would expect the above program to be rejected !
The text was updated successfully, but these errors were encountered: