Skip to content

Ban classes from extending Actor and DistributedActor protocol explicitly #38050

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
merged 2 commits into from
Jun 24, 2021

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Jun 23, 2021

WIP, some cleanup pending.

(bool))

ERROR(actor_protocol_illegal_inheritance,none,
"illegal explicit inheritance from 'Actor' protocol, "
Copy link
Contributor

@harlanhaskins harlanhaskins Jun 23, 2021

Choose a reason for hiding this comment

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

illegal is not a term I've seen thrown around in diagnostics, can we pick something less jarring? 😄

How about classes cannot declare a conformance to the 'Actor' protocol; declare this as %select{an actor|a distributed actor}0 instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @harlanhaskins ! I was struggling with the right wording here.

@DougGregor suggested Non-actor type %0 cannot conform to the 'Actor' protocol how does that sound?

And there's a fixit to change struct->actor etc :)

@ktoso ktoso force-pushed the wip-ban-inherit-actor-protocols branch from bf3a977 to 085a1a9 Compare June 24, 2021 02:53
@ktoso ktoso changed the title [WIP] Ban classes from extending Actor and DistributedActor protocol explicitly Ban classes from extending Actor and DistributedActor protocol explicitly Jun 24, 2021
@ktoso
Copy link
Contributor Author

ktoso commented Jun 24, 2021

@swift-ci please smoke test

@ktoso
Copy link
Contributor Author

ktoso commented Jun 24, 2021

@swift-ci please smoke test macOS

@ktoso ktoso merged commit eada7df into swiftlang:main Jun 24, 2021
@ktoso ktoso deleted the wip-ban-inherit-actor-protocols branch June 24, 2021 21:06
@ktoso
Copy link
Contributor Author

ktoso commented Jun 25, 2021

Related to rdar://78975415

@ktoso
Copy link
Contributor Author

ktoso commented Jun 25, 2021

resolves rdar://79749091

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.

2 participants