Skip to content

Commit 0b82d78

Browse files
committed
stdlib: add indicator tests for more custom AnyHashable representations that will be needed in future
1 parent a3254b7 commit 0b82d78

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %target-parse-verify-swift
2+
3+
// If this test fails, the following types started to conditionally conform to
4+
// `Hashable`. When that happens, please add a custom `AnyHashable`
5+
// representation to corresponding Objective-C types.
6+
7+
func isHashable<T : Hashable>(_: T.Type) {}
8+
9+
isHashable(Int.self) // no-error // Test that `isHashable(_:)` works.
10+
11+
isHashable(Array<Int>.self) // expected-error {{'Array<Int>' does not conform to expected type 'Hashable'}}
12+
isHashable(Dictionary<Int, Int>.self) // expected-error {{'Dictionary<Int, Int>' does not conform to expected type 'Hashable'}}
13+

0 commit comments

Comments
 (0)