Skip to content

Commit 4d8c437

Browse files
committed
Add test case for rdar://92092635
1 parent f0a7358 commit 4d8c437

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %target-typecheck-verify-swift -requirement-machine-inferred-signatures=on
2+
3+
// The GenericSignatureBuilder did not diagnose the first two.
4+
5+
struct G1<T : BinaryInteger & FixedWidthInteger & UnsignedInteger & Codable> {}
6+
// expected-warning@-1 {{redundant conformance constraint 'T' : 'BinaryInteger'}}
7+
8+
struct G2<T> where T : BinaryInteger & FixedWidthInteger & UnsignedInteger & Codable {}
9+
// expected-warning@-1 {{redundant conformance constraint 'T' : 'BinaryInteger'}}
10+
11+
struct G3<T> where T : BinaryInteger, T : FixedWidthInteger, T : UnsignedInteger & Codable {}
12+
// expected-warning@-1 {{redundant conformance constraint 'T' : 'BinaryInteger'}}
13+
14+
// FIXME: These should also diagnose, but do not due to overly-eager
15+
// canonicalization in ProtocolCompositionType::get().
16+
17+
struct G1a<T : BinaryInteger & FixedWidthInteger & UnsignedInteger> {}
18+
struct G2a<T> where T : BinaryInteger & FixedWidthInteger & UnsignedInteger {}
19+

0 commit comments

Comments
 (0)