Avatar
↓例のクロージャ式でのタプルのdestructuringについて、Chris LattnerからJohn McCallへ。 One way to split the difference here is to eliminate the splatting behavior, but keep the destructuring (irrefutable pattern matching) behavior as well. In these cases, just require an extra explicit paren for the parameter list. This would change the diff's to: Example 1 - return columns.index { (column, _) in column.lowercased() == lowercaseName } + return columns.index { ((column, _)) in column.lowercased() == lowercaseName } Example 2 : - .map { (mappedColumn, baseColumn) -> (Int, String) in + .map { ((mappedColumn, baseColumn)) -> (Int, String) in Example 3 : - .map { (table, columns) in "\(table)(\(columns.sorted().joined(separator: ", ")))" } + .map { ((table, columns)) in "\(table)(\(columns.sorted().joined(separator: ", ")))" } Example 4 : - dictionary.first { (column, value) in column.lowercased() == orderedColumn.lowercased() } + dictionary.first { ((column, value)) in column.lowercased() == orderedColumn.lowercased() } What do you think? Seems like it would solve the type checker problem, uglify the code a lot less, and make the fixit/migration happily trivial.