Skip to content

Commit e6f2427

Browse files
committed
[TypeChecker] NFC: Adjust a couple of test-case affected by closure constraint generation changes
1 parent ad52afa commit e6f2427

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

test/Constraints/closures.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func testMap() {
186186
}
187187

188188
// <rdar://problem/22414757> "UnresolvedDot" "in wrong phase" assertion from verifier
189-
[].reduce { $0 + $1 } // expected-error {{cannot invoke 'reduce' with an argument list of type '(@escaping (_, _) -> _)'}}
189+
[].reduce { $0 + $1 } // expected-error {{cannot invoke 'reduce' with an argument list of type '(_)'}}
190190

191191

192192

@@ -371,7 +371,7 @@ func someGeneric19997471<T>(_ x: T) {
371371
func rdar21078316() {
372372
var foo : [String : String]?
373373
var bar : [(String, String)]?
374-
bar = foo.map { ($0, $1) } // expected-error {{contextual closure type '([String : String]) throws -> U' expects 1 argument, but 2 were used in closure body}}
374+
bar = foo.map { ($0, $1) } // expected-error {{contextual closure type '(Dictionary<String, String>) throws -> (Dictionary<String, String>, _)' expects 1 argument, but 2 were used in closure body}}
375375
}
376376

377377

test/Constraints/diagnostics.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ struct Toe {
251251
let toenail: Nail // expected-error {{use of undeclared type 'Nail'}}
252252

253253
func clip() {
254-
// FIXME: We shouldn't report this because toenail.inspect is a hole
255-
toenail.inspect { x in // expected-error {{unable to infer closure return type; add explicit type to disambiguate}}
254+
toenail.inspect { x in
256255
toenail.inspect { y in }
257256
}
258257
}
@@ -290,7 +289,6 @@ func r18800223(_ i : Int) {
290289

291290
var buttonTextColor: String?
292291
_ = (buttonTextColor != nil) ? 42 : {$0}; // expected-error {{result values in '? :' expression have mismatching types 'Int' and '(_) -> _'}}
293-
// expected-error@-1 {{unable to infer closure return type; add explicit type to disambiguate}}
294292
}
295293

296294
// <rdar://problem/21883806> Bogus "'_' can only appear in a pattern or on the left side of an assignment" is back

0 commit comments

Comments
 (0)