-
Notifications
You must be signed in to change notification settings - Fork 84
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
Type annotations are ignorred when module contains error #108
Comments
Yup, most analysis depends on not having type errors :) |
I could do that hack that merlin does and input an |
Orr I guess if it's a straight up type annotation, I could try to resolve that by hand... but that's hard to do correctly. Maybe best effort would be fine there? |
When I started using Reason toolchain my first source of confusion was the difference in how toolchain and compiler see a code. E.g. when I passed record that wasn't in scope to some function compiler told me that I don't know what this argument is but when I was hovering argument tooling was giving me expected (by me) type. It was super confusing b/c I assumed that tooling and compiler has single source of this information. So I'd stick to compiler as much as possible in terms of exposing what the things are. Just to clarify my usecase that triggered this issue: I was passing argument to a function w/ explicit type annotation. Later on, inside this function I made a mistake in property name (of the annotated record) and toolchain showed me an error. I wanted to hover the type (annotation) or cmd + click on module in type annotation to look at the type but toolchain simply ignored this part. So my expectations were similar: if compiler knows what this thing is then toolchain should know this as well so I can use its functionality to work w/ this type. I really haven't looked into tooling internals and have zero understanding how these parts work together so not sure how hard it is to share the compiler's vision of code w/ toolchain. But I assume this is what the most of developers expect. |
I searched the list of issues to see if it has been already reported. And I find this a bit confusing (I am used to TypeScript dev, which doesn't work like that... it highlights all types errors in a file, for example). I understand it can be hard to fix, I have no idea how IDEs manage to resume code analysis after this kind of error (forcing "any" to resume analysis looks like a good idea), so any "best effort" in the domain would be welcome, it can help a lot beginners like me. Thank you for this nice extension, it is already very useful. |
E.g.
The text was updated successfully, but these errors were encountered: