Skip to content

Commit 0944d46

Browse files
committed
[nfc] fix spelling; invertable -> invertible
1 parent 54643c1 commit 0944d46

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,8 +2347,8 @@ ERROR(inferred_opaque_type,none,
23472347
"return type of another declaration", (Type))
23482348

23492349
// Inverse Constraints
2350-
ERROR(inverse_type_not_invertable,none,
2351-
"type %0 is not invertable", (Type))
2350+
ERROR(inverse_type_not_invertible,none,
2351+
"type %0 is not invertible", (Type))
23522352

23532353
// Extensions
23542354
ERROR(non_nominal_extension,none,

include/swift/AST/KnownProtocols.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ using KnownProtocolSet = FixedBitSet<NumKnownProtocols, KnownProtocolKind>;
4646

4747
/// Produces a set of all protocols that have an inverse, i.e., for every
4848
/// known protocol KP in the set, ~KP exists.
49-
KnownProtocolSet getInvertableProtocols();
49+
KnownProtocolSet getInvertibleProtocols();
5050

5151
/// Retrieve the name of the given known protocol.
5252
llvm::StringRef getProtocolName(KnownProtocolKind kind);

lib/AST/ASTContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ llvm::StringRef swift::getProtocolName(KnownProtocolKind kind) {
102102
llvm_unreachable("bad KnownProtocolKind");
103103
}
104104

105-
KnownProtocolSet swift::getInvertableProtocols() {
105+
KnownProtocolSet swift::getInvertibleProtocols() {
106106
return { KnownProtocolKind::Copyable };
107107
}
108108

lib/AST/RequirementMachine/RequirementLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ void swift::rewriting::realizeInheritedRequirements(
732732
auto inheritedTypes = decl->getInherited();
733733
auto *dc = decl->getInnermostDeclContext();
734734
auto *moduleForInference = dc->getParentModule();
735-
auto defaults = getInvertableProtocols();
735+
auto defaults = getInvertibleProtocols();
736736

737737
for (auto index : inheritedTypes.getIndices()) {
738738
Type inheritedType =

lib/Sema/TypeCheckType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5057,10 +5057,10 @@ NeverNullType TypeResolver::resolveInverseType(InverseTypeRepr *repr,
50575057
if (auto protoTy = ty->getAs<ProtocolType>())
50585058
if (auto protoDecl = protoTy->getDecl())
50595059
if (auto kp = protoDecl->getKnownProtocolKind())
5060-
if (getInvertableProtocols().contains(*kp))
5060+
if (getInvertibleProtocols().contains(*kp))
50615061
return ty;
50625062

5063-
diagnoseInvalid(repr, repr->getLoc(), diag::inverse_type_not_invertable, ty);
5063+
diagnoseInvalid(repr, repr->getLoc(), diag::inverse_type_not_invertible, ty);
50645064
return ErrorType::get(getASTContext());
50655065
}
50665066

test/Interop/Cxx/class/protocol-conformance-typechecker.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ protocol HasReturnNonNull {
2828
extension ReturnsNonNullValue: HasReturnNonNull {}
2929

3030

31-
protocol Invertable {
31+
protocol Invertible {
3232
static prefix func !(obj: Self) -> Self
3333
}
3434

35-
extension HasOperatorExclaim: Invertable {}
35+
extension HasOperatorExclaim: Invertible {}
3636

3737
extension HasOperatorEqualEqual: Equatable {}
3838

test/Parse/inverses.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@ enum Maybe<Thing: ~Copyable> : ~Copyable {}
99
func more() {
1010
let _: any ~Copyable = 19
1111

12-
let _: any ~Equatable = 19 // expected-error@:14 {{type 'Equatable' is not invertable}}
12+
let _: any ~Equatable = 19 // expected-error@:14 {{type 'Equatable' is not invertible}}
1313

14-
let _: any (~Copyable & ~Equatable) // expected-error{{type 'Equatable' is not invertable}}
14+
let _: any (~Copyable & ~Equatable) // expected-error{{type 'Equatable' is not invertible}}
1515

16-
let _: ~Any // expected-error {{type 'Any' is not invertable}}
17-
let _: ~AnyObject // expected-error {{type 'AnyObject' is not invertable}}
16+
let _: ~Any // expected-error {{type 'Any' is not invertible}}
17+
let _: ~AnyObject // expected-error {{type 'AnyObject' is not invertible}}
1818
}
1919

20-
struct S4: ~(Copyable & Equatable) {} // expected-error {{type 'Copyable & Equatable' is not invertable}}
20+
struct S4: ~(Copyable & Equatable) {} // expected-error {{type 'Copyable & Equatable' is not invertible}}
2121

2222
func blah<T>(_ t: T) where T: ~Copyable,
23-
T: ~Hashable {} // expected-error@:31 {{type 'Hashable' is not invertable}}
23+
T: ~Hashable {} // expected-error@:31 {{type 'Hashable' is not invertible}}
2424

2525
func foo<T: ~Copyable>(x: T) {}
2626

2727
struct Buurap<T: ~Copyable> {}
2828

2929
protocol Foo where Self: ~Copyable {
30-
func test<T>(_ t: T) where T: ~Self // expected-error {{type 'Self' is not invertable}}
30+
func test<T>(_ t: T) where T: ~Self // expected-error {{type 'Self' is not invertible}}
3131
}
3232

3333
protocol Sando { func make() }
3434

3535
class C: ~Copyable,
36-
~Sando // expected-error {{type 'Sando' is not invertable}}
36+
~Sando // expected-error {{type 'Sando' is not invertible}}
3737
{}
3838

3939
public struct MoveOnlyS1<T> : ~Copyable { /*deinit {}*/ }
@@ -47,7 +47,7 @@ protocol Rope<Element>: Hashable, ~ Copyable {
4747

4848
extension S: ~Copyable {}
4949

50-
struct S: ~U, // expected-error {{type 'U' is not invertable}}
50+
struct S: ~U, // expected-error {{type 'U' is not invertible}}
5151
~Copyable {}
5252

5353
func greenBay<each T: ~Copyable>(_ r: repeat each T) {}
@@ -73,12 +73,12 @@ func what(one: ~Copyable..., // expected-error {{type 'any Copyable' is not inve
7373
struct A { struct B { struct C {} } }
7474

7575
typealias Z1 = (~Copyable).Type // FIXME: should be an error
76-
typealias Z1 = ~Copyable.Type // expected-error {{type 'any Copyable.Type' is not invertable}}
77-
typealias Z2 = ~A.B.C // expected-error {{type 'A.B.C' is not invertable}}
78-
typealias Z3 = ~A? // expected-error {{type 'A?' is not invertable}}
79-
typealias Z4 = ~Rope<Int> // expected-error {{type 'Rope<Int>' is not invertable}}
80-
typealias Z5 = (~Int) -> Void // expected-error {{type 'Int' is not invertable}}
76+
typealias Z1 = ~Copyable.Type // expected-error {{type 'any Copyable.Type' is not invertible}}
77+
typealias Z2 = ~A.B.C // expected-error {{type 'A.B.C' is not invertible}}
78+
typealias Z3 = ~A? // expected-error {{type 'A?' is not invertible}}
79+
typealias Z4 = ~Rope<Int> // expected-error {{type 'Rope<Int>' is not invertible}}
80+
typealias Z5 = (~Int) -> Void // expected-error {{type 'Int' is not invertible}}
8181
typealias Z6 = ~() -> () // expected-error {{single argument function types require parentheses}}
82-
// expected-error@-1 {{type '()' is not invertable}}
83-
typealias Z7 = ~(Copyable & Hashable) // expected-error {{type 'Copyable & Hashable' is not invertable}}
82+
// expected-error@-1 {{type '()' is not invertible}}
83+
typealias Z7 = ~(Copyable & Hashable) // expected-error {{type 'Copyable & Hashable' is not invertible}}
8484
typealias Z8 = ~Copyable & Hashable

0 commit comments

Comments
 (0)