Skip to content

[move-only] Two small fixes #59303

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

Merged

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Jun 7, 2022

Specifically, in the first commit, I make SILType::getRawASTType() private. We don't want people touching the Raw AST Type directly. That is a breakage in the abstraction. Second, I renamed some of the move only wrapper APIs to have move only wrapper instead of just move only in the name. This prevents some confusion that we saw in the other PR.

gottesmm added 2 commits June 7, 2022 15:43
… a friend so we can invoke that method.

The only place outside of SILType that uses getRawASTType() is in SILPrinter. It
is really an inner detail of SILType that we don't want to expose. With that in
mind, in this commit we:

1. Made SILType::getRawASTType() private.

2. Forward declared SILPrinter in SILType.h. We don't define it so no one can
use it, but the declaration still lets us make it a friend class of SILType
(allowing SILPrinter to still access getRawASTType()).
…e explicitly about move only wrapper and not move only itself.

Specifically:

* isMoveOnly() -> isMoveOnlyWrapped()
* asMoveOnly() -> addingMoveOnlyWrapper()
* withoutMoveOnly() -> removingMoveOnlyWrapper()
* copyMoveOnly() -> copyingMoveOnlyWrapper()

This is just pure renaming to resolve confusion from the reader.
@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 7, 2022

@swift-ci smoke test

@gottesmm gottesmm merged commit f6f1be5 into swiftlang:main Jun 8, 2022
@gottesmm gottesmm deleted the pr-cd7072441becdbf718aaf324a1d402ad5d6803b4 branch June 8, 2022 18:46
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