Skip to content

Commit 4c77c59

Browse files
authored
Spelling sema (#42474)
* spelling: accessibility Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: accessories Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: adjustments Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: all Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: ambiguous Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: arguments Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: assignment Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: associated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: assumes Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: auxiliary Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: availability Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: available Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: belongs Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: checking Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: clazz Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: compatibility Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: completely Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: completion Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: complicated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: conformance Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: constrained Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: constraint Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: contextual Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: conversion Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: convertible Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: couldn't Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: declaration Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: defaultable Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: dependent Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: depending Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: describe Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: diagnostic Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: diagnostics Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: existential Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: expects Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: explicit Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: explicitly Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: expression Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: first Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: font Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: forward Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: generation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: generic Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: given Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: global Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: guarantee Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: happened Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: hierarchy Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: identical Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: immediately Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: implicit Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: indicates Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: inferred Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initialization Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initialize Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initializer Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: integrity Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: interpolation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: introducing Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: involved Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: just Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: like Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: likewise Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: mismatch Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: missing Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: more Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: necessarily Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: noescape Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: nonetheless Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: occurrences Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: operators Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: optional Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: otherwise Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: outside Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: overload Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: overridden Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: override Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: parameter Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: parameters Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: penalize Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: platforms Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: precedence Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: preemptively Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: preliminary Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: preserve Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: propagate Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: propagated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: qualifier Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: question Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: really Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: received Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: references Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: replaceable Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: replacement Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: representable Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: representative Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: requirement Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: requires Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: resolved Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: retrieve Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: rewriting Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: satisfied Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: semantics Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: signature Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: similar Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: simplest Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: simplification Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: solver Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: struct Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: structurally Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: success Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: sure Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: symmetric Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: syntactically Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: target Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: that Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: the Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: themselves Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: these Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: this Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: transform Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: transparent Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: tread Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: truncation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: type Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unconstructable Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: universally Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unknown Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unwrapped Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: versioned Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: visible Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: where Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
1 parent 1c426a3 commit 4c77c59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+248
-248
lines changed

include/swift/AST/DiagnosticsSema.def

+3-3
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ NOTE(unwrap_with_guard,none,
11601160
ERROR(optional_base_not_unwrapped,none,
11611161
"value of optional type %0 must be unwrapped to refer to member %1 of "
11621162
"wrapped base type %2", (Type, DeclNameRef, Type))
1163-
ERROR(invalid_optional_infered_keypath_root, none,
1163+
ERROR(invalid_optional_inferred_keypath_root, none,
11641164
"key path root inferred as optional type %0 must be unwrapped to refer to member %1 "
11651165
"of unwrapped type %2", (Type, DeclNameRef, Type))
11661166
NOTE(optional_base_chain,none,
@@ -4028,7 +4028,7 @@ ERROR(passing_noattrfunc_to_attrfunc,none,
40284028
"passing %select{non-escaping|non-sendable}0 parameter %1 to function "
40294029
"expecting %select{an @escaping|a @Sendable}0 closure",
40304030
(unsigned, Identifier))
4031-
ERROR(converting_noespace_param_to_generic_type,none,
4031+
ERROR(converting_noescape_param_to_generic_type,none,
40324032
"converting non-escaping parameter %0 to generic parameter %1 may allow it to escape",
40334033
(Identifier, Type))
40344034
ERROR(assigning_noattrfunc_to_attrfunc,none,
@@ -5654,7 +5654,7 @@ ERROR(attr_requires_availability_for_platform,none,
56545654
// This doesn't display as an availability diagnostic, but it's
56555655
// implemented there and fires when these subscripts are marked
56565656
// unavailable, so it seems appropriate to put it here.
5657-
ERROR(availabilty_string_subscript_migration, none,
5657+
ERROR(availability_string_subscript_migration, none,
56585658
"subscripts returning String were obsoleted in Swift 4; explicitly "
56595659
"construct a String from subscripted result", ())
56605660

include/swift/Sema/CSBindings.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//
13-
// This file defines the \c PotentialBindings class and its auxilary types
14-
// such as \c PotentialBinding, that are used to descibe bindings which
13+
// This file defines the \c PotentialBindings class and its auxiliary types
14+
// such as \c PotentialBinding, that are used to describe bindings which
1515
// a particular type variable could be bound to.
1616
//
1717
//===----------------------------------------------------------------------===//
@@ -422,7 +422,7 @@ class BindingSet {
422422
/// Determine whether this set has any "viable" (or non-hole) bindings.
423423
///
424424
/// A viable binding could be - a direct or transitive binding
425-
/// inferred from a constraint, literal binding, or defaltable
425+
/// inferred from a constraint, literal binding, or defaultable
426426
/// binding.
427427
///
428428
/// A hole is not considered a viable binding since it doesn't

include/swift/Sema/CSFix.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ enum class FixKind : uint8_t {
103103
GenericArgumentsMismatch,
104104

105105
/// Fix up @autoclosure argument to the @autoclosure parameter,
106-
/// to for a call to be able to foward it properly, since
106+
/// to for a call to be able to forward it properly, since
107107
/// @autoclosure conversions are unsupported starting from
108108
/// Swift version 5.
109109
AutoClosureForwarding,
@@ -251,7 +251,7 @@ enum class FixKind : uint8_t {
251251
/// inferred in current context e.g. because it's a multi-statement closure.
252252
SpecifyClosureReturnType,
253253

254-
/// Object literal type coudn't be inferred because the module where
254+
/// Object literal type couldn't be inferred because the module where
255255
/// the default type that implements the associated literal protocol
256256
/// is declared was not imported.
257257
SpecifyObjectLiteralTypeImport,
@@ -274,7 +274,7 @@ enum class FixKind : uint8_t {
274274
/// Allow key path to be bound to a function type with more than 1 argument
275275
AllowMultiArgFuncKeyPathMismatch,
276276

277-
/// Specify key path root type when it cannot be infered from context.
277+
/// Specify key path root type when it cannot be inferred from context.
278278
SpecifyKeyPathRootType,
279279

280280
/// Unwrap optional base on key path application.
@@ -321,7 +321,7 @@ enum class FixKind : uint8_t {
321321
AllowNoopExistentialToCFTypeCheckedCast,
322322

323323
/// Allow a runtime checked cast where at compile time the from is
324-
/// convertible, but runtime does not support such convertions. e.g.
324+
/// convertible, but runtime does not support such conversions. e.g.
325325
/// function type casts.
326326
AllowUnsupportedRuntimeCheckedCast,
327327

@@ -450,7 +450,7 @@ class ConstraintFix {
450450

451451
/// Retrieve anchor expression associated with this fix.
452452
/// NOTE: such anchor comes directly from locator without
453-
/// any simplication attempts.
453+
/// any simplification attempts.
454454
ASTNode getAnchor() const;
455455
ConstraintLocator *getLocator() const { return Locator; }
456456

include/swift/Sema/CompletionContextFinder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class CompletionContextFinder : public ASTWalker {
7474
return hasContext(ContextKind::MultiStmtClosure);
7575
}
7676

77-
bool locatedInStringIterpolation() const {
77+
bool locatedInStringInterpolation() const {
7878
return hasContext(ContextKind::StringInterpolation);
7979
}
8080

include/swift/Sema/Constraint.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ class Constraint final : public llvm::ilist_node<Constraint>,
817817
}
818818

819819
/// Returns the number of resolved argument types for an applied disjunction
820-
/// constriant. This is always zero for disjunctions that do not represent
820+
/// constraint. This is always zero for disjunctions that do not represent
821821
/// an applied overload.
822822
unsigned countResolvedArgumentTypes(ConstraintSystem &cs) const;
823823

include/swift/Sema/ConstraintGraph.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ class ConstraintGraph {
436436
SmallVector<Constraint *, 4> OrphanedConstraints;
437437

438438
/// Increment the number of constraints considered per attempt
439-
/// to contract constrant graph edges.
439+
/// to contract constraint graph edges.
440440
void incrementConstraintsPerContractionCounter();
441441

442442
/// The kind of change made to the graph.

include/swift/Sema/ConstraintSystem.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class TypeVariableType::Implementation {
296296
void setRawOptions(unsigned bits) {
297297
getTypeVariable()->Bits.TypeVariableType.Options = bits;
298298
assert(getTypeVariable()->Bits.TypeVariableType.Options == bits
299-
&& "Trucation");
299+
&& "Truncation");
300300
}
301301

302302
/// Whether this type variable can bind to an lvalue type.
@@ -2006,7 +2006,7 @@ class SolutionApplicationTarget {
20062006
!expression.pattern->isImplicit();
20072007
}
20082008

2009-
/// Check whether this is an initializaion for `async let` pattern.
2009+
/// Check whether this is an initialization for `async let` pattern.
20102010
bool isAsyncLetInitializer() const {
20112011
if (!(kind == Kind::expression &&
20122012
expression.contextualPurpose == CTP_Initialization))
@@ -2843,7 +2843,7 @@ class ConstraintSystem {
28432843

28442844
/// Disable the given constraint; this change will be rolled back
28452845
/// when we exit the current solver scope.
2846-
void disableContraint(Constraint *constraint) {
2846+
void disableConstraint(Constraint *constraint) {
28472847
constraint->setDisabled();
28482848
disabledConstraints.push_back(constraint);
28492849
}
@@ -3180,7 +3180,7 @@ class ConstraintSystem {
31803180
///
31813181
/// \param solutions The set of solutions to filter.
31823182
///
3183-
/// \param minimize The flag which idicates if the
3183+
/// \param minimize The flag which indicates if the
31843184
/// set of solutions should be filtered even if there is
31853185
/// no single best solution, see `findBestSolution` for
31863186
/// more details.
@@ -3374,7 +3374,7 @@ class ConstraintSystem {
33743374
return known->second;
33753375
}
33763376

3377-
/// Retrieve type type of the given declaration to be used in
3377+
/// Retrieve type of the given declaration to be used in
33783378
/// constraint system, this is better than calling `getType()`
33793379
/// directly because it accounts of constraint system flags.
33803380
Type getVarType(const VarDecl *var);
@@ -3506,7 +3506,7 @@ class ConstraintSystem {
35063506
std::pair<Type, OpenedArchetypeType *> openExistentialType(
35073507
Type type, ConstraintLocator *locator);
35083508

3509-
/// Retrive the constraint locator for the given anchor and
3509+
/// Retrieve the constraint locator for the given anchor and
35103510
/// path, uniqued and automatically infer the summary flags
35113511
ConstraintLocator *
35123512
getConstraintLocator(ASTNode anchor,
@@ -4058,12 +4058,12 @@ class ConstraintSystem {
40584058
isRepresentativeFor(TypeVariableType *typeVar,
40594059
ConstraintLocator::PathElementKind kind) const;
40604060

4061-
/// Gets the VarDecl associateed with resolvedOverload, and the type of the
4061+
/// Gets the VarDecl associated with resolvedOverload, and the type of the
40624062
/// projection if the decl has an associated property wrapper with a projectedValue.
40634063
Optional<std::pair<VarDecl *, Type>>
40644064
getPropertyWrapperProjectionInfo(SelectedOverload resolvedOverload);
40654065

4066-
/// Gets the VarDecl associateed with resolvedOverload, and the type of the
4066+
/// Gets the VarDecl associated with resolvedOverload, and the type of the
40674067
/// backing storage if the decl has an associated property wrapper.
40684068
Optional<std::pair<VarDecl *, Type>>
40694069
getPropertyWrapperInformation(SelectedOverload resolvedOverload);
@@ -5715,7 +5715,7 @@ matchCallArguments(
57155715
Expr *getArgumentLabelTargetExpr(Expr *fn);
57165716

57175717
/// Given a type that includes an existential type that has been opened to
5718-
/// the given type variable, type-erase occurences of that opened type
5718+
/// the given type variable, type-erase occurrences of that opened type
57195719
/// variable and anything that depends on it to their non-dependent bounds.
57205720
Type typeEraseOpenedExistentialReference(Type type, Type existentialBaseType,
57215721
TypeVariableType *openedTypeVar,
@@ -5787,7 +5787,7 @@ bool isPatternMatchingOperator(ASTNode node);
57875787
/// "standard" comparison operator such as "==", "!=", ">" etc.
57885788
bool isStandardComparisonOperator(ASTNode node);
57895789

5790-
/// If given expression references operator overlaod(s)
5790+
/// If given expression references operator overload(s)
57915791
/// extract and produce name of the operator.
57925792
Optional<Identifier> getOperatorName(Expr *expr);
57935793

@@ -6052,7 +6052,7 @@ class TypeVarBindingProducer : public BindingProducer<TypeVariableBinding> {
60526052
/// be supertypes extracted from one of the current bindings
60536053
/// or default literal types etc.
60546054
///
6055-
/// \returns true if some new bindings were sucessfully computed,
6055+
/// \returns true if some new bindings were successfully computed,
60566056
/// false otherwise.
60576057
bool computeNext();
60586058

@@ -6201,15 +6201,15 @@ bool isKnownKeyPathType(Type type);
62016201
/// `{Writable, ReferenceWritable}KeyPath`.
62026202
bool isKnownKeyPathDecl(ASTContext &ctx, ValueDecl *decl);
62036203

6204-
/// Determine whether givne closure has any explicit `return`
6204+
/// Determine whether given closure has any explicit `return`
62056205
/// statements that could produce non-void result.
62066206
bool hasExplicitResult(ClosureExpr *closure);
62076207

62086208
/// Emit diagnostics for syntactic restrictions within a given solution
62096209
/// application target.
62106210
void performSyntacticDiagnosticsForTarget(
62116211
const SolutionApplicationTarget &target,
6212-
bool isExprStmt,bool disableExprAvailabiltyChecking = false);
6212+
bool isExprStmt,bool disableExprAvailabilityChecking = false);
62136213

62146214
/// Given a member of a protocol, check whether `Self` type of that
62156215
/// protocol is contextually bound to some concrete type via same-type

include/swift/Sema/IDETypeChecking.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ namespace swift {
144144
/// Typecheck the given expression.
145145
bool typeCheckExpression(DeclContext *DC, Expr *&parsedExpr);
146146

147-
/// Type check a function body element which is at \p TagetLoc .
147+
/// Type check a function body element which is at \p TargetLoc .
148148
bool typeCheckASTNodeAtLoc(DeclContext *DC, SourceLoc TargetLoc);
149149

150150
/// Thunk around \c TypeChecker::typeCheckForCodeCompletion to make it
@@ -158,7 +158,7 @@ namespace swift {
158158
/// solutions. Such solutions can have any number of holes in them.
159159
///
160160
/// \returns `true` if target was applicable and it was possible to infer
161-
/// types for code completion, `false` othrewise.
161+
/// types for code completion, `false` otherwise.
162162
bool typeCheckForCodeCompletion(
163163
constraints::SolutionApplicationTarget &target, bool needsPrecheck,
164164
llvm::function_ref<void(const constraints::Solution &)> callback);

lib/Sema/BuilderTransform.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,7 @@ class PreCheckResultBuilderApplication : public ASTWalker {
19691969
auto *DC = Fn.getAsDeclContext();
19701970
auto &diagEngine = DC->getASTContext().Diags;
19711971

1972-
// Suppress any diangostics which could be produced by this expression.
1972+
// Suppress any diagnostics which could be produced by this expression.
19731973
DiagnosticTransaction transaction(diagEngine);
19741974

19751975
HasError |= ConstraintSystem::preCheckExpression(

lib/Sema/CSApply.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Solution::resolveConcreteDeclRef(ValueDecl *decl,
132132
if (!decl)
133133
return ConcreteDeclRef();
134134

135-
// Get the generic signatue of the decl and compute the substitutions.
135+
// Get the generic signature of the decl and compute the substitutions.
136136
auto sig = decl->getInnermostDeclContext()->getGenericSignatureOfContext();
137137
auto subst = computeSubstitutions(sig, locator);
138138

@@ -1300,7 +1300,7 @@ namespace {
13001300

13011301
// If we're opening an existential:
13021302
// - The type of 'memberRef' inside the thunk is written in terms of the
1303-
// opened existental archetype.
1303+
// opened existential archetype.
13041304
// - The type of the thunk is written in terms of the
13051305
// erased existential bounds.
13061306
Type opaqueValueTy = openedTy;
@@ -5779,7 +5779,7 @@ ArgumentList *ExprRewriter::coerceCallArguments(
57795779

57805780
// Since it was allowed to pass function types to @autoclosure
57815781
// parameters in Swift versions < 5, it has to be handled as
5782-
// a regular function coversion by `coerceToType`.
5782+
// a regular function conversion by `coerceToType`.
57835783
if (isAutoClosureArgument(argExpr)) {
57845784
// In Swift >= 5 mode we only allow `@autoclosure` arguments
57855785
// to be used by value if parameter would return a function
@@ -5857,7 +5857,7 @@ ArgumentList *ExprRewriter::coerceCallArguments(
58575857

58585858
// If parameter is an autoclosure, we need to make sure that:
58595859
// - argument type is coerced to parameter result type
5860-
// - impilict autoclosure is created to wrap argument expression
5860+
// - implicit autoclosure is created to wrap argument expression
58615861
// - new types are propagated to constraint system
58625862
auto *closureType = param.getPlainType()->castTo<FunctionType>();
58635863

@@ -6852,8 +6852,8 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
68526852
// leave an explicit escape to noescape cast here such that SILGen can skip
68536853
// the cast and emit a code for the escaping function.
68546854
bool isInDefaultArgumentContext = false;
6855-
if (auto initalizerCtx = dyn_cast<Initializer>(dc))
6856-
isInDefaultArgumentContext = (initalizerCtx->getInitializerKind() ==
6855+
if (auto initializerCtx = dyn_cast<Initializer>(dc))
6856+
isInDefaultArgumentContext = (initializerCtx->getInitializerKind() ==
68576857
InitializerKind::DefaultArgument);
68586858
auto toEI = toFunc->getExtInfo();
68596859
assert(toType->is<FunctionType>());
@@ -6995,7 +6995,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
69956995
expr = cs.cacheType(
69966996
new (ctx) FunctionConversionExpr(expr, escapingToFuncTy));
69976997
}
6998-
// Apply an explict function conversion *only* for the escape to
6998+
// Apply an explicit function conversion *only* for the escape to
69996999
// noescape conversion. This conversion will be stripped by the
70007000
// default argument generator. (We can't return a @noescape function)
70017001
auto newExpr =
@@ -7156,7 +7156,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
71567156
return cs.cacheType(new (ctx) UnresolvedTypeConversionExpr(expr, toType));
71577157

71587158
// Use an opaque type to abstract a value of the underlying concrete type.
7159-
// The full check here would be that `toType` and `fromType` are structually
7159+
// The full check here would be that `toType` and `fromType` are structurally
71607160
// equal except in any position where `toType` has an opaque archetype. The
71617161
// below is just an approximate check since the above would be expensive to
71627162
// verify and still relies on the type checker ensuing `fromType` is
@@ -8679,7 +8679,7 @@ ExprWalker::rewriteTarget(SolutionApplicationTarget target) {
86798679
// used again. Here, however, we recover from a rewriting failure and continue
86808680
// using the Rewriter. To make sure we don't continue with an ExprStack that
86818681
// is still in the state when rewriting was aborted, save it here and restore
8682-
// it once rewritingt this target has finished.
8682+
// it once rewriting this target has finished.
86838683
llvm::SaveAndRestore<SmallVector<Expr *, 8>> RestoreExprStack(
86848684
Rewriter.ExprStack);
86858685
auto &solution = Rewriter.solution;

lib/Sema/CSBindings.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ void BindingSet::inferTransitiveProtocolRequirements(
353353
std::tie(parent, currentVar) = workList.pop_back_val();
354354

355355
// At all of the protocols associated with current type variable
356-
// are transitive to its parent, propogate them down the subtype/equivalence
356+
// are transitive to its parent, propagate them down the subtype/equivalence
357357
// chain.
358358
if (parent) {
359359
propagateProtocolsTo(parent, bindings.getConformanceRequirements(),
@@ -378,7 +378,7 @@ void BindingSet::inferTransitiveProtocolRequirements(
378378
inferredProtocols.end());
379379
}
380380

381-
// Propogate inferred protocols to all of the members of the
381+
// Propagate inferred protocols to all of the members of the
382382
// equivalence class.
383383
for (const auto &equivalence : bindings.Info.EquivalentTo) {
384384
auto eqBindings = inferredBindings.find(equivalence.first);
@@ -1301,7 +1301,7 @@ PotentialBindings::inferFromRelational(Constraint *constraint) {
13011301
EquivalentTo.insert({bindingTypeVar, constraint});
13021302

13031303
// Don't record adjacency between base and result types,
1304-
// this is just an auxiliary contraint to enforce ordering.
1304+
// this is just an auxiliary constraint to enforce ordering.
13051305
break;
13061306
}
13071307

@@ -1894,7 +1894,7 @@ TypeVariableBinding::fixForHole(ConstraintSystem &cs) const {
18941894
unsigned defaultImpact = 1;
18951895

18961896
if (auto *GP = TypeVar->getImpl().getGenericParameter()) {
1897-
// If it is represetative for a key path root, let's emit a more
1897+
// If it is representative for a key path root, let's emit a more
18981898
// specific diagnostic.
18991899
auto *keyPathRoot =
19001900
cs.isRepresentativeFor(TypeVar, ConstraintLocator::KeyPathRoot);
@@ -2023,9 +2023,9 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
20232023
if (argLoc && argLoc->isAfterCodeCompletionLoc())
20242024
return false;
20252025

2026-
// Don't penailze solutions that have holes for ignored arguments.
2026+
// Don't penalize solutions that have holes for ignored arguments.
20272027
if (cs.hasArgumentsIgnoredForCodeCompletion()) {
2028-
// Avoid simplifying the locator if the constriant system didn't ignore
2028+
// Avoid simplifying the locator if the constraint system didn't ignore
20292029
// any arguments.
20302030
auto argExpr = simplifyLocatorToAnchor(TypeVar->getImpl().getLocator());
20312031
if (cs.isArgumentIgnoredForCodeCompletion(argExpr.dyn_cast<Expr *>())) {

lib/Sema/CSClosure.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class UnresolvedClosureParameterCollector : public ASTWalker {
149149

150150
// MARK: Constraint generation
151151

152-
/// Check whether it makes sense to convert this element into a constrant.
152+
/// Check whether it makes sense to convert this element into a constraint.
153153
static bool isViableElement(ASTNode element) {
154154
if (auto *decl = element.dyn_cast<Decl *>()) {
155155
// - Ignore variable declarations, they are handled by pattern bindings;
@@ -192,7 +192,7 @@ static void createConjunction(ConstraintSystem &cs,
192192
referencedVars.push_back(cs.getType(closure)->castTo<TypeVariableType>());
193193
// Body of the closure is always isolated from its context, only
194194
// its individual elements are allowed access to type information
195-
// from the ouside e.g. parameters/result type.
195+
// from the outside e.g. parameters/result type.
196196
isIsolated = true;
197197
}
198198

0 commit comments

Comments
 (0)