Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0196-rdar48937223.swift
Holly Borla 2a7e0099d2 [Diagnostics] Add notes for the type_cannot_conform error that point
to the declaration that requires protocol conformance.
2019-09-17 09:22:07 -07:00

13 lines
413 B
Swift

// RUN: %target-typecheck-verify-swift
protocol P {}
func fn<T, U: P>(_ arg1: T, arg2: (T) -> U) {}
// expected-note@-1 {{required by global function 'fn(_:arg2:)' where 'U' = '()'}}
func test(str: String) {
fn(str) { arg in // expected-error {{type '()' cannot conform to 'P'; only struct/enum/class types can conform to protocols}}
<#FOO#> // expected-error {{editor placeholder in source file}}
}
}