File tree Expand file tree Collapse file tree 5 files changed +7
-17
lines changed Expand file tree Collapse file tree 5 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -7532,7 +7532,8 @@ inline bool Decl::isPotentiallyOverridable() const {
7532
7532
isa<SubscriptDecl>(this ) ||
7533
7533
isa<FuncDecl>(this ) ||
7534
7534
isa<DestructorDecl>(this )) {
7535
- return getDeclContext ()->getSelfClassDecl ();
7535
+ auto classDecl = getDeclContext ()->getSelfClassDecl ();
7536
+ return classDecl && !classDecl->isActor ();
7536
7537
} else {
7537
7538
return false ;
7538
7539
}
Original file line number Diff line number Diff line change @@ -3345,9 +3345,6 @@ AccessLevel ValueDecl::getFormalAccess() const {
3345
3345
}
3346
3346
3347
3347
bool ValueDecl::hasOpenAccess (const DeclContext *useDC) const {
3348
- assert (isa<ClassDecl>(this ) || isa<ConstructorDecl>(this ) ||
3349
- isPotentiallyOverridable ());
3350
-
3351
3348
AccessLevel access =
3352
3349
getAdjustedFormalAccess (this , useDC,
3353
3350
/* treatUsableFromInlineAsPublic*/ false );
Original file line number Diff line number Diff line change @@ -827,7 +827,9 @@ void AttributeChecker::visitAccessControlAttr(AccessControlAttr *attr) {
827
827
}
828
828
829
829
if (attr->getAccess () == AccessLevel::Open) {
830
- if (!isa<ClassDecl>(D) && !D->isPotentiallyOverridable () &&
830
+ auto classDecl = dyn_cast<ClassDecl>(D);
831
+ if (!(classDecl && !classDecl->isActor ()) &&
832
+ !D->isPotentiallyOverridable () &&
831
833
!attr->isInvalid ()) {
832
834
diagnose (attr->getLocation (), diag::access_control_open_bad_decl)
833
835
.fixItReplace (attr->getRange (), " public" );
@@ -2099,7 +2101,8 @@ void AttributeChecker::visitRequiredAttr(RequiredAttr *attr) {
2099
2101
return ;
2100
2102
}
2101
2103
// Only classes can have required constructors.
2102
- if (parentTy->getClassOrBoundGenericClass ()) {
2104
+ if (parentTy->getClassOrBoundGenericClass () &&
2105
+ !parentTy->getClassOrBoundGenericClass ()->isActor ()) {
2103
2106
// The constructor must be declared within the class itself.
2104
2107
// FIXME: Allow an SDK overlay to add a required initializer to a class
2105
2108
// defined in Objective-C
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
- // RUN: %target-swift-frontend -emit-module -enable-experimental-concurrency -enable-library-evolution -emit-module-path=%t/resilient_actor.swiftmodule -module-name=resilient_actor %S/Inputs/resilient_actor.swift
3
2
// RUN: %target-swift-frontend -I %t -emit-ir -enable-experimental-concurrency -enable-library-evolution %s | %IRGenFileCheck %s
4
3
// REQUIRES: concurrency
5
4
8
7
// 0x81810050: the same, but using a singleton metadata initialization
9
8
// CHECK-SAME: i32 {{-2122317744|-2122252208}},
10
9
11
- import resilient_actor
12
-
13
10
// CHECK-LABEL: define hidden swiftcc void @"$s13default_actor1ACfD"(%T13default_actor1AC* swiftself %0)
14
11
// CHECK-NOT: ret void
15
12
// CHECK: call swiftcc void @swift_defaultActor_deallocate(
You can’t perform that action at this time.
0 commit comments