Files
swift-mirror/test/multifile/protocol-conformance-broken-2.swift
2024-01-20 19:16:58 -05:00

26 lines
619 B
Swift

// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: %target-swift-frontend -typecheck -verify -primary-file %t/Usage.swift %t/Conformance.swift
//--- Conformance.swift
protocol P {
associatedtype A: Equatable
func f() -> A
}
extension P {
func f() -> A { fatalError() }
}
struct S: P {}
//--- Usage.swift
func callee(_: some Equatable) {}
// FIXME: This source location will become more accurate once TypeCheckExpr
// is a request! For now, pointing at the function is still better than crashing.
func caller() { // expected-error {{type 'S' does not conform to protocol 'P'}}
callee(S().f())
}