Files
swift-mirror/validation-test/stdlib/AnyHashableDiagnostics.swift
David Farler b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00

14 lines
596 B
Swift

// RUN: %target-typecheck-verify-swift
// If this test fails, the following types started to conditionally conform to
// `Hashable`. When that happens, please add a custom `AnyHashable`
// representation to corresponding Objective-C types.
func isHashable<T : Hashable>(_: T.Type) {}
isHashable(Int.self) // no-error // Test that `isHashable(_:)` works.
isHashable(Array<Int>.self) // expected-error {{'Array<Int>' does not conform to expected type 'Hashable'}}
isHashable(Dictionary<Int, Int>.self) // expected-error {{'Dictionary<Int, Int>' does not conform to expected type 'Hashable'}}