-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Isolated keyword should not be permitted in inheritance clause #86001
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
base: main
Are you sure you want to change the base?
Isolated keyword should not be permitted in inheritance clause #86001
Conversation
lib/Sema/TypeCheckType.cpp
Outdated
| NeverNullType | ||
| TypeResolver::resolveIsolatedTypeRepr(IsolatedTypeRepr *repr, | ||
| TypeResolutionOptions options) { | ||
| // isolated is only value for non-EnumCaseDecl parameters. |
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.
nit: maybe fix the typo in this comment while in here
| // isolated is only value for non-EnumCaseDecl parameters. | |
| // isolated is only valid for non-EnumCaseDecl parameters. |
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.
@jamieQ changed
| (options.hasBase(TypeResolverContext::EnumElementDecl) && | ||
| !options.is(TypeResolverContext::Inherited)) || options.is(TypeResolverContext::Inherited))) { | ||
| diagnoseInvalid( | ||
| repr, repr->getSpecifierLoc(), diag::attr_only_on_parameters, |
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.
aside: this diagnostic no longer seems accurate since isolated is now valid on deinits.
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.
Ok, will do a pr removing this
| options.hasBase(TypeResolverContext::EnumElementDecl)) && | ||
| !options.is(TypeResolverContext::Inherited)) { | ||
| (options.hasBase(TypeResolverContext::EnumElementDecl) && | ||
| !options.is(TypeResolverContext::Inherited)) || options.is(TypeResolverContext::Inherited))) { |
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.
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.
it looks that this changes are related to related to use isolated in actors
| } | ||
|
|
||
| protocol P {} | ||
| struct S: isolated P {} // expected-error {{'isolated' may only be used on parameters}} |
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.
nit: the referenced 'enum decl' case should probably also have a test (i didn't see any when searching for this error message).
edit: when testing it out, seems this will just crash the compiler:
enum E {
case iso(isolated any Actor)
}but i guess that's a separate bug i will file filed: #86007
c327081 to
c73dff8
Compare
|
@xedin hey, could take a look? |
As stated in #83538, Isolated keyword should not be permitted in inheritance clause