[CTYP-102] large hashmaps: failure to discover subtype and error-output to complex to understand Created: 02/Feb/14 Updated: 20/Jul/15
|Component/s:||Core type system|
|Reporter:||Cees van Kemenade||Assignee:||Ambrose Bonnaire-Sergeant|
I am applying core.typed to a project that processes sequences of fairly large hash-maps. I run into two issues:
I came to this conclusion by writing a function that compared the expected type and the actuals type. This function is included too and might be an example of how to produce more compact and readible output for errors on large hash-maps.
The longOutput.clj contains the function that fails (derive-sms_msg-fmt-fail ..) and the nearly similar function (derive-sms_msg-fmt ..) that passes (check-ns).
The file also contains function (show-error) which prints a copy of the type-error and subsequently analyses the derived type with the expected type. The derived type is a union of the expected type and some derivatives based on the inclusion of optional keys. So I as far as I can see the union is subtype of the expected type and the reported error is incorrect.
An example of the error-analysis is included in the file show-error.output.
|Comment by Cees van Kemenade [ 03/Feb/14 2:40 AM ]|
PS: I could imagine that the current (show-error ..) could service as a basis for more compact error-messages on large hashmaps (using length of output as a criterium to decide whether the current error-format or the diffence-analysis results in the most compact error-report).
PS: I strongly believe in the big advantages of a static type-checker. But with the current error-messages it is nearly impossible to migrate a project involving large hash-maps due to the volumunuous error-output.
|Comment by Ambrose Bonnaire-Sergeant [ 03/Feb/14 11:00 PM ]|
Thanks for the detailed report, it really helps. I'll look into this.