Skip to content

Spelling sema #42474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 132 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
6ef95f9
spelling: accessibility
jsoref Apr 17, 2022
7bd8266
spelling: accessories
jsoref Apr 18, 2022
9039443
spelling: adjustments
jsoref Apr 17, 2022
257cff4
spelling: all
jsoref Apr 17, 2022
a8fb224
spelling: ambiguous
jsoref Apr 17, 2022
f03b8f2
spelling: arguments
jsoref Apr 17, 2022
7a6a766
spelling: assignment
jsoref Apr 17, 2022
271048d
spelling: associated
jsoref Apr 17, 2022
1924c73
spelling: assumes
jsoref Apr 17, 2022
8d56ebe
spelling: auxiliary
jsoref Apr 17, 2022
0aff6b3
spelling: availability
jsoref Apr 17, 2022
4b5cb65
spelling: available
jsoref Apr 17, 2022
b6165d2
spelling: belongs
jsoref Apr 17, 2022
83e39ed
spelling: checking
jsoref Apr 17, 2022
c9a8fe5
spelling: clazz
jsoref Apr 17, 2022
5503862
spelling: compatibility
jsoref Apr 17, 2022
a827bc2
spelling: completely
jsoref Apr 17, 2022
6a3f89f
spelling: completion
jsoref Apr 19, 2022
084cc8b
spelling: complicated
jsoref Apr 17, 2022
0c55700
spelling: conformance
jsoref Apr 17, 2022
f0b83fa
spelling: constrained
jsoref Apr 17, 2022
2841578
spelling: constraint
jsoref Apr 17, 2022
886c689
spelling: contextual
jsoref Apr 17, 2022
10c41c5
spelling: conversion
jsoref Apr 17, 2022
4496cda
spelling: convertible
jsoref Apr 17, 2022
ac37173
spelling: couldn't
jsoref Apr 17, 2022
d94c622
spelling: declaration
jsoref Apr 17, 2022
5c23286
spelling: defaultable
jsoref Apr 17, 2022
b532e15
spelling: dependent
jsoref Apr 17, 2022
6717eec
spelling: depending
jsoref Apr 17, 2022
b7ef4a2
spelling: describe
jsoref Apr 17, 2022
fc25f9e
spelling: diagnostic
jsoref Apr 17, 2022
ea10cf1
spelling: diagnostics
jsoref Apr 17, 2022
185e641
spelling: existential
jsoref Apr 17, 2022
20df0de
spelling: expects
jsoref Apr 17, 2022
b43da23
spelling: explicit
jsoref Apr 17, 2022
309a2f1
spelling: explicitly
jsoref Apr 17, 2022
ca79ca2
spelling: expression
jsoref Apr 17, 2022
8f5560a
spelling: first
jsoref Apr 17, 2022
9c47d5e
spelling: font
jsoref Apr 17, 2022
4607ff1
spelling: forward
jsoref Apr 17, 2022
98a83f3
spelling: generation
jsoref Apr 17, 2022
39614f9
spelling: generic
jsoref Apr 17, 2022
cebd2a3
spelling: given
jsoref Apr 17, 2022
9727e2e
spelling: global
jsoref Apr 17, 2022
04802bd
spelling: guarantee
jsoref Apr 17, 2022
e9dd233
spelling: happened
jsoref Apr 17, 2022
817ae9e
spelling: hierarchy
jsoref Apr 17, 2022
7af8cce
spelling: identical
jsoref Apr 17, 2022
a10e254
spelling: immediately
jsoref Apr 17, 2022
28dabee
spelling: implicit
jsoref Apr 17, 2022
48c45b0
spelling: indicates
jsoref Apr 17, 2022
8e5cd17
spelling: inferred
jsoref Apr 17, 2022
4ec86ca
spelling: initialization
jsoref Apr 17, 2022
aa161b4
spelling: initialize
jsoref Apr 17, 2022
1719305
spelling: initializer
jsoref Apr 17, 2022
4177cdd
spelling: integrity
jsoref Apr 17, 2022
d06b8e6
spelling: interpolation
jsoref Apr 17, 2022
973be1d
spelling: introducing
jsoref Apr 17, 2022
7033257
spelling: involved
jsoref Apr 17, 2022
50c5a30
spelling: just
jsoref Apr 17, 2022
9d6b2d7
spelling: like
jsoref Apr 17, 2022
32e9069
spelling: likewise
jsoref Apr 17, 2022
e95d2ea
spelling: mismatch
jsoref Apr 17, 2022
db7d694
spelling: missing
jsoref Apr 17, 2022
1e5f9a2
spelling: more
jsoref Apr 17, 2022
f683941
spelling: necessarily
jsoref Apr 17, 2022
96d411e
spelling: noescape
jsoref Apr 17, 2022
ebc4c7c
spelling: nonetheless
jsoref Apr 17, 2022
905f89d
spelling: occurrences
jsoref Apr 17, 2022
91aad77
spelling: operators
jsoref Apr 17, 2022
47aae12
spelling: optional
jsoref Apr 17, 2022
641d783
spelling: otherwise
jsoref Apr 17, 2022
0ff69df
spelling: outside
jsoref Apr 17, 2022
4ea6aea
spelling: overload
jsoref Apr 17, 2022
4b745ac
spelling: overridden
jsoref Apr 17, 2022
38eafc3
spelling: override
jsoref Apr 17, 2022
ab3c05c
spelling: parameter
jsoref Apr 17, 2022
d4ff72b
spelling: parameters
jsoref Apr 17, 2022
9fe7068
spelling: penalize
jsoref Apr 17, 2022
03939c5
spelling: platforms
jsoref Apr 17, 2022
aeb75c2
spelling: precedence
jsoref Apr 17, 2022
2ed6577
spelling: preemptively
jsoref Apr 17, 2022
60bac76
spelling: preliminary
jsoref Apr 17, 2022
7c8bd72
spelling: preserve
jsoref Apr 17, 2022
2e44324
spelling: propagate
jsoref Apr 17, 2022
06c9372
spelling: propagated
jsoref Apr 17, 2022
c6c9579
spelling: qualifier
jsoref Apr 17, 2022
a82362c
spelling: question
jsoref Apr 17, 2022
a4db3a1
spelling: really
jsoref Apr 17, 2022
3e2a03c
spelling: received
jsoref Apr 17, 2022
5fe0787
spelling: references
jsoref Apr 17, 2022
fffee57
spelling: replaceable
jsoref Apr 17, 2022
2944892
spelling: replacement
jsoref Apr 17, 2022
dbe7a5c
spelling: representable
jsoref Apr 17, 2022
e31400f
spelling: representative
jsoref Apr 17, 2022
828d050
spelling: requirement
jsoref Apr 17, 2022
17cccc3
spelling: requires
jsoref Apr 17, 2022
3661f8e
spelling: resolved
jsoref Apr 17, 2022
f3600d3
spelling: retrieve
jsoref Apr 17, 2022
2ec06d9
spelling: rewriting
jsoref Apr 17, 2022
d3c4a20
spelling: satisfied
jsoref Apr 17, 2022
538530b
spelling: semantics
jsoref Apr 17, 2022
b0c0cb2
spelling: signature
jsoref Apr 17, 2022
622be28
spelling: similar
jsoref Apr 17, 2022
5177f68
spelling: simplest
jsoref Apr 17, 2022
020ba5b
spelling: simplification
jsoref Apr 17, 2022
90f4ced
spelling: solver
jsoref Apr 17, 2022
55c0837
spelling: struct
jsoref Apr 17, 2022
15b9294
spelling: structurally
jsoref Apr 17, 2022
9d7cb17
spelling: success
jsoref Apr 17, 2022
990094b
spelling: sure
jsoref Apr 17, 2022
b42aa6d
spelling: symmetric
jsoref Apr 17, 2022
e98c632
spelling: syntactically
jsoref Apr 17, 2022
61f0beb
spelling: target
jsoref Apr 17, 2022
7f2d2a1
spelling: that
jsoref Apr 17, 2022
1eaab0f
spelling: the
jsoref Apr 17, 2022
adb786a
spelling: themselves
jsoref Apr 17, 2022
b68891e
spelling: these
jsoref Apr 17, 2022
a61b4e6
spelling: this
jsoref Apr 17, 2022
2bb815c
spelling: transform
jsoref Apr 17, 2022
d235986
spelling: transparent
jsoref Apr 17, 2022
0b1e1c9
spelling: tread
jsoref Apr 17, 2022
d345a4b
spelling: truncation
jsoref Apr 17, 2022
264d804
spelling: type
jsoref Apr 18, 2022
f5f724c
spelling: unconstructable
jsoref Apr 17, 2022
7f0d96c
spelling: universally
jsoref Apr 17, 2022
9e77709
spelling: unknown
jsoref Apr 17, 2022
19a4d82
spelling: unwrapped
jsoref Apr 17, 2022
b1a6210
spelling: versioned
jsoref Apr 17, 2022
3d23149
spelling: visible
jsoref Apr 17, 2022
9acb11f
spelling: where
jsoref Apr 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ NOTE(unwrap_with_guard,none,
ERROR(optional_base_not_unwrapped,none,
"value of optional type %0 must be unwrapped to refer to member %1 of "
"wrapped base type %2", (Type, DeclNameRef, Type))
ERROR(invalid_optional_infered_keypath_root, none,
ERROR(invalid_optional_inferred_keypath_root, none,
"key path root inferred as optional type %0 must be unwrapped to refer to member %1 "
"of unwrapped type %2", (Type, DeclNameRef, Type))
NOTE(optional_base_chain,none,
Expand Down Expand Up @@ -4028,7 +4028,7 @@ ERROR(passing_noattrfunc_to_attrfunc,none,
"passing %select{non-escaping|non-sendable}0 parameter %1 to function "
"expecting %select{an @escaping|a @Sendable}0 closure",
(unsigned, Identifier))
ERROR(converting_noespace_param_to_generic_type,none,
ERROR(converting_noescape_param_to_generic_type,none,
"converting non-escaping parameter %0 to generic parameter %1 may allow it to escape",
(Identifier, Type))
ERROR(assigning_noattrfunc_to_attrfunc,none,
Expand Down Expand Up @@ -5654,7 +5654,7 @@ ERROR(attr_requires_availability_for_platform,none,
// This doesn't display as an availability diagnostic, but it's
// implemented there and fires when these subscripts are marked
// unavailable, so it seems appropriate to put it here.
ERROR(availabilty_string_subscript_migration, none,
ERROR(availability_string_subscript_migration, none,
"subscripts returning String were obsoleted in Swift 4; explicitly "
"construct a String from subscripted result", ())

Expand Down
6 changes: 3 additions & 3 deletions include/swift/Sema/CSBindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//
//
// This file defines the \c PotentialBindings class and its auxilary types
// such as \c PotentialBinding, that are used to descibe bindings which
// This file defines the \c PotentialBindings class and its auxiliary types
// such as \c PotentialBinding, that are used to describe bindings which
// a particular type variable could be bound to.
//
//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -422,7 +422,7 @@ class BindingSet {
/// Determine whether this set has any "viable" (or non-hole) bindings.
///
/// A viable binding could be - a direct or transitive binding
/// inferred from a constraint, literal binding, or defaltable
/// inferred from a constraint, literal binding, or defaultable
/// binding.
///
/// A hole is not considered a viable binding since it doesn't
Expand Down
10 changes: 5 additions & 5 deletions include/swift/Sema/CSFix.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ enum class FixKind : uint8_t {
GenericArgumentsMismatch,

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

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

/// Specify key path root type when it cannot be infered from context.
/// Specify key path root type when it cannot be inferred from context.
SpecifyKeyPathRootType,

/// Unwrap optional base on key path application.
Expand Down Expand Up @@ -321,7 +321,7 @@ enum class FixKind : uint8_t {
AllowNoopExistentialToCFTypeCheckedCast,

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

Expand Down Expand Up @@ -450,7 +450,7 @@ class ConstraintFix {

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

Expand Down
2 changes: 1 addition & 1 deletion include/swift/Sema/CompletionContextFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CompletionContextFinder : public ASTWalker {
return hasContext(ContextKind::MultiStmtClosure);
}

bool locatedInStringIterpolation() const {
bool locatedInStringInterpolation() const {
return hasContext(ContextKind::StringInterpolation);
}

Expand Down
2 changes: 1 addition & 1 deletion include/swift/Sema/Constraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ class Constraint final : public llvm::ilist_node<Constraint>,
}

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

Expand Down
2 changes: 1 addition & 1 deletion include/swift/Sema/ConstraintGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ class ConstraintGraph {
SmallVector<Constraint *, 4> OrphanedConstraints;

/// Increment the number of constraints considered per attempt
/// to contract constrant graph edges.
/// to contract constraint graph edges.
void incrementConstraintsPerContractionCounter();

/// The kind of change made to the graph.
Expand Down
26 changes: 13 additions & 13 deletions include/swift/Sema/ConstraintSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class TypeVariableType::Implementation {
void setRawOptions(unsigned bits) {
getTypeVariable()->Bits.TypeVariableType.Options = bits;
assert(getTypeVariable()->Bits.TypeVariableType.Options == bits
&& "Trucation");
&& "Truncation");
}

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

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

/// Disable the given constraint; this change will be rolled back
/// when we exit the current solver scope.
void disableContraint(Constraint *constraint) {
void disableConstraint(Constraint *constraint) {
constraint->setDisabled();
disabledConstraints.push_back(constraint);
}
Expand Down Expand Up @@ -3180,7 +3180,7 @@ class ConstraintSystem {
///
/// \param solutions The set of solutions to filter.
///
/// \param minimize The flag which idicates if the
/// \param minimize The flag which indicates if the
/// set of solutions should be filtered even if there is
/// no single best solution, see `findBestSolution` for
/// more details.
Expand Down Expand Up @@ -3374,7 +3374,7 @@ class ConstraintSystem {
return known->second;
}

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

/// Retrive the constraint locator for the given anchor and
/// Retrieve the constraint locator for the given anchor and
/// path, uniqued and automatically infer the summary flags
ConstraintLocator *
getConstraintLocator(ASTNode anchor,
Expand Down Expand Up @@ -4058,12 +4058,12 @@ class ConstraintSystem {
isRepresentativeFor(TypeVariableType *typeVar,
ConstraintLocator::PathElementKind kind) const;

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

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

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

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

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

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

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

/// Emit diagnostics for syntactic restrictions within a given solution
/// application target.
void performSyntacticDiagnosticsForTarget(
const SolutionApplicationTarget &target,
bool isExprStmt,bool disableExprAvailabiltyChecking = false);
bool isExprStmt,bool disableExprAvailabilityChecking = false);

/// Given a member of a protocol, check whether `Self` type of that
/// protocol is contextually bound to some concrete type via same-type
Expand Down
4 changes: 2 additions & 2 deletions include/swift/Sema/IDETypeChecking.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ namespace swift {
/// Typecheck the given expression.
bool typeCheckExpression(DeclContext *DC, Expr *&parsedExpr);

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

/// Thunk around \c TypeChecker::typeCheckForCodeCompletion to make it
Expand All @@ -158,7 +158,7 @@ namespace swift {
/// solutions. Such solutions can have any number of holes in them.
///
/// \returns `true` if target was applicable and it was possible to infer
/// types for code completion, `false` othrewise.
/// types for code completion, `false` otherwise.
bool typeCheckForCodeCompletion(
constraints::SolutionApplicationTarget &target, bool needsPrecheck,
llvm::function_ref<void(const constraints::Solution &)> callback);
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/BuilderTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,7 @@ class PreCheckResultBuilderApplication : public ASTWalker {
auto *DC = Fn.getAsDeclContext();
auto &diagEngine = DC->getASTContext().Diags;

// Suppress any diangostics which could be produced by this expression.
// Suppress any diagnostics which could be produced by this expression.
DiagnosticTransaction transaction(diagEngine);

HasError |= ConstraintSystem::preCheckExpression(
Expand Down
18 changes: 9 additions & 9 deletions lib/Sema/CSApply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Solution::resolveConcreteDeclRef(ValueDecl *decl,
if (!decl)
return ConcreteDeclRef();

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

Expand Down Expand Up @@ -1300,7 +1300,7 @@ namespace {

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

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

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

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

// Use an opaque type to abstract a value of the underlying concrete type.
// The full check here would be that `toType` and `fromType` are structually
// The full check here would be that `toType` and `fromType` are structurally
// equal except in any position where `toType` has an opaque archetype. The
// below is just an approximate check since the above would be expensive to
// verify and still relies on the type checker ensuing `fromType` is
Expand Down Expand Up @@ -8679,7 +8679,7 @@ ExprWalker::rewriteTarget(SolutionApplicationTarget target) {
// used again. Here, however, we recover from a rewriting failure and continue
// using the Rewriter. To make sure we don't continue with an ExprStack that
// is still in the state when rewriting was aborted, save it here and restore
// it once rewritingt this target has finished.
// it once rewriting this target has finished.
llvm::SaveAndRestore<SmallVector<Expr *, 8>> RestoreExprStack(
Rewriter.ExprStack);
auto &solution = Rewriter.solution;
Expand Down
12 changes: 6 additions & 6 deletions lib/Sema/CSBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void BindingSet::inferTransitiveProtocolRequirements(
std::tie(parent, currentVar) = workList.pop_back_val();

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

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

// Don't record adjacency between base and result types,
// this is just an auxiliary contraint to enforce ordering.
// this is just an auxiliary constraint to enforce ordering.
break;
}

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

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

// Don't penailze solutions that have holes for ignored arguments.
// Don't penalize solutions that have holes for ignored arguments.
if (cs.hasArgumentsIgnoredForCodeCompletion()) {
// Avoid simplifying the locator if the constriant system didn't ignore
// Avoid simplifying the locator if the constraint system didn't ignore
// any arguments.
auto argExpr = simplifyLocatorToAnchor(TypeVar->getImpl().getLocator());
if (cs.isArgumentIgnoredForCodeCompletion(argExpr.dyn_cast<Expr *>())) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/CSClosure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class UnresolvedClosureParameterCollector : public ASTWalker {

// MARK: Constraint generation

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

Expand Down
Loading