Skip to content

[Test] Fix test cases #34511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
5 changes: 3 additions & 2 deletions test/Misc/misc_diagnostics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ func test17875634() {
func test20770032() {
if case let 1...10 = (1, 1) { // expected-warning{{'let' pattern has no effect; sub-pattern didn't bind any variables}} {{11-15=}}
// expected-error@-1 {{expression pattern of type 'ClosedRange<Int>' cannot match values of type '(Int, Int)'}}
// expected-error@-2 {{type '(Int, Int)' cannot conform to 'Equatable'; only concrete types such as structs, enums and classes can conform to protocols}}
// expected-note@-3 {{required by operator function '~=' where 'T' = '(Int, Int)'}}
// expected-error@-2 {{type '(Int, Int)' cannot conform to 'Equatable'}}
// expected-note@-3 {{only concrete types such as structs, enums and classes can conform to protocols}}
// expected-note@-4 {{required by operator function '~=' where 'T' = '(Int, Int)'}}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-frontend %s -typecheck
// RUN: not %target-swift-frontend %s -typecheck

var d = [String:String]()
_ = "\(d.map{ [$0 : $0] })"
// expected-error@-1 {{type 'Dictionary<String, String>.Element' (aka '(key: String, value: String)') cannot conform to 'Hashable'; only concrete types such as structs, enums and classes can conform to protocols}}
// expected-note@-2 {{required by generic struct 'Dictionary' where 'Key' = 'Dictionary<String, String>.Element' (aka '(key: String, value: String)')}}