Skip to content

Commit 63b98d5

Browse files
authored
Merge pull request swiftlang#41184 from slavapestov/fix-typo
Change spelling of "ParametrizedProtocolType" to "ParameterizedProtocolType"
2 parents 983cf2c + 0177f75 commit 63b98d5

37 files changed

+127
-129
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,8 +2780,8 @@ ERROR(inheritance_from_non_protocol_or_class,none,
27802780
"inheritance from non-protocol, non-class type %0", (Type))
27812781
ERROR(inheritance_from_non_protocol,none,
27822782
"inheritance from non-protocol type %0", (Type))
2783-
ERROR(inheritance_from_parametrized_protocol,none,
2784-
"cannot inherit from parametrized protocol type %0", (Type))
2783+
ERROR(inheritance_from_parameterized_protocol,none,
2784+
"cannot inherit from protocol type with generic argument %0", (Type))
27852785
ERROR(superclass_not_first,none,
27862786
"superclass %0 must appear first in the inheritance clause", (Type))
27872787
ERROR(superclass_not_open,none,
@@ -3723,7 +3723,7 @@ ERROR(not_a_generic_definition,none,
37233723
"cannot specialize a non-generic definition", ())
37243724
ERROR(not_a_generic_type,none,
37253725
"cannot specialize non-generic type %0", (Type))
3726-
ERROR(parametrized_protocol_not_supported,none,
3726+
ERROR(parameterized_protocol_not_supported,none,
37273727
"protocol type with generic argument can only be used as a generic constraint", ())
37283728
ERROR(protocol_does_not_have_primary_assoc_type,none,
37293729
"cannot specialize protocol type %0", (Type))

include/swift/AST/ExistentialLayout.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct ExistentialLayout {
4242

4343
ExistentialLayout(ProtocolType *type);
4444
ExistentialLayout(ProtocolCompositionType *type);
45-
ExistentialLayout(ParametrizedProtocolType *type);
45+
ExistentialLayout(ParameterizedProtocolType *type);
4646

4747
/// The explicit superclass constraint, if any.
4848
Type explicitSuperclass;
@@ -116,7 +116,7 @@ struct ExistentialLayout {
116116
ArrayRef<Type> protocols;
117117

118118
/// Zero or more primary associated type requirements from a
119-
/// ParametrizedProtocolType
119+
/// ParameterizedProtocolType
120120
ArrayRef<PrimaryAssociatedTypeRequirement> sameTypeRequirements;
121121
};
122122

include/swift/AST/TypeDifferenceVisitor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ class CanTypeDifferenceVisitor : public CanTypePairVisitor<Impl, bool> {
339339
type1->getMembers(), type2->getMembers());
340340
}
341341

342-
bool visitParametrizedProtocolType(CanParametrizedProtocolType type1,
343-
CanParametrizedProtocolType type2) {
342+
bool visitParameterizedProtocolType(CanParameterizedProtocolType type1,
343+
CanParameterizedProtocolType type2) {
344344
if (asImpl().visit(type1.getBaseType(), type2.getBaseType()))
345345
return true;
346346

include/swift/AST/TypeMatcher.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,20 +305,20 @@ class TypeMatcher {
305305
TRIVIAL_CASE(SILBoxType)
306306
TRIVIAL_CASE(ProtocolCompositionType)
307307

308-
bool visitParametrizedProtocolType(CanParametrizedProtocolType firstParametrizedProto,
309-
Type secondType,
310-
Type sugaredFirstType) {
311-
if (auto secondParametrizedProto = secondType->getAs<ParametrizedProtocolType>()) {
308+
bool visitParameterizedProtocolType(CanParameterizedProtocolType firstParametrizedProto,
309+
Type secondType,
310+
Type sugaredFirstType) {
311+
if (auto secondParametrizedProto = secondType->getAs<ParameterizedProtocolType>()) {
312312
if (!this->visit(firstParametrizedProto.getBaseType(),
313313
secondParametrizedProto->getBaseType(),
314-
sugaredFirstType->castTo<ParametrizedProtocolType>()
314+
sugaredFirstType->castTo<ParameterizedProtocolType>()
315315
->getBaseType())) {
316316
return false;
317317
}
318318

319319
return this->visit(firstParametrizedProto.getArgumentType(),
320320
secondParametrizedProto->getArgumentType(),
321-
sugaredFirstType->castTo<ParametrizedProtocolType>()
321+
sugaredFirstType->castTo<ParameterizedProtocolType>()
322322
->getArgumentType());
323323
}
324324

include/swift/AST/TypeNodes.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ ARTIFICIAL_TYPE(SILBlockStorage, Type)
161161
ARTIFICIAL_TYPE(SILBox, Type)
162162
ARTIFICIAL_TYPE(SILToken, Type)
163163
TYPE(ProtocolComposition, Type)
164-
TYPE(ParametrizedProtocol, Type)
164+
TYPE(ParameterizedProtocol, Type)
165165
TYPE(Existential, Type)
166166
TYPE(LValue, Type)
167167
TYPE(InOut, Type)

include/swift/AST/Types.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5243,7 +5243,7 @@ class ProtocolCompositionType final : public TypeBase,
52435243
BEGIN_CAN_TYPE_WRAPPER(ProtocolCompositionType, Type)
52445244
END_CAN_TYPE_WRAPPER(ProtocolCompositionType, Type)
52455245

5246-
/// ParametrizedProtocolType - A type that constrains the primary associated
5246+
/// ParameterizedProtocolType - A type that constrains the primary associated
52475247
/// type of a protocol to an argument type.
52485248
///
52495249
/// Written like a bound generic type, eg Sequence<Int>.
@@ -5259,7 +5259,7 @@ END_CAN_TYPE_WRAPPER(ProtocolCompositionType, Type)
52595259
/// \code
52605260
/// T : Sequence where T.Element == Int.
52615261
/// \endcode
5262-
class ParametrizedProtocolType final : public TypeBase,
5262+
class ParameterizedProtocolType final : public TypeBase,
52635263
public llvm::FoldingSetNode {
52645264
friend struct ExistentialLayout;
52655265

@@ -5294,18 +5294,18 @@ class ParametrizedProtocolType final : public TypeBase,
52945294

52955295
// Implement isa/cast/dyncast/etc.
52965296
static bool classof(const TypeBase *T) {
5297-
return T->getKind() == TypeKind::ParametrizedProtocol;
5297+
return T->getKind() == TypeKind::ParameterizedProtocol;
52985298
}
52995299

53005300
private:
5301-
ParametrizedProtocolType(const ASTContext *ctx,
5302-
ProtocolType *base, Type arg,
5303-
RecursiveTypeProperties properties);
5301+
ParameterizedProtocolType(const ASTContext *ctx,
5302+
ProtocolType *base, Type arg,
5303+
RecursiveTypeProperties properties);
53045304
};
5305-
BEGIN_CAN_TYPE_WRAPPER(ParametrizedProtocolType, Type)
5305+
BEGIN_CAN_TYPE_WRAPPER(ParameterizedProtocolType, Type)
53065306
PROXY_CAN_TYPE_SIMPLE_GETTER(getBaseType)
53075307
PROXY_CAN_TYPE_SIMPLE_GETTER(getArgumentType)
5308-
END_CAN_TYPE_WRAPPER(ParametrizedProtocolType, Type)
5308+
END_CAN_TYPE_WRAPPER(ParameterizedProtocolType, Type)
53095309

53105310
/// An existential type, spelled with \c any .
53115311
///
@@ -6365,7 +6365,8 @@ inline bool TypeBase::isConstraintType() const {
63656365

63666366
inline bool CanType::isConstraintTypeImpl(CanType type) {
63676367
return (isa<ProtocolType>(type) ||
6368-
isa<ProtocolCompositionType>(type));
6368+
isa<ProtocolCompositionType>(type) ||
6369+
isa<ParameterizedProtocolType>(type));
63696370
}
63706371

63716372
inline bool TypeBase::isExistentialType() {

include/swift/Basic/LangOptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,9 @@ namespace swift {
321321
/// keyword.
322322
bool EnableExplicitExistentialTypes = true;
323323

324-
/// Enable support for protocol types parametrized by primary
324+
/// Enable support for protocol types parameterized by primary
325325
/// associated type.
326-
bool EnableParametrizedProtocolTypes = false;
326+
bool EnableParameterizedProtocolTypes = false;
327327

328328
/// Enable experimental flow-sensitive concurrent captures.
329329
bool EnableExperimentalFlowSensitiveConcurrentCaptures = false;

include/swift/Option/FrontendOptions.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,9 @@ def enable_explicit_existential_types :
517517
Flag<["-"], "enable-explicit-existential-types">,
518518
HelpText<"Enable experimental support for explicit existential types">;
519519

520-
def enable_parametrized_protocol_types :
521-
Flag<["-"], "enable-parametrized-protocol-types">,
522-
HelpText<"Enable experimental support for primary associated types and parametrized protocols">;
520+
def enable_parameterized_protocol_types :
521+
Flag<["-"], "enable-parameterized-protocol-types">,
522+
HelpText<"Enable experimental support for primary associated types and parameterized protocols">;
523523

524524
def enable_deserialization_recovery :
525525
Flag<["-"], "enable-deserialization-recovery">,

lib/AST/ASTContext.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ struct ASTContext::Implementation {
405405
llvm::FoldingSet<UnboundGenericType> UnboundGenericTypes;
406406
llvm::FoldingSet<BoundGenericType> BoundGenericTypes;
407407
llvm::FoldingSet<ProtocolCompositionType> ProtocolCompositionTypes;
408-
llvm::FoldingSet<ParametrizedProtocolType> ParametrizedProtocolTypes;
408+
llvm::FoldingSet<ParameterizedProtocolType> ParameterizedProtocolTypes;
409409
llvm::FoldingSet<LayoutConstraintInfo> LayoutConstraints;
410410
llvm::DenseMap<std::pair<OpaqueTypeDecl *, SubstitutionMap>,
411411
GenericEnvironment *> OpaqueArchetypeEnvironments;
@@ -3404,9 +3404,9 @@ ProtocolCompositionType::build(const ASTContext &C, ArrayRef<Type> Members,
34043404
return compTy;
34053405
}
34063406

3407-
Type ParametrizedProtocolType::get(const ASTContext &C,
3408-
ProtocolType *baseTy,
3409-
Type argTy) {
3407+
Type ParameterizedProtocolType::get(const ASTContext &C,
3408+
ProtocolType *baseTy,
3409+
Type argTy) {
34103410
bool isCanonical = baseTy->isCanonical();
34113411
RecursiveTypeProperties properties = baseTy->getRecursiveProperties();
34123412
properties |= argTy->getRecursiveProperties();
@@ -3416,16 +3416,16 @@ Type ParametrizedProtocolType::get(const ASTContext &C,
34163416

34173417
void *InsertPos = nullptr;
34183418
llvm::FoldingSetNodeID ID;
3419-
ParametrizedProtocolType::Profile(ID, baseTy, argTy);
3419+
ParameterizedProtocolType::Profile(ID, baseTy, argTy);
34203420

34213421
if (auto paramTy
3422-
= C.getImpl().getArena(arena).ParametrizedProtocolTypes
3422+
= C.getImpl().getArena(arena).ParameterizedProtocolTypes
34233423
.FindNodeOrInsertPos(ID, InsertPos))
34243424
return paramTy;
34253425

3426-
auto paramTy = new (C, arena) ParametrizedProtocolType(
3426+
auto paramTy = new (C, arena) ParameterizedProtocolType(
34273427
isCanonical ? &C : nullptr, baseTy, argTy, properties);
3428-
C.getImpl().getArena(arena).ParametrizedProtocolTypes.InsertNode(
3428+
C.getImpl().getArena(arena).ParameterizedProtocolTypes.InsertNode(
34293429
paramTy, InsertPos);
34303430
return paramTy;
34313431
}

lib/AST/ASTDumper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3942,9 +3942,9 @@ namespace {
39423942
PrintWithColorRAII(OS, ParenthesisColor) << ')';
39433943
}
39443944

3945-
void visitParametrizedProtocolType(ParametrizedProtocolType *T,
3946-
StringRef label) {
3947-
printCommon(label, "parametrized_protocol_type");
3945+
void visitParameterizedProtocolType(ParameterizedProtocolType *T,
3946+
StringRef label) {
3947+
printCommon(label, "parameterized_protocol_type");
39483948
printRec("base", T->getBaseType());
39493949
printRec("arg", T->getArgumentType());
39503950
PrintWithColorRAII(OS, ParenthesisColor) << ')';

0 commit comments

Comments
 (0)