Skip to content

Commit 50bcd32

Browse files
Suyash SrijanSuyash Srijan
authored andcommitted
[test] add a test case
1 parent 3c1e8fa commit 50bcd32

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/Constraints/generics.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,4 +637,12 @@ func compare<C: Collection, Key: Hashable, Value: Equatable>(c: C)
637637
-> Bool where C.Element == (key: Key, value: Value)
638638
{
639639
_ = Dictionary(uniqueKeysWithValues: Array(c))
640-
}
640+
}
641+
642+
// https://bugs.swift.org/browse/SR-7984
643+
struct SR_7984<Bar> {
644+
func doSomething() {}
645+
}
646+
647+
extension SR_7984 where Bar: String {} // expected-error {{type 'Bar' constrained to non-protocol, non-class type 'String'}}
648+
// expected-note {{use 'Bar == String' to require 'Bar' to be 'String'}} {{28-29= == }}

0 commit comments

Comments
 (0)