Skip to content

Commit bd9b18e

Browse files
committed
Add test for FB6114209 / rdar://problem/51413553
This was fixed by pull request swiftlang#26174, but the test case there was specific to property wrappers, while the fix also addresses issues with other ambiguity name lookups such as protocol names in an inheritance clause.
1 parent 4f37d62 commit bd9b18e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/decl/protocol/conforms/redundant_conformance.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,24 @@ extension OtherGenericConditionalConformsToP: P1 {
6565
typealias A = Double
6666
func f() -> Double { return 0.0 }
6767
}
68+
69+
// FB6114209: spurious ambiguity errors
70+
protocol MyUsefulProtocol {
71+
var someInt: Int { get }
72+
}
73+
74+
class Class1 {
75+
typealias ProviderOne = MyUsefulProtocol
76+
}
77+
78+
class Class2 {
79+
typealias ProviderTwo = MyUsefulProtocol
80+
}
81+
82+
class Class3 {
83+
typealias ProviderThree = Class1.ProviderOne & Class2.ProviderTwo
84+
}
85+
86+
class SomeMockClass: Class3.ProviderThree { // okay
87+
var someInt: Int = 5
88+
}

0 commit comments

Comments
 (0)