Skip to content

Commit cb36fb7

Browse files
committed
[TypeChecker] NFC: Adjust tests impacted by binding ordering change
1 parent b891a45 commit cb36fb7

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

test/Constraints/closures.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,8 @@ func g_2994(arg: Int) -> Double {
475475
C_2994<S_2994>(arg: { (r: S_2994) in f_2994(arg: g_2994(arg: r.dataOffset)) }) // expected-error {{cannot convert value of type 'Double' to expected argument type 'String'}}
476476

477477
let _ = { $0[$1] }(1, 1) // expected-error {{value of type 'Int' has no subscripts}}
478-
let _ = { $0 = ($0 = {}) } // expected-error {{assigning a variable to itself}}
478+
// FIXME: Better diagnostic here would be `assigning a variable to itself` but binding ordering change exposed a but in diagnostics
479+
let _ = { $0 = ($0 = {}) } // expected-error {{function produces expected type '()'; did you mean to call it with '()'?}}
479480
let _ = { $0 = $0 = 42 } // expected-error {{assigning a variable to itself}}
480481

481482
// https://bugs.swift.org/browse/SR-403

test/Constraints/diagnostics.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ func f7() -> (c: Int, v: A) {
100100
}
101101

102102
func f8<T:P2>(_ n: T, _ f: @escaping (T) -> T) {} // expected-note {{where 'T' = 'Int'}}
103-
// expected-note@-1 {{required by global function 'f8' where 'T' = 'Tup' (aka '(Int, Double)')}}
103+
// expected-note@-1 {{required by global function 'f8' where 'T' = '(Int, Double)'}}
104104
f8(3, f4) // expected-error {{global function 'f8' requires that 'Int' conform to 'P2'}}
105105
typealias Tup = (Int, Double)
106106
func f9(_ x: Tup) -> Tup { return x }
107-
f8((1,2.0), f9) // expected-error {{type 'Tup' (aka '(Int, Double)') cannot conform to 'P2'}} expected-note {{only concrete types such as structs, enums and classes can conform to protocols}}
107+
f8((1,2.0), f9) // expected-error {{type '(Int, Double)' cannot conform to 'P2'}} expected-note {{only concrete types such as structs, enums and classes can conform to protocols}}
108108

109109
// <rdar://problem/19658691> QoI: Incorrect diagnostic for calling nonexistent members on literals
110110
1.doesntExist(0) // expected-error {{value of type 'Int' has no member 'doesntExist'}}

test/Constraints/one_way_solve.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ func testTernaryOneWayOverload(b: Bool) {
2828
// CHECK: 0: $T2 $T3 $T4
2929

3030
// CHECK: solving component #1
31-
// CHECK: Initial bindings: $T11 := Int16, $T11 := Int8
31+
// CHECK: Initial bindings: $T11 := Int8, $T11 := Int16
3232

3333
// CHECK: solving component #1
34-
// CHECK: Initial bindings: $T11 := Int16, $T11 := Int8
34+
// CHECK: Initial bindings: $T11 := Int8, $T11 := Int16
3535

3636
// CHECK: solving component #1
3737
// CHECK: Initial bindings: $T11 := Int8, $T11 := Int16

0 commit comments

Comments
 (0)