-
Notifications
You must be signed in to change notification settings - Fork 213
Inference Enhancements - Generic Class Functions #888
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
Comments
Sorry, can you elaborate a bit? There are certainly known limitations to the inference we currently do, including the one you reference, but I don't see anything in the code that you included above that we shouldn't be able to infer, and if I test it out I haven't been able to find any dynamic code in it (I may be missing something). The IDE snippets you included seem to refer to different code? There is something odd in the error message you listed:
That suggests that Can you verify that the issue you are seeing does in fact occur in your reproduction, and point out exactly where in the code you're seeing dynamic? Also, can you include the sdk version that you're seeing this in? |
@leafpetersen I have created a minimal reproducible example (MRE): https://dartpad.dartlang.org/c8b6d45927b383810bfeef7151416ca0 |
Thanks, yes your MRE is exactly an instance of #731 . I do hope to address this in a future language update, but since it is breaking to change inference (even if to improve it) it's not a trivial thing to do. I don't have an ETA on when this will bubble to the top of the queue, sorry! |
@leafpetersen should this just marked as duplicate of #731? |
@mraleph I believe so, yes. @D10100111001 if there are any issues here not covered by #731 feel free to re-open. Duplicate of #731 |
It is really annoying to work with some limitations on the inference related to the dart language. Coming from C# and TypeScript and other typed languages it has always been easy to get good inference. This is related to #731.
Here is an example:
The IDE is able to infer and show the correct tooltip regarding the component definition but the dart analyzer does not agree. If it isn't clear, essentially the analyzer is unable to infer to the type and it falls back to dynamic and I have implicit dynamic disabled.
Is there a timeline on when this will be implemented? I see the referenced issue was created in 2016.
The text was updated successfully, but these errors were encountered: