-
Notifications
You must be signed in to change notification settings - Fork 27
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
Tracking issue for great error messages #40
Comments
I'd like to follow the style of Rust error messages, because they rock. |
First step done ! #114 |
Next step: #116 |
Most of the groundwork is done, now there's mostly a need of writing nice error messages. |
The state of error messages can be seen in the
This is not amazing yet, but at least it points to the correct location in the source file. Some errors fail to do even that, either because of some complicated Span story or because we don't even try (see e.g. import errors).The goal would be better error messages like this one: dhall-rust/dhall/tests/type-inference/failure/unit/FunctionApplicationArgumentNotMatch.txt Lines 1 to 9 in 2ca97e9
|
Errors are not pretty printed in test outputs. It seems like it is attempting to use the ---- test_rename_all_camel_case stdout ----
thread 'test_rename_all_camel_case' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Dhall(Error { kind: Typecheck(TypeError { message: Custom("error: annot mismatch: { function : Text, mergeVariant : Optional Text, postVariant : Optional Text, preVariant : Optional Text } != { function : Text, `merge_variant` : Optional Text, `post_variant` : Optional Text, `pre_variant` : Optional Text }\n --> <current file>:2:1\n |\n... |\n6 | | }\n | |______^ annot mismatch: { function : Text, mergeVariant : Optional Text, postVariant : Optional Text, preVariant : Optional Text } != { function : Text, `merge_variant` : Optional Text, `post_variant` : Optional Text, `pre_variant` : Optional Text }\n |") }) }))', serde_dhall/tests/rename.rs:33:10 |
You get this output because you used fn parse<T: FromDhall + StaticType>(s: &str) -> T {
match from_str(s).static_type_annotation().parse() {
Ok(x) => x,
Err(e) => panic!("{}", e),
}
} and then use |
I created a relevant issue: #228 |
No description provided.
The text was updated successfully, but these errors were encountered: