Skip to content

Conversation

@xymus
Copy link
Contributor

@xymus xymus commented Mar 2, 2023

Update the exportability check to ensure that inlinable code can only refer to public types, so either local public types or public types imported publicly. As a result, we report any decl imported as non-public in inlinable code.

rdar://105902141

Inlinable code can only refer to public types, so either local public
types or public types imported publicly. Report any decl imported as
non-public in inlinable code.

rdar://105902141
@xymus xymus requested review from beccadax, elsh and tshortli March 2, 2023 18:15
@xymus
Copy link
Contributor Author

xymus commented Mar 2, 2023

@swift-ci Please smoke test

package import PackageLib // expected-note 2 {{module 'PackageLib' imported as 'package' here}}
internal import InternalLib // expected-note 12 {{module 'InternalLib' imported as 'internal' here}}
fileprivate import FileprivateLib // expected-note 6 {{module 'FileprivateLib' imported as 'fileprivate' here}}
private import PrivateLib // expected-note 6 {{module 'PrivateLib' imported as 'private' here}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking about adding the name of the affected decl to this diagnostic. While the current version works well in the terminal it may be harder to follow in an IDE when a big file is open.

@xymus xymus merged commit 517a539 into swiftlang:main Mar 3, 2023
@xymus xymus deleted the access-level-inlinable branch March 3, 2023 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant