Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/swift/Migrator/FixitFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ struct FixitFilter {
return false;
}

// The type-checker can erroneously report this diagnostic in the case of
// mismatching closure arguments to things that now take a tuple via SE-0110.
if (Info.ID == diag::extra_argument_labels.ID) {
return false;
}

if (Kind == DiagnosticKind::Error)
return true;

Expand Down
12 changes: 12 additions & 0 deletions test/Migrator/no_extraneous_argument_labels.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// RUN: %target-swift-frontend -typecheck %s -swift-version 3
// RUN: rm -rf %t && mkdir -p %t && %target-swift-frontend -c -primary-file %s -emit-migrated-file-path %t/no_extraneous_argument_labels.result -swift-version 3 -o /dev/null
// RUN: diff -u %s.expected %t/no_extraneous_argument_labels.result
// RUN: not %target-swift-frontend -typecheck %s.expected -swift-version 4

func foo(_ oc: [String]) {
var args: [String] = []
let dictionary: [String: String] = [:]
args.append(contentsOf: oc.map { orderedColumn in
dictionary.first { (column, value) in true }!.value
})
}
12 changes: 12 additions & 0 deletions test/Migrator/no_extraneous_argument_labels.swift.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// RUN: %target-swift-frontend -typecheck %s -swift-version 3
// RUN: rm -rf %t && mkdir -p %t && %target-swift-frontend -c -primary-file %s -emit-migrated-file-path %t/no_extraneous_argument_labels.result -swift-version 3 -o /dev/null
// RUN: diff -u %s.expected %t/no_extraneous_argument_labels.result
// RUN: not %target-swift-frontend -typecheck %s.expected -swift-version 4

func foo(_ oc: [String]) {
var args: [String] = []
let dictionary: [String: String] = [:]
args.append(contentsOf: oc.map { orderedColumn in
dictionary.first { (column, value) in true }!.value
})
}