Skip to content

Commit cddd86f

Browse files
committed
ConstraintSystem: Add a test case for rdar://101814209.
1 parent 429f19a commit cddd86f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/Constraints/availability.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,24 @@ func unavailableFunction(_ x: Int) -> Bool { true } // expected-note {{'unavaila
4343
func f_55700(_ arr: [Int]) {
4444
for x in arr where unavailableFunction(x) {} // expected-error {{'unavailableFunction' is unavailable}}
4545
}
46+
47+
// rdar://101814209
48+
public struct Box<T> {
49+
@usableFromInline
50+
let value: T
51+
}
52+
53+
@available(macOS, unavailable)
54+
extension Box where T == Int {
55+
@usableFromInline
56+
init(value: T) {
57+
self.value = value
58+
}
59+
}
60+
61+
@available(macOS, unavailable)
62+
@_alwaysEmitIntoClient public func aeicFunction() {
63+
// Select the unavailable @usableFromInline init over the synthesized internal
64+
// memberwise initializer.
65+
_ = Box(value: 42)
66+
}

0 commit comments

Comments
 (0)