Skip to content

Commit c1e517a

Browse files
[tests] Adding tests for SR-12019
1 parent 6df132d commit c1e517a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/attr/attr_dynamic_callable.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,3 +487,14 @@ struct B {
487487

488488
B()("hello") // ok
489489
B()("\(1)") // ok
490+
491+
// SR-12019
492+
@dynamicCallable
493+
struct SR12019 {
494+
func dynamicallyCall<T: StringProtocol>(withArguments: [T]) { // expected-note {{where 'T' = 'Int'}}
495+
print("hi")
496+
}
497+
}
498+
499+
let sr12019 = SR12019()
500+
sr12019(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}

0 commit comments

Comments
 (0)