Revert "[TypeChecker] SE-0326: Enable multi-statement closure inference by default"

This commit is contained in:
Pavel Yaskevich
2021-11-29 17:26:08 -08:00
committed by GitHub
parent e7120a61ad
commit bc54bc6bb7
49 changed files with 247 additions and 480 deletions

View File

@@ -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
})