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
Ensure that types derived for REPL expressions have no free type variables. Currently the type resolver will return a type like 'a list -> 'a, which has a free type variable. When that value is applied to a value, say an int, the type of the result will be wrongly given as 'a when it should be int.
The solution is to wrap the derived type in a ForallType if there are any free type variables.
As part of the solution, add class TypeVisitor and method Type.accept(TypeVisitor).
The text was updated successfully, but these errors were encountered:
Ensure that types derived for REPL expressions have no free type variables. Currently the type resolver will return a type like
'a list -> 'a
, which has a free type variable. When that value is applied to a value, say anint
, the type of the result will be wrongly given as'a
when it should beint
.The solution is to wrap the derived type in a
ForallType
if there are any free type variables.As part of the solution, add
class TypeVisitor
and methodType.accept(TypeVisitor)
.The text was updated successfully, but these errors were encountered: