-
Notifications
You must be signed in to change notification settings - Fork 183
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
Error messages can be confusing #105
Comments
Interesting. I don't think I've ever run in to this before, but I obviously have some biases. The It would be great to have errors about type parameters earlier, and if you have any tips (or examples elsewhere) of putting more constraints on the types so that they bail earlier rather than with whole-program type inference errors (which I also have a hard time grokking), I'm all ears/eyes/etc. I think one take-away is that the documentation and examples for differential aren't up to snuff yet. I OD'd on DD recently and am currently recuperating, but up for making that the next priority. :) |
I have this smallish example:
But when trying to compile it gives me 6 errors of two varieties:
and
My standard debugging mechanism in cases like this is to add type annotations and see when there's a contradiction. But when you add the annotations to the closure params, like
.group(|_group, log_ids: &[(&(_, &isize))], out: &mut Vec<_>| {
, you get a different cryptic error message (maybe rust-lang/rust#41078?):In this case, the actual problem is that the
&diff
should bediff
- both of the failed compiles contain hints if you look hard enough, but it's not easy to figure out. The correct place to add type annotations to help out inference is actually to pin down the diff type, i.e.scope.new_collection::<_, isize>()
.I don't know if there's anything actionable here, but I thought I'd raise the issue. One thing I'd observe is that many of the examples and documentation show type annotations on
worker.dataflow
to pin down the timestamp type - I suppose one possible solution is to just make it so that the 'idiomatic' examples demonstrate a similar thing for the diff type.The text was updated successfully, but these errors were encountered: