-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clearly report type errors on API boundary #6682
Comments
How do we plan to check conditions like
|
I guess one way to do it would be to just ignore the 'type argument' and check Probably in library code we'd need to then ensure that we verify the type once read from the vector, like:
Still, it is a bit harder now to track the error, because the true error happens when calling However, again - I think this solution will still improve most use cases so greatly that it is of course worth doing even if it will not (yet) be perfect in the more complex errors. |
Implementing the "erasure" style is a matter of a week. Then the Enso type system can be on par with Java 1.4 (before the introduction of generics). Implementing |
However recording type at the creation may give us "incomplete type":
probably Thinking about it more, I think this leads to Julia-like type system:
|
Jaroslav Tulach reports a new STANDUP for yesterday (2023-05-22): Progress: - Investigating ascribed types #6682
Next Day: Runtime check of argument types
|
Jaroslav Tulach reports a new STANDUP for yesterday (2023-05-23): Progress: - Map.equals bugfix: #6803 Next Day: Bugfixing & meeting about imports |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-05-28): Progress: - "Fixing" some wrong constructor signatures: #6790 (comment) It should be finished by 2023-05-29. Next Day: Bookclubs, bugfixing, ascribed types |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-05-29): Progress: - store location of atom constructors: fe0edb0
Next Day: Interfaces & ascribed types
|
Jaroslav Tulach reports a new 🔴 DELAY for yesterday (2023-05-29): Summary: There is 7 days delay in implementation of the Clearly report type errors on API boundary (#6682) task. PR is ready for QA, but not integratable yet Delay Cause: Runtime checks in Possible solutions: Wojciech suggests to design an annotation and only type check then. We can disable checks on constructors for now. We can add |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-05-30): Progress: - Runtime check of ascribed types is in: #6790
Next Day: Imports & Interfaces & ascribed types
|
Currently Enso is using "duck typing" - e.g. one can invoke a function with any argument and if such argument has the right methods, fields, etc. as expected, the execution goes on. Such a behavior is causing issues in the IDE - when a wrong node is connected as an argument (a
Text
instead ofNumber
for example), the execution isn't rejected immediately, but proceeds until the "duck typing" fails. However that is often late, deeply in the standard libraries internals and produces hard to understand errors. It'd be way better if the typing error was caught right on the API boundary.Let's use the ascribed types for real type checks. With the above type definition, the following would execute OK:
Num.All "ok"
, but invokingNum.Value "error"
would rise aType_Error
. Similarly with aInvoking
check "error"
shall yield an error whilecheck (Num.All "ok")
shall be fine. There is a proof of concept branch demonstrating it can all work.The text was updated successfully, but these errors were encountered: