-
Notifications
You must be signed in to change notification settings - Fork 1.7k
IDE auto-imports first implementation library over public export of implementation library #47842
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
That library is exported from the public library of the package, which can be imported using import 'package:collection/collection.dart'; |
And the warning definitely should show up. The warning is for your protection. |
So is this an IDE issue? Because the IDE auto imported the src/ file now that it imports extensions. |
Yes, that's a known bug (I haven't looked to see whether there's an issue open for it). The IDE support currently doesn't have the information necessary to determine which public libraries should be imported in order to import something that's declared in a @scheglov Perhaps we can talk soon about efficient ways to capture that information. |
@bernaferrari can you say which IDE auto-imported the library in |
Intellij |
I can reproduce the issue. We should know extensions exported from a library, and probably should use exported namespaces instead of looking at declarations. |
Bug: #47842 Change-Id: Ib6c4d6791f823191ef39998a6e350c48915d52fa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222243 Reviewed-by: Phil Quitslund <[email protected]>
So, we don't need ExtensionCache anymore. This fixes the issue with importing a library from lib/src sometimes. Bug: #47842 Change-Id: I9a28fb2e1e14ab96a58c3ef72daa87562f1bccd6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223441 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
The issue was fixed with the CL above. |
I think
Don't import implementation files from another package.
shouldn't show up for package:collection?With #45680 recommending firstWhereOrNull, I can't use it without this warning.
The text was updated successfully, but these errors were encountered: