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
The type of t is a type scheme forall alpha.alpha foo, such a precise type can be built from the pattern itself.
By contrast, when you write
| t, _ -> t
^
The type of t is some non-generalizable type variable.
Then (well at some point) it unifies both with the types of x (int foo) and with the type of A (n,b) ((int * bool) foo). Hence, g fails to typecheck...
Ok you tell me : but I there are type constraints....
My first answer would be : do not use them ! They have no clear semantics. When some program does not typecheck, you cannot be sure that adding constraints will make it typecheck.
My second answer would be that some people in the team are working hard on type constraints (or at least on solving some typing problem using then). I'll let them answer more, perhaps there is a solution here.
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.
Original bug ID: 1485
Reporter: administrator
Status: acknowledged
Resolution: open
Priority: normal
Severity: feature
Category: typing
Bug description
Full_Name: Hugo Herbelin
Version: 3.06
OS:
Submission from: herbelin.net1.nerim.net (62.212.105.93)
Bonjour,
I fell on the following curiosity where f : int foo -> bool -> (int * bool)
foo compiles fine but g not.
Regards,
Hugo
The text was updated successfully, but these errors were encountered: