Closed HalflingHelper closed 1 month ago
I'm not sure what the best way is to detect that with this architecture.
Having said this I modified the Define
case of process_declaration
in a way that appears to solve the issue (passing all tests).
I'm happy to add additional tests for the cases that cause the bug if you think this is a good solution.
The Following program fails:
with the error
This appears to be a problem caused by the type checker and how it handles overloading defines with repeated variable names, and being unable to figure out the situation when they are passed as function arguments.
This is a big issue in particular with the libraries. For example
List.pf
hasL1
defined with in, leading to any program intending to useL1
as a name failing when it tries to pass it as a function argument (A 343 student did exactly this, which is what led me to pursue this bug).I'm not sure what the best solution is
add_overload
when the variable name is bound to a function type. Otherwise not overloading and just overriding? This feel like the most natural to me, but I'm not sure what the best way is to detect that with this architecture.type_check_term
, and choose the appropriate one? This feels like sketchy behavior and not something that happens in any language I know of. This feels especially bad because we could write programs like:which have two values of
x
floating around with different types 🙃.