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

31 lines
884 B
Swift

// RUN: %target-swift-frontend -emit-ir %s
// https://github.com/apple/swift/issues/48464
public protocol VectorIndex {
associatedtype Vector8 : Vector where Vector8.Index == Self, Vector8.Element == UInt8
}
public enum VectorIndex1 : VectorIndex {
case i0
public typealias Vector8 = Vector1<UInt8>
}
public protocol Vector {
associatedtype Index: VectorIndex
associatedtype Element
init(elementForIndex: (Index) -> Element)
subscript(index: Index) -> Element { get set }
}
public struct Vector1<Element> : Vector {
public var e0: Element
public init(elementForIndex: (VectorIndex1) -> Element) {
e0 = elementForIndex(.i0)
}
public subscript(index: Index) -> Element {
get { return e0 }
set { e0 = newValue }
}
}
extension Vector where Index == VectorIndex1 {
public init(_ e0: Element) { fatalError() }
}