mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Instead of making an undo() do an infer(), let's record fine-grained changes about what was retracted, and directly re-insert the same elements into the data structures.
21 lines
421 B
Swift
21 lines
421 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
extension Collection {
|
|
func myMap<T>(_: (Self.Element) -> T) -> [T] { fatalError() }
|
|
}
|
|
|
|
protocol SignedInteger {}
|
|
|
|
extension SignedInteger {
|
|
init<T: BinaryFloatingPoint>(_: T) { fatalError() }
|
|
init<T: BinaryInteger>(_: T) { fatalError() }
|
|
}
|
|
|
|
struct Int32: SignedInteger {
|
|
init(_: String) {}
|
|
}
|
|
|
|
func test() {
|
|
let _: [(Int32, Float)] = (0..<1).myMap { (Int32($0), 0.0) }
|
|
}
|