Skip to content

Commit 168c008

Browse files
committed
[Tests] NFC: Update some of the changed/improved tests
1 parent 8c18dec commit 168c008

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

test/Constraints/diagnostics.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ func r23560128() {
647647
var a : (Int,Int)?
648648
a.0 = 42 // expected-error{{value of optional type '(Int, Int)?' must be unwrapped to refer to member '0' of wrapped base type '(Int, Int)'}}
649649
// expected-note@-1{{chain the optional }}
650+
// expected-note@-2 {{force-unwrap using '!' }}
650651
}
651652

652653
// <rdar://problem/21890157> QoI: wrong error message when accessing properties on optional structs without unwrapping
@@ -656,6 +657,7 @@ struct ExampleStruct21890157 {
656657
var example21890157: ExampleStruct21890157?
657658
example21890157.property = "confusing" // expected-error {{value of optional type 'ExampleStruct21890157?' must be unwrapped to refer to member 'property' of wrapped base type 'ExampleStruct21890157'}}
658659
// expected-note@-1{{chain the optional }}
660+
// expected-note@-2 {{force-unwrap using '!' }}
659661

660662

661663
struct UnaryOp {}

test/ImportResolution/import-resolution-overload.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ scopedFunction = 42
4646
// FIXME: Should be an error -- a type name and a function cannot overload.
4747
var _ : Int = TypeNameWins(42)
4848

49-
TypeNameWins = 42 // expected-error {{cannot assign to immutable expression of type 'Int'}}
49+
// FIXME: This should be an ambiguity where both candidates are mentioned as notes.
50+
TypeNameWins = 42 // expected-error {{cannot assign to immutable expression of type '(Int) -> Int'}}
5051
var _ : TypeNameWins // no-warning
5152

5253
// rdar://problem/21739333

validation-test/Sema/SwiftUI/rdar84580119.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extension EnvironmentValues {
1414
var myHorizontalAlignment: AlignmentID? {
1515
get { fatalError() }
1616
set { self[\.MyHorizontalAlignmentEnvironmentKey.self] = newValue }
17-
// expected-error@-1 {{generic parameter 'K' could not be inferred}}
17+
// expected-error@-1 {{subscript 'subscript(_:)' requires that 'any AlignmentID' be a class type}}
1818
// expected-error@-2 {{cannot infer key path type from context; consider explicitly specifying a root type}}
1919
}
2020
}

0 commit comments

Comments
 (0)