Skip to content

Commit ce2fe02

Browse files
committed
[TypeChecker] NFC: Adjust tests improved by including unviable candidates into overload set
1 parent fd377dc commit ce2fe02

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/Constraints/members.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,19 +359,19 @@ extension Sequence {
359359
}
360360

361361
class C_25341015 {
362-
static func baz(_ x: Int, _ y: Int) {} // expected-note {{'baz' declared here}}
362+
static func baz(_ x: Int, _ y: Int) {}
363363
func baz() {}
364364
func qux() {
365-
baz(1, 2) // expected-error {{use of 'baz' refers to instance method 'baz()' rather than static method 'baz' in class 'C_25341015'}} expected-note {{use 'C_25341015.' to reference the static method}}
365+
baz(1, 2) // expected-error {{static member 'baz' cannot be used on instance of type 'C_25341015'}} {{5-5=C_25341015.}}
366366
}
367367
}
368368

369369
struct S_25341015 {
370-
static func foo(_ x: Int, y: Int) {} // expected-note {{'foo(_:y:)' declared here}}
370+
static func foo(_ x: Int, y: Int) {}
371371

372372
func foo(z: Int) {}
373373
func bar() {
374-
foo(1, y: 2) // expected-error {{use of 'foo' refers to instance method 'foo(z:)' rather than static method 'foo(_:y:)' in struct 'S_25341015'}} expected-note {{use 'S_25341015.' to reference the static method}}
374+
foo(1, y: 2) // expected-error {{static member 'foo' cannot be used on instance of type 'S_25341015'}} {{5-5=S_25341015.}}
375375
}
376376
}
377377

test/TypeCoercion/overload_member.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func test_static_method_value_coerce(_ a: A) {
6969
func test_mixed_overload(_ a: A, x: X, y: Y) {
7070
var x1 = a.mixed(x: x)
7171
x1 = x
72-
var y1 = a.mixed(y: y) // expected-error{{incorrect argument label in call (have 'y:', expected 'x:')}}
72+
var y1 = a.mixed(y: y) // expected-error {{static member 'mixed' cannot be used on instance of type 'A'}} {{12-12=A.}}
7373

7474
A.mixed(x) // expected-error{{missing argument label 'y:' in call}}
7575
var x2 = A.mixed(a)(x: x)
@@ -89,7 +89,7 @@ func test_mixed_overload_coerce(_ a: A, x: inout X, y: Y, z: Z) {
8989
func test_mixed_method_value_coerce(_ a: A) {
9090
var _ : (X) -> X = a.mixed
9191
var _ : (Y) -> Y = A.mixed
92-
var _ : (Y) -> Y = a.mixed; // expected-error{{cannot convert value of type '(X) -> X' to specified type '(Y) -> Y'}}
92+
var _ : (Y) -> Y = a.mixed; // expected-error {{static member 'mixed' cannot be used on instance of type 'A'}} {{22-22=A.}}
9393
var _ : (A) -> (X) -> X = A.mixed
9494
}
9595

@@ -130,8 +130,8 @@ extension A {
130130

131131
func test_mixed_method_value_coerce() {
132132
var _ : (X) -> X = mixed
133-
var _ : (Y) -> Y = mixed; // expected-error{{cannot convert value of type '(X) -> X' to specified type '(Y) -> Y'}}
134-
var _ : (Y) -> Y = mixed; // expected-error{{cannot convert value of type '(X) -> X' to specified type '(Y) -> Y'}}
133+
var _ : (Y) -> Y = mixed; // expected-error {{static member 'mixed' cannot be used on instance of type 'A'}} {{24-24=A.}}
134+
var _ : (Y) -> Y = mixed; // expected-error {{static member 'mixed' cannot be used on instance of type 'A'}} {{24-24=A.}}
135135
var _ : (A) -> (X) -> X = A.mixed
136136
}
137137

0 commit comments

Comments
 (0)