Files
swift-mirror/validation-test/compiler_crashers_fixed/rdar54394068.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

56 lines
826 B
Swift

// RUN: %target-swift-frontend -typecheck -verify %s
protocol A {
associatedtype BType: B where BType.AType == Self
associatedtype CType: C where CType.AType == Self
var b: BType { get }
var c: CType { get set }
func bGetter() -> BType
mutating func cSetter(_ newC: CType)
subscript (b: BType) -> CType { get set }
}
protocol B {
associatedtype AType: A
}
protocol C {
associatedtype AType: A
}
struct AImpl: A {
typealias BType = BImpl
typealias CType = CImpl
let b: BImpl
var c: CImpl
func bGetter() -> BImpl {
return b
}
mutating func cSetter(_ newC: CImpl) {
c = newC
}
subscript(b: BImpl) -> CImpl {
get {
return c
}
set {
c = newValue
}
}
}
struct BImpl: B {
typealias AType = AImpl
}
struct CImpl: C {
typealias AType = AImpl
}