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

26 lines
644 B
Swift

// RUN: %target-swift-frontend %s -typecheck -verify
// RUN: %target-swift-frontend %s -emit-ir -o /dev/null
// https://github.com/apple/swift/issues/48173
protocol P1 {
associatedtype X: P3 where X.Q == Self, X.R == UInt8
associatedtype Y: P3 where Y.Q == Self, Y.R == UInt16
// NOTE: Removing either X or Y from P1 (and A) makes the program compile.
}
struct A: P1 {
typealias X = S<UInt8>
typealias Y = S<UInt16>
}
protocol P2 { }
protocol P3 : P2 { // NOTE: Removing ": P2 " here makes the program compile.
associatedtype Q: P1
associatedtype R
}
struct S<E> : P3 {
typealias R = E
typealias Q = A
}