Files
swift-mirror/test/Sema/single_expression_closure.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

13 lines
476 B
Swift

// RUN: %target-typecheck-verify-swift
// SR-1062:
// Coercion in single expression closure with invalid signature caused segfault
protocol SR_1062_EmptyProtocol {}
struct SR_1062_EmptyStruct {}
struct SR_1062_GenericStruct<T: SR_1062_EmptyProtocol> {}
let _ = { (_: SR_1062_GenericStruct<SR_1062_EmptyStruct>) -> Void in // expected-error{{type 'SR_1062_EmptyStruct' does not conform to protocol 'SR_1062_EmptyProtocol'}}
SR_1062_EmptyStruct() as SR_1062_EmptyStruct
}