Skip to content

Commit 769612b

Browse files
authored
Merge pull request #64544 from tshortli/nested-unavailable-requirement
Sema: Allow unavailable decls to witness requirements in more conformances
2 parents dfcc4fc + 5da4e2d commit 769612b

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@ RequirementCheck WitnessChecker::checkWitness(ValueDecl *requirement,
17011701
}
17021702

17031703
if (auto adoptingNominal = DC->getSelfNominalTypeDecl()) {
1704-
if (adoptingNominal->getAttrs().isUnavailable(getASTContext()))
1704+
if (adoptingNominal->getSemanticUnavailableAttr())
17051705
return true;
17061706
}
17071707

test/ModuleInterface/actor_availability.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
// REQUIRES: VENDOR=apple
99

10-
// FIXME: rdar://107052715 temporarily disabled the test; fails on ios simulator
11-
// REQUIRES: rdar107052715
12-
1310
// CHECK: #if compiler(>=5.3) && $Actors
1411
// CHECK-NEXT: public actor ActorWithImplicitAvailability {
1512
public actor ActorWithImplicitAvailability {

test/decl/protocol/req/unavailable.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ extension ConformsToP5: P {
6464
func foo(bar: Foo) { }
6565
}
6666

67+
@available(*, unavailable)
68+
enum UnavailableEnum {
69+
struct ConformsToP6: P {
70+
@available(*, unavailable)
71+
func foo(bar: Foo) { }
72+
}
73+
}
74+
6775
// Include message string from @available attribute if provided
6876
protocol Unavail {
6977
associatedtype T

0 commit comments

Comments
 (0)