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
type 'a list = Cons of {elt : 'a; tail : 'a list} | Nil
function length (list : 'b) : int =
match list with
| Nil -> 0
| Cons(_, l') -> length(l') + 1
end
This results in the following error message:
File "tmp.ae", line 5, character 4-7:
5 | | Nil -> 0
^^^
Error The constructor Nil : ∀ 'a : Type . list('a) does not belong to type w1
Which might be surprising to users. To help clarify things, it would help if:
the polymorphic type w1 could instead by named 'b as it is in the source
if the messages explicits that w1 is a type variable that is quantified over in the definition of length
The text was updated successfully, but these errors were encountered:
Consider the following problem:
This results in the following error message:
Which might be surprising to users. To help clarify things, it would help if:
w1
could instead by named'b
as it is in the sourcew1
is a type variable that is quantified over in the definition oflength
The text was updated successfully, but these errors were encountered: