Skip to content

[move-only] Temporarily ban deinits on non-copyable enums. #64692

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

The reason why we are doing this is that:

  1. For non-copyable types, switches are always at +1 for now.
  2. non-copyable enums with deinits cannot be switched upon since that would invalidate the deinit.

So deinits on non-copyable enums are just not useful at this point since you cannot open the enum.

Once we make it so that you can bind a non-copyable enum at +0, we will remove this check.

I added an experimental feature MoveOnlyEnumDeinits so tests that validate the codegen/etc will still work.

rdar://101651138

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

The reason why we are doing this is that:

1. For non-copyable types, switches are always at +1 for now.
2. non-copyable enums with deinits cannot be switched upon since that would
invalidate the deinit.

So deinits on non-copyable enums are just not useful at this point since you
cannot open the enum.

Once we make it so that you can bind a non-copyable enum at +0, we will
remove this check.

I added an experimental feature MoveOnlyEnumDeinits so tests that validate the
codegen/etc will still work.

rdar://101651138
@gottesmm gottesmm force-pushed the pr-f1e588ca3b1fd387de94e5afc8350ef1dd1caf3e branch from 455c663 to aa75e6d Compare March 28, 2023 23:07
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

1 similar comment
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm merged commit 8453978 into swiftlang:main Mar 29, 2023
@gottesmm gottesmm deleted the pr-f1e588ca3b1fd387de94e5afc8350ef1dd1caf3e branch March 29, 2023 08:37
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