Skip to content

Commit 8b89b4c

Browse files
authored
Spelling constraints (#42548)
* spelling: availability Signed-off-by: Josh Soref <[email protected]> * spelling: conditional Signed-off-by: Josh Soref <[email protected]> * spelling: deferred Signed-off-by: Josh Soref <[email protected]> * spelling: disambiguate Signed-off-by: Josh Soref <[email protected]> * spelling: failed Signed-off-by: Josh Soref <[email protected]> * spelling: interferes Signed-off-by: Josh Soref <[email protected]> * spelling: magnify Signed-off-by: Josh Soref <[email protected]> * spelling: occurrences Signed-off-by: Josh Soref <[email protected]> * spelling: overload Signed-off-by: Josh Soref <[email protected]> * spelling: redeclarations Signed-off-by: Josh Soref <[email protected]> * spelling: simplification Signed-off-by: Josh Soref <[email protected]> * spelling: string Signed-off-by: Josh Soref <[email protected]> * spelling: the Signed-off-by: Josh Soref <[email protected]> Co-authored-by: Josh Soref <[email protected]>
1 parent b07f059 commit 8b89b4c

12 files changed

+16
-16
lines changed

test/Constraints/array_literal_local_array.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
// SR-9611: Array type locally interfers with array literals.
3+
// SR-9611: Array type locally interferes with array literals.
44
struct Array { }
55

66
func foo() {

test/Constraints/availability.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func f(c: C) {
1616
let _: C? = C(c)
1717
}
1818

19-
// rdar://problem/60047439 - unable to disambiguite expression based on availablity
19+
// rdar://problem/60047439 - unable to disambiguate expression based on availability
2020
func test_contextual_member_with_availability() {
2121
struct A {
2222
static var foo: A = A()

test/Constraints/closures.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,11 +1071,11 @@ func rdar_74435602(error: Error?) {
10711071
// SR-14280
10721072
let _: (@convention(block) () -> Void)? = Bool.random() ? nil : {} // OK
10731073
let _: (@convention(thin) () -> Void)? = Bool.random() ? nil : {} // OK
1074-
let _: (@convention(c) () -> Void)? = Bool.random() ? nil : {} // OK on type checking, diagnostics are deffered to SIL
1074+
let _: (@convention(c) () -> Void)? = Bool.random() ? nil : {} // OK on type checking, diagnostics are deferred to SIL
10751075

10761076
let _: (@convention(block) () -> Void)? = Bool.random() ? {} : {} // OK
10771077
let _: (@convention(thin) () -> Void)? = Bool.random() ? {} : {} // OK
1078-
let _: (@convention(c) () -> Void)? = Bool.random() ? {} : {} // OK on type checking, diagnostics are deffered to SIL
1078+
let _: (@convention(c) () -> Void)? = Bool.random() ? {} : {} // OK on type checking, diagnostics are deferred to SIL
10791079

10801080
// Make sure that diagnostic is attached to the closure even when body is empty (implicitly returns `Void`)
10811081
var emptyBodyMismatch: () -> Int {

test/Constraints/generics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ func rdar78781552() {
906906
}
907907
}
908908

909-
// rdar://79757320 - failured to produce a diagnostic when unresolved dependent member is used in function result position
909+
// rdar://79757320 - failed to produce a diagnostic when unresolved dependent member is used in function result position
910910

911911
protocol R_79757320 {
912912
associatedtype In

test/Constraints/implicit_double_cgfloat_conversion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func test_narrowing_is_delayed(x: Double, y: CGFloat) {
149149
// CHECK: function_ref @$s34implicit_double_cgfloat_conversion25test_narrowing_is_delayed1x1yySd_12CoreGraphics7CGFloatVtF10overloadedL_yS2d_SdtF
150150
// CHECK: @$s34implicit_double_cgfloat_conversion25test_narrowing_is_delayed1x1yySd_12CoreGraphics7CGFloatVtF10overloadedL_yS2d_SdtF
151151
// CHECK: function_ref @$s12CoreGraphics7CGFloatVyACSdcf
152-
let _: CGFloat = overloaded(x, overloaded(x, y)) // Prefers `overloaded(Double, Double) -> Double` in both occurances.
152+
let _: CGFloat = overloaded(x, overloaded(x, y)) // Prefers `overloaded(Double, Double) -> Double` in both occurrences.
153153

154154
// Calls should behave exactly the same as contextual conversions.
155155

test/Constraints/keypath_dynamic_member_lookup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func prefer_readonly_keypath_over_reference_writable() {
287287
}
288288

289289

290-
// rdar://problem/52779809 - condiitional conformance shadows names of members reachable through dynamic lookup
290+
// rdar://problem/52779809 - conditional conformance shadows names of members reachable through dynamic lookup
291291

292292
protocol P {
293293
var foo: Int { get }

test/Constraints/members.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ func testSR13359(_ pair: (Int, Int), _ alias: Pair, _ void: Void, labeled: (a: I
688688
_ = pair[1] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; did you mean to use '.1'?}} {{11-14=.1}}
689689
_ = pair[2] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}}
690690
_ = pair[100] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}}
691-
_ = pair["strting"] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}}
691+
_ = pair["string"] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}}
692692
_ = pair[-1] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}}
693693
_ = pair[1, 1] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}}
694694
_ = void[0] // expected-error {{value of type 'Void' has no subscripts}}
@@ -700,7 +700,7 @@ func testSR13359(_ pair: (Int, Int), _ alias: Pair, _ void: Void, labeled: (a: I
700700
_ = alias[1] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); did you mean to use '.1'?}} {{12-15=.1}}
701701
_ = alias[2] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}}
702702
_ = alias[100] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}}
703-
_ = alias["strting"] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}}
703+
_ = alias["string"] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}}
704704
_ = alias[-1] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}}
705705
_ = alias[1, 1] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}}
706706
_ = alias[0x00] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}}
@@ -711,7 +711,7 @@ func testSR13359(_ pair: (Int, Int), _ alias: Pair, _ void: Void, labeled: (a: I
711711
_ = labeled[1] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; did you mean to use '.1'?}} {{14-17=.1}}
712712
_ = labeled[2] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}}
713713
_ = labeled[100] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}}
714-
_ = labeled["strting"] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}}
714+
_ = labeled["string"] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}}
715715
_ = labeled[-1] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}}
716716
_ = labeled[1, 1] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}}
717717
_ = labeled[0x00] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}}

test/Constraints/opened_existentials.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func testTakeValueAndClosure(p: any P) {
202202
takeValueAndClosure(p, body: overloadedGenericFunctionTakingP)
203203
takeValueAndClosure(p, body: genericFunctionTakingPQ) // expected-error{{global function 'genericFunctionTakingPQ' requires that 'T' conform to 'Q'}}
204204

205-
// Do not allow opening if there are any uses of the the type parameter before
205+
// Do not allow opening if there are any uses of the type parameter before
206206
// the opened parameter. This maintains left-to-right evaluation order.
207207
takeValueAndClosureBackwards( // expected-error{{type 'any P' cannot conform to 'P'}}
208208
// expected-note@-1{{only concrete types such as structs, enums and classes can conform to protocols}}

test/Constraints/overload_filtering.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func testUnresolvedMember(i: Int) -> X {
4242
func test_member_filtering() {
4343
struct S {
4444
// Result types here are different intentionally,
45-
// if there were the same simplication logic would
45+
// if there were the same simplification logic would
4646
// trigger and disable overloads during constraint
4747
// generation.
4848
func foo(_: Int) -> S { S() }

test/Constraints/result_builder_diags.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ func test_missing_member_in_optional_context() {
801801
}
802802
}
803803

804-
func test_redeclations() {
804+
func test_redeclarations() {
805805
tuplify(true) { c in
806806
let foo = 0 // expected-note {{'foo' previously declared here}}
807807
let foo = foo // expected-error {{invalid redeclaration of 'foo'}}

test/Constraints/tuple.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ struct Victory<General> {
195195
struct MagicKingdom<K> : Kingdom {
196196
typealias King = K
197197
}
198-
func magify<T>(_ t: T) -> MagicKingdom<T> { return MagicKingdom() }
198+
func magnify<T>(_ t: T) -> MagicKingdom<T> { return MagicKingdom() }
199199
func foo(_ pair: (Int, Int)) -> Victory<(x: Int, y: Int)> {
200-
return Victory(magify(pair)) // expected-error {{initializer 'init(_:)' requires the types '(x: Int, y: Int)' and 'MagicKingdom<(Int, Int)>.King' (aka '(Int, Int)') be equivalent}}
200+
return Victory(magnify(pair)) // expected-error {{initializer 'init(_:)' requires the types '(x: Int, y: Int)' and 'MagicKingdom<(Int, Int)>.King' (aka '(Int, Int)') be equivalent}}
201201
}
202202

203203

test/Constraints/tuple_arguments.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,7 @@ public extension Optional {
16731673

16741674
// https://bugs.swift.org/browse/SR-6837
16751675

1676-
// FIXME: Can't overlaod local functions so these must be top-level
1676+
// FIXME: Can't overload local functions so these must be top-level
16771677
func takePairOverload(_ pair: (Int, Int?)) {}
16781678
func takePairOverload(_: () -> ()) {}
16791679

0 commit comments

Comments
 (0)