Skip to content

Instantly share code, notes, and snippets.

@dabrahams
Last active April 19, 2022 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dabrahams/4c21b1ffba1aea2d7c3ca89d01517378 to your computer and use it in GitHub Desktop.
Save dabrahams/4c21b1ffba1aea2d7c3ca89d01517378 to your computer and use it in GitHub Desktop.
Compilation illegal instruction with swift-driver version: 1.45.2 Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8) Target: arm64-apple-macosx12.0
public struct Pair<T0, T1> {
public var x0: T0
public var x1: T1
public init(x0: T0, x1: T1) { (self.x0, self.x1) = (x0, x1) }
}
extension Pair: RandomAccessCollection
where T0 == T1
{
public var startIndex: Int { 0 }
public var endIndex: Int { 2 }
public subscript(i: Int) -> T0 {
get { return i == 0 ? x0 : x1 }
set { if i == 0 { x0 = newValue } else { x1 = newValue } }
}
}
@dabrahams
Copy link
Author

just swift Zip2Collection.swift

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment