-
Notifications
You must be signed in to change notification settings - Fork 694
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
Reconcile and consolidate type issue troubleshooting pages #4393
Comments
I believe the context is that Fixing common type problems was introduced alongside an optional strong mode (found first in the web Dart dev compiler(DDC)) and then later for Dart 2's sound type system, whereas Fixing type promotion failures was introduced alongside null safety where that class of type problem became much more common than before, so the compiler frontend and analyzer could potentially link to those as a guide for fixing them. It seems Fixing type promotion failures is just focused on that specific subset of type problems, where one type is not promoted to the expected type automatically and how to potentially fix them. In the end the goals seem the same like you said, with the added use of tooling linking to Fixing type promotion failures. The style and content of Fixing type promotion failures matches much better with the current site and for using as potential link destinations, so perhaps it would be better to combine them, following that newer style? There are also issues for covering other types of sound issues (#562). |
That sounds accurate to me. I agree with @parlough that it would make sense to combine them. |
I don't remember the origins of those pages. I guess the question is what information are we trying to make available and how best to do so. Both pages appear to have the same goal, which is to explain some of the common pitfalls that developers can run into related to the type system. If that's true, then having that information in a single place seems reasonable. We should also look for opportunities to link to this information from https://dart.dev/tools/diagnostic-messages. |
Ok, action item will be to consolidate the pages (sound-problems and non-promotion-reasons). Currently, Fixing type promotion failures doesn't show up anywhere in the left nav. Since it's the more modern page, that should probably be the more visible page. One thing I like more about sound-problems is that the actual error messages are included with the examples. This would be a good thing to
More of a stretch (for me, based on my current level of understanding) is identifying relations to diagnostic-messages. A quick skim of diagnostic-messages, it seems that there aren't type promotion failure specific messages on that page (?), but definitely type problems in general. Which of those diagnostic messages correlate to type promotion failures? |
Good question. In principle a lot of errors could result from a type promotion failure, but I would guess the most common ones are probably |
I was actually thinking about links in the opposite direction. If a diagnostic could be the result of a type promotion failure the docs should probably say so and have a link back to the more complete description of what can cause promotion failures. (Though in the IDE there will often already be a direct link to this documentation. Which means that we'll need to be careful not to break those links.) |
Fixing type promotion failures (non-promotion-reasons) and Fixing common type problems (sound-problems)
In terms of purpose and subject matter, I can't really tell if they're trying to address different topics. Seems like basically the same thing to me. Does anyone know what the goal was for each page originally?
@sfshaza2 you have a lot of commits early on for Fixing common type problems, any insight?
It seems like Fixing type promotion failures might've been created separately because of how it interacts with analyzer tooling, is that accurate @stereotype441 or @bwilkerson (you both left feedback on the first commit)
Just trying to understand the goal of each so I know what information to put where going forward, thanks!
Notes:
The text was updated successfully, but these errors were encountered: