Files
swift-mirror/test/stdlib/LazyCollectionPlus.swift
Pavel Yaskevich 98c6a7e127 [stdlib] Add + overload to LazyMapCollectionProtocol in Swift 3 mode
This overload is needed to re-enable Swift 3 source compatibility
related to a bugfix in ranking behavior of the constraint solver.
2017-11-16 13:38:24 -08:00

18 lines
470 B
Swift

// RUN: rm -rf %t ; mkdir -p %t
// RUN: %target-build-swift %s -o %t/a.out3 -swift-version 3 && %target-run %t/a.out3
// REQUIRES: executable_test
import StdlibUnittest
var tests = TestSuite("LazyCollectionPlus")
tests.test("NoAmbiguity") {
let d: [String: Int] = ["" : 0]
let xs = d.values.map { $0 }
let ys = d.values.map { $0 + 42 }
let actual = xs + ys // this line should compile without ambiguity
expectEqualSequence([0, 42], actual)
}
runAllTests()