Right now, depending on how let foo and fn foo are stored, either declaration might become the resolved candidate. This should be changed so that local variable declarations always get precedence over overloads.
Fixing this bug will require some changes in how TypeEnv.getSchemes() is used. Right now this function returns both local schemes and those schemes that are in the parent typing environment. We will need to explicitly traverse the typing environments by hand and break whenever type.overloaded is false.
Currently, the following code could in theory be accepted:
Right now, depending on how
let foo
andfn foo
are stored, either declaration might become the resolved candidate. This should be changed so that local variable declarations always get precedence over overloads.Fixing this bug will require some changes in how
TypeEnv.getSchemes()
is used. Right now this function returns both local schemes and those schemes that are in the parent typing environment. We will need to explicitly traverse the typing environments by hand and break whenevertype.overloaded
isfalse
.