-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ModuleInterface] Print full type if ambiguous for extensions. #37879
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
[ModuleInterface] Print full type if ambiguous for extensions. #37879
Conversation
@swift-ci smoke test |
Okay, this breaks IDE tests because more things start getting qualified... trying to figure out a different solution... |
I believe there's a way to set PrintOptions specifically for printing module interfaces which doesn't affect the IDE tests. I agree that the extended type should always be fully qualified in module interfaces, just like we fully qualify TypeReprs in other contexts as well. |
5226e3a
to
3a00f44
Compare
One of the things need to make this work is to remove the forced If we added better ambiguity detection in the future, then we could remove this extra setting and still have nice IDE output in the common case. |
@swift-ci smoke test |
3a00f44
to
9657bb0
Compare
@swift-ci smoke test |
The patch introduces a new setting instead of changing existing settings because the generated interfaces in the IDE have slightly different requirements; the extended type there is unconditionally not printed qualified (even if it is ambiguous). This is likely because the ambiguity heuristic is very weak; it doesn't even do name lookup. Simplifying that logic would be nice, but then we'd need to update a bunch of IDE/print* tests and end up with more more visual clutter in the IDE. Introducing the new setting means we can change the behavior for swiftinterface files without affecting the behavior for IDE interfaces. Fixes rdar://79093752.
9657bb0
to
02afb9d
Compare
@swift-ci test macOS |
Got LGTM separately from Slava. |
Matching swiftlang/swift#37879. (cherry picked from commit ce6ad64)
Fixes rdar://79093752.
Not sure why
Options.FullyQualifiedTypesIfAmbiguous
was set tofalse
in the first place (I would think that setting should always be true apart from debugging?).