Files
swift-mirror/validation-test/compiler_crashers_fixed/0127-issue-48118.swift
Hamish Knight 4e811c3a88 [test] Merge crasher directories
There is no longer much of a good reason to keep these separate,
merge them.
2025-10-18 12:51:30 +01:00

40 lines
868 B
Swift

// RUN: %target-typecheck-verify-swift
// https://github.com/apple/swift/issues/48118
public struct Foo<A, B, C> {}
public protocol P {
associatedtype PA
associatedtype PB = Never
associatedtype PC = Never
typealias Context = Foo<PA, PB, PC>
func f1(_ x: Context, _ y: PA)
func f2(_ x: Context, _ y: PB)
func f3(_ x: Context, _ y: PC)
func f4(_ x: Context)
}
extension P {
public func f1(_ x: Context, _ y: PA) {
}
public func f2(_ x: Context, _ y: PB) {
}
public func f3(_ x: Context, _ y: PC) {
}
public func f4(_ x: Context) {
}
}
public struct S: P {
public typealias PA = String
public typealias PB = Int
public func f1(_ x: Context, _ y: PA) {
}
public func f2(_ x: Context, _ y: PB) { // expected-error {{reference to invalid type alias 'Context' of type 'S'}}
}
}