-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ScanDependency] Do not use public/private swiftinterface in the same package #71857
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
|
||
// RUN: not %target-swift-frontend -typecheck %t/ClientLoadInterface.swift -package-name libPkg -I %t 2> %t/resultY.output | ||
// RUN: %FileCheck %s -check-prefix CHECK-Y < %t/resultY.output | ||
// CHECK-Y: error: module 'LibInterface' is in package 'libPkg' but was built from a non-package interface; modules of the same package can only be loaded if built from source or package interface: {{.*}}LibInterface.private.swiftinterface | ||
// CHECK-Y: error: no such module 'LibInterface' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not the behavior we want. The original diagnostics should still happen here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So... this is tricky. The reason for the diagnostics do not happen is after the change, the private swiftinterface is not considered a valid dependency for the source, thus it is not doing an implicit module build to create a module that cannot be imported with the error. You can still construct a case that trigger the warning but you have to produce the wrong module first before running the implicit build. That behavior is verified in |
||
|
||
|
||
//--- Lib.swift | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are these input types specified? In deps.json as in the test below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the type of the input on the command-line, determined by file extension. The only time something can import public/private interface when in the same package is building a public/private interface from the same package, hence checking the input type.