mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Revert "[TypeChecker] SE-0326: Enable multi-statement closure inference by default"
This commit is contained in:
@@ -148,7 +148,7 @@ func ***~(_: Int, _: String) { }
|
||||
i ***~ i // expected-error{{cannot convert value of type 'Int' to expected argument type 'String'}}
|
||||
|
||||
@available(*, unavailable, message: "call the 'map()' method on the sequence")
|
||||
public func myMap<C : Collection, T>( // expected-note {{'myMap' has been explicitly marked unavailable here}}
|
||||
public func myMap<C : Collection, T>(
|
||||
_ source: C, _ transform: (C.Iterator.Element) -> T
|
||||
) -> [T] {
|
||||
fatalError("unavailable function can't be called")
|
||||
@@ -161,7 +161,7 @@ public func myMap<T, U>(_ x: T?, _ f: (T) -> U) -> U? {
|
||||
|
||||
// <rdar://problem/20142523>
|
||||
func rdar20142523() {
|
||||
_ = myMap(0..<10, { x in // expected-error {{'myMap' is unavailable: call the 'map()' method on the sequence}}
|
||||
myMap(0..<10, { x in // expected-error{{cannot infer return type for closure with multiple statements; add explicit type to disambiguate}} {{21-21=-> <#Result#> }} {{educational-notes=complex-closure-inference}}
|
||||
()
|
||||
return x
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user