mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The change to roll back a part of SE-0110 to allow multi-argument functions to be passed in places where functions taking a tuple are expected resulted in a regression in some cases where the fix would strip off the last ParenType from single-argument functions. Instead of stripping off parens from both function types we're trying to match when they both have them, strip off none. This ensures that we don't get summarily rejected in the nested matchTypes call by other SE-0110-related code that bails if the two types do not have the same "parenness". Fixes rdar://problem/33043106 / SR-5387.
6 lines
170 B
Swift
6 lines
170 B
Swift
// RUN: %target-swift-frontend -swift-version 4 %s -typecheck
|
|
|
|
func flatterMap(_ records: [(Int)]) -> [Int] {
|
|
records.flatMap { _ in return 1 } // expected-note {{}}
|
|
}
|