File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -6513,7 +6513,7 @@ void ConstraintSystem::diagnoseFailureFor(SolutionApplicationTarget target) {
6513
6513
bool ConstraintSystem::isDeclUnavailable (const Decl *D,
6514
6514
ConstraintLocator *locator) const {
6515
6515
// First check whether this declaration is universally unavailable.
6516
- if (D-> getAttrs (). isUnavailable (getASTContext () ))
6516
+ if (AvailableAttr:: isUnavailable (D ))
6517
6517
return true ;
6518
6518
6519
6519
return TypeChecker::isDeclarationUnavailable (D, DC, [&] {
Original file line number Diff line number Diff line change @@ -43,3 +43,25 @@ func unavailableFunction(_ x: Int) -> Bool { true } // expected-note {{'unavaila
43
43
func f_55700( _ arr: [ Int ] ) {
44
44
for x in arr where unavailableFunction ( x) { } // expected-error {{'unavailableFunction' is unavailable}}
45
45
}
46
+
47
+ // rdar://92364955 - ambiguity with member declared in unavailable extension
48
+ struct WithUnavailableExt {
49
+ }
50
+
51
+ @available ( * , unavailable)
52
+ extension WithUnavailableExt {
53
+ static var foo : WithUnavailableExt = WithUnavailableExt ( )
54
+ }
55
+
56
+ func test_no_ambiguity_with_unavailable_ext( ) {
57
+ struct A {
58
+ static var foo : A = A ( )
59
+ }
60
+
61
+ struct Test {
62
+ init ( _: A ) { }
63
+ init ( _: WithUnavailableExt ) { }
64
+ }
65
+
66
+ _ = Test ( . foo) // Ok `A.foo` since `foo` from `WithUnavailableExt` is unavailable
67
+ }
You can’t perform that action at this time.
0 commit comments