Skip to content

Commit 5d76ecc

Browse files
committed
---
yaml --- r: 348855 b: refs/heads/master c: e2096ae h: refs/heads/master i: 348853: 899073e 348851: c941876 348847: 95c0cd2
1 parent 48d14db commit 5d76ecc

File tree

10 files changed

+16
-20
lines changed

10 files changed

+16
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f03d210be9e0354a66be8a1cc769d085f3a71c85
2+
refs/heads/master: e2096ae34def712ffb584375bd2d9c3716ae3705
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ ERROR(cannot_convert_argument_value,none,
381381
(Type,Type))
382382

383383
NOTE(candidate_has_invalid_argument_at_position,none,
384-
"candidate expects value of type %0 at position #%1",
384+
"candidate expects value of type %0 for parameter #%1",
385385
(Type, unsigned))
386386

387387
ERROR(cannot_convert_array_to_variadic,none,

trunk/lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5042,13 +5042,9 @@ bool ArgumentMismatchFailure::diagnoseAsError() {
50425042
}
50435043

50445044
bool ArgumentMismatchFailure::diagnoseAsNote() {
5045-
auto *locator = getLocator();
5046-
auto argToParam = locator->findFirst<LocatorPathElt::ApplyArgToParam>();
5047-
assert(argToParam);
5048-
50495045
if (auto *callee = getCallee()) {
50505046
emitDiagnostic(callee, diag::candidate_has_invalid_argument_at_position,
5051-
getToType(), argToParam->getParamIdx());
5047+
getToType(), getParamPosition());
50525048
return true;
50535049
}
50545050

trunk/test/Constraints/closures.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ takeVoidVoidFn { () -> Void in
349349
}
350350

351351
// <rdar://problem/19997471> Swift: Incorrect compile error when calling a function inside a closure
352-
func f19997471(_ x: String) {} // expected-note {{candidate expects value of type 'String' at position #0}}
353-
func f19997471(_ x: Int) {} // expected-note {{candidate expects value of type 'Int' at position #0}}
352+
func f19997471(_ x: String) {} // expected-note {{candidate expects value of type 'String' for parameter #1}}
353+
func f19997471(_ x: Int) {} // expected-note {{candidate expects value of type 'Int' for parameter #1}}
354354

355355
func someGeneric19997471<T>(_ x: T) {
356356
takeVoidVoidFn {

trunk/test/Constraints/construction.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ enum Z {
1616

1717
init() { self = .none }
1818
init(_ c: UnicodeScalar) { self = .char(c) }
19-
// expected-note@-1 2 {{candidate expects value of type 'UnicodeScalar' (aka 'Unicode.Scalar') at position #0}}
19+
// expected-note@-1 2 {{candidate expects value of type 'UnicodeScalar' (aka 'Unicode.Scalar') for parameter #1}}
2020
init(_ s: String) { self = .string(s) }
21-
// expected-note@-1 2 {{candidate expects value of type 'String' at position #0}}
21+
// expected-note@-1 2 {{candidate expects value of type 'String' for parameter #1}}
2222
init(_ x: Int, _ y: Int) { self = .point(x, y) }
2323
}
2424

trunk/test/Constraints/diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ func SR_6272_c() {
10691069
struct SR_6272_D: ExpressibleByIntegerLiteral {
10701070
typealias IntegerLiteralType = Int
10711071
init(integerLiteral: Int) {}
1072-
static func +(lhs: SR_6272_D, rhs: Int) -> Float { return 42.0 } // expected-note 2 {{candidate expects value of type 'Int' at position #1}}
1072+
static func +(lhs: SR_6272_D, rhs: Int) -> Float { return 42.0 } // expected-note 2 {{candidate expects value of type 'Int' for parameter #2}}
10731073
}
10741074

10751075
func SR_6272_d() {

trunk/test/Constraints/overload.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
func markUsed<T>(_ t: T) {}
44

55
func f0(_: Float) -> Float {}
6-
// expected-note@-1 {{candidate expects value of type 'Float' at position #0}}
6+
// expected-note@-1 {{candidate expects value of type 'Float' for parameter #1}}
77
func f0(_: Int) -> Int {}
8-
// expected-note@-1 {{candidate expects value of type 'Int' at position #0}}
8+
// expected-note@-1 {{candidate expects value of type 'Int' for parameter #1}}
99

1010
func f1(_: Int) {}
1111

trunk/test/Generics/function_defs.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ protocol Overload {
7474
associatedtype B
7575
func getA() -> A
7676
func getB() -> B
77-
func f1(_: A) -> A // expected-note {{candidate expects value of type 'OtherOvl.A' at position #0}}
78-
func f1(_: B) -> B // expected-note {{candidate expects value of type 'OtherOvl.B' at position #0}}
77+
func f1(_: A) -> A // expected-note {{candidate expects value of type 'OtherOvl.A' for parameter #1}}
78+
func f1(_: B) -> B // expected-note {{candidate expects value of type 'OtherOvl.B' for parameter #1}}
7979
func f2(_: Int) -> A // expected-note{{found this candidate}}
8080
func f2(_: Int) -> B // expected-note{{found this candidate}}
8181
func f3(_: Int) -> Int // expected-note {{found this candidate}}

trunk/test/decl/subscript/subscripting.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,9 @@ func testSubscript1(_ s1 : SubscriptTest1) {
393393
}
394394

395395
struct SubscriptTest2 {
396-
subscript(a : String, b : Int) -> Int { return 0 } // expected-note {{candidate expects value of type 'Int' at position #1}}
396+
subscript(a : String, b : Int) -> Int { return 0 } // expected-note {{candidate expects value of type 'Int' for parameter #2}}
397397
// expected-note@-1 {{declared here}}
398-
subscript(a : String, b : String) -> Int { return 0 } // expected-note {{candidate expects value of type 'String' at position #1}}
398+
subscript(a : String, b : String) -> Int { return 0 } // expected-note {{candidate expects value of type 'String' for parameter #2}}
399399
}
400400

401401
func testSubscript1(_ s2 : SubscriptTest2) {

trunk/validation-test/compiler_crashers_2_fixed/0146-rdar38309176.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
func foo(_ msg: Int) {} // expected-note {{candidate expects value of type 'Int' at position #0}}
4-
func foo(_ msg: Double) {} // expected-note {{candidate expects value of type 'Double' at position #0}}
3+
func foo(_ msg: Int) {} // expected-note {{candidate expects value of type 'Int' for parameter #1}}
4+
func foo(_ msg: Double) {} // expected-note {{candidate expects value of type 'Double' for parameter #1}}
55

66
func rdar38309176(_ errors: inout [String]) {
77
foo("error: \(errors[0])") // expected-error {{no exact matches in call to global function 'foo'}}

0 commit comments

Comments
 (0)