Skip to content

Commit cfcca5a

Browse files
committed
Update tests for master -> 5.1 cherry-pick
1 parent 2e8658e commit cfcca5a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/Constraints/generics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ let arr = [BottleLayout]()
646646
let layout = BottleLayout(count:1)
647647
let ix = arr.firstIndex(of:layout) // expected-error {{argument type 'BottleLayout' does not conform to expected type 'Equatable'}}
648648

649-
let _: () -> UInt8 = { .init("a" as Unicode.Scalar) } // expected-error {{missing argument label 'ascii:' in call}}
649+
let _: () -> UInt8 = { .init("a" as Unicode.Scalar) } // expected-error {{initializer 'init(_:)' requires that 'Unicode.Scalar' conform to 'BinaryInteger'}}
650650

651651
// https://bugs.swift.org/browse/SR-9068
652652
func compare<C: Collection, Key: Hashable, Value: Equatable>(c: C)

test/Constraints/patterns.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ switch staticMembers {
291291
case .init(0): break
292292
case .init(_): break // expected-error{{'_' can only appear in a pattern}}
293293
case .init(let x): break // expected-error{{cannot appear in an expression}}
294-
case .init(opt: 0): break // expected-error{{pattern cannot match values of type 'StaticMembers'}}
294+
case .init(opt: 0): break // expected-error{{value of optional type 'StaticMembers?' must be unwrapped to a value of type 'StaticMembers'}}
295+
// expected-note@-1{{coalesce using '??' to provide a default when the optional value contains 'nil'}}
296+
// expected-note@-2{{force-unwrap using '!' to abort execution if the optional value contains 'nil'}}
295297

296298
case .prop: break
297299
// TODO: repeated error message

0 commit comments

Comments
 (0)