Skip to content

Commit 65ec838

Browse files
Merge pull request #6976 from practicalswift/typo-fixes-20170122
[gardening] Fix recently introduced typos
2 parents ae02e0f + a9d6d89 commit 65ec838

File tree

24 files changed

+50
-50
lines changed

24 files changed

+50
-50
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,7 @@ function(_add_swift_executable_single name)
18641864
dependency_target
18651865
unused_module_dependency_target
18661866
unused_sib_dependency_target
1867-
unusged_sibopt_dependency_target
1867+
unused_sibopt_dependency_target
18681868
unused_sibgen_dependency_target
18691869
SWIFTEXE_SINGLE_SOURCES SWIFTEXE_SINGLE_EXTERNAL_SOURCES ${name}
18701870
DEPENDS

docs/StringManifesto.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ protocol Unicode
762762
var codeUnits: CodeUnits { get }
763763

764764
associatedtype UnicodeScalars
765-
: BidirectionalCollection where Element == UnicodeScalar
765+
: BidirectionalCollection where Element == UnicodeScalar
766766
var unicodeScalars: UnicodeScalars { get }
767767

768768
associatedtype ExtendedASCII

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ class RequirementRepr {
980980
/// \brief Construct a new layout-constraint requirement.
981981
///
982982
/// \param Subject The type that must conform to the given layout
983-
/// requirment.
983+
/// requirement.
984984
/// \param ColonLoc The location of the ':', or an invalid location if
985985
/// this requirement was implied.
986986
/// \param Layout The layout requirement to which the

include/swift/AST/DiagnosticsParse.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ ERROR(sil_box_expected_r_angle,none,
692692
"expected '>' to complete SIL box generic argument list", ())
693693

694694
//------------------------------------------------------------------------------
695-
// Layout constaints diagnostics
695+
// Layout constraint diagnostics
696696
//------------------------------------------------------------------------------
697697

698698
ERROR(layout_size_should_be_positive,none,

include/swift/AST/LayoutConstraint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ template <class X> inline X dyn_cast_or_null(LayoutConstraint LC) {
223223
}
224224

225225
/// LayoutConstraintLoc - Provides source location information for a
226-
/// parsed layout constaint.
226+
/// parsed layout constraint.
227227
struct LayoutConstraintLoc {
228228
private:
229229
LayoutConstraint Layout;

include/swift/AST/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ class Type {
228228
/// If at any time the function returns a null type, the null will be
229229
/// propagated out.
230230
///
231-
/// If the the function returns \c None, the transform operation will
231+
/// If the function returns \c None, the transform operation will
232232
///
233233
/// \param fn A function object with the signature
234234
/// \c Optional<Type>(TypeBase *), which accepts a type pointer and returns a

include/swift/ClangImporter/ClangImporter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class ClangImporter final : public ClangModuleLoader {
202202
/// \param trackParsedSymbols If true, tracks decls and macros that were
203203
/// parsed from the bridging header.
204204
/// \param implicitImport If true, indicates that this import was implicit
205-
/// from a reference in a module file (deprecated behaviour).
205+
/// from a reference in a module file (deprecated behavior).
206206
///
207207
/// \returns true if there was an error importing the header.
208208
///

include/swift/SIL/SILVTable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class SILVTable : public llvm::ilist_node<SILVTable>,
5858

5959
/// The linkage of the implementing function.
6060
///
61-
/// This is usuallly the same as
61+
/// This is usually the same as
6262
/// stripExternalFromLinkage(Implementation->getLinkage())
6363
/// except if Implementation is a thunk (which has private or shared
6464
/// linkage).

lib/Basic/Unix/TaskQueue.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ bool TaskQueue::execute(TaskBeganCallback Began, TaskFinishedCallback Finished,
341341
}
342342

343343
PollFds.push_back({ T->getPipe(), POLLIN | POLLPRI | POLLHUP, 0 });
344-
// We should also poll T->getErrorPipe(), but this intrroduces timing
344+
// We should also poll T->getErrorPipe(), but this introduces timing
345345
// issues with shutting down the task after reading getPipe().
346346
ExecutingTasks[Pid] = std::move(T);
347347
}

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ makeIndirectFieldAccessors(ClangImporter::Implementation &Impl,
643643

644644
// Reverse scan of the members because indirect field are generated just
645645
// after the corresponding anonymous type, so a reverse scan allows
646-
// swiftching from O(n) to O(1) here.
646+
// switching from O(n) to O(1) here.
647647
for (auto decl : reverse(members)) {
648648
if (decl->getClangDecl() == containingField) {
649649
anonymousFieldDecl = cast<VarDecl>(decl);

lib/SIL/SILValue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ visitUncheckedBitwiseCastInst(UncheckedBitwiseCastInst *UBCI) {
412412
// If we do have a trivial value ownership kind, see if our result type is
413413
// trivial or non-trivial. If it is trivial, then we have trivial
414414
// ownership. Otherwise, we have unowned ownership since from an ownership
415-
// perspective, the value has instantaneously come into existance and
415+
// perspective, the value has instantaneously come into existence and
416416
// nothing has taken ownership of it.
417417
if (ResultTypeIsTrivial) {
418418
return ValueOwnershipKind::Trivial;

lib/SILOptimizer/IPO/DeadFunctionElimination.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class FunctionLivenessComputation {
199199
makeAlive(F);
200200
}
201201

202-
/// Marks a witnes table as alive if it is not alive yet.
202+
/// Marks a witness table as alive if it is not alive yet.
203203
void ensureAliveConformance(const ProtocolConformance *C) {
204204
SILWitnessTable *WT = Module->lookUpWitnessTable(C,
205205
/*deserializeLazily*/ false);
@@ -296,7 +296,7 @@ class FunctionLivenessComputation {
296296
DEBUG(llvm::dbgs() << " scan function " << F->getName() << '\n');
297297

298298
size_t ExistingNumConfs = FoundConformances.getUsedConformances().size();
299-
size_t EsistingMetaTypes = FoundConformances.getEscapingMetaTypes().size();
299+
size_t ExistingMetaTypes = FoundConformances.getEscapingMetaTypes().size();
300300

301301
// First scan all instructions of the function.
302302
for (SILBasicBlock &BB : *F) {
@@ -329,7 +329,7 @@ class FunctionLivenessComputation {
329329
// All conformances of a type for which the meta-type escapes, must stay
330330
// alive.
331331
auto UsedMTs = FoundConformances.getEscapingMetaTypes();
332-
for (size_t Idx = EsistingMetaTypes; Idx < UsedMTs.size(); ++Idx) {
332+
for (size_t Idx = ExistingMetaTypes; Idx < UsedMTs.size(); ++Idx) {
333333
const NominalTypeDecl *NT = UsedMTs[Idx];
334334
auto Confs = NT->getAllConformances();
335335
for (ProtocolConformance *C : Confs) {
@@ -548,7 +548,7 @@ class DeadFunctionElimination : FunctionLivenessComputation {
548548
CanType ConformingTy = C->getType()->getCanonicalType();
549549
if (ConformingTy.isAnyClassReferenceType()) {
550550
// We are very conservative with class conformances. Even if a private/
551-
// internal class is never instanciated, it might be created via
551+
// internal class is never instantiated, it might be created via
552552
// reflection by using the stdlib's _getTypeByMangledName function.
553553
makeAlive(&WT);
554554
} else {

lib/SILOptimizer/Mandatory/DIMemoryUseCollector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ namespace {
410410

411411
/// How should address_to_pointer be handled?
412412
///
413-
/// In DefinitInitialization it is considered as an inout parameter to get
413+
/// In DefiniteInitialization it is considered as an inout parameter to get
414414
/// diagnostics about passing a let variable to an inout mutable-pointer
415415
/// argument.
416416
/// In PredictableMemOpt it is considered as an escape point to be

lib/Sema/CSDiag.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,7 +2433,7 @@ bool FailureDiagnosis::diagnoseGeneralMemberFailure(Constraint *constraint) {
24332433

24342434
// If base type has unresolved generic parameters, such might mean
24352435
// that it's initializer with erroneous argument, otherwise this would
2436-
// be a simple ambigious archetype case, neither can be diagnosed here.
2436+
// be a simple ambiguous archetype case, neither can be diagnosed here.
24372437
if (baseTy->hasTypeParameter() && baseTy->hasUnresolvedType())
24382438
return false;
24392439

@@ -5740,7 +5740,7 @@ bool FailureDiagnosis::diagnoseArgumentGenericRequirements(
57405740
if (isUnresolvedOrTypeVarType(argType) || argType->hasError())
57415741
return false;
57425742

5743-
// Record substituation from generic parameter to the argument type.
5743+
// Record substitution from generic parameter to the argument type.
57445744
substitutions[env->mapTypeOutOfContext(archetype)
57455745
->getCanonicalType()
57465746
->castTo<SubstitutableType>()] = argType;

lib/Sema/CSSimplify.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
14781478
// Subtype constraints are subject for edge contraction,
14791479
// which is inappropriate in this case, because it's going to
14801480
// erase/lose 'inout' modifier after merging equivalence classes
1481-
// (if inout containts type var, see ConstraintGraph::contractEdges()),
1481+
// (if inout constraints type var, see ConstraintGraph::contractEdges()),
14821482
// since right-hand side type variable must not be materializable
14831483
// it can simply get left-hand side as a fixed binding, otherwise fail.
14841484
if (type1->is<InOutType>() &&
@@ -1490,7 +1490,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
14901490
if (typeVar2->getImpl().mustBeMaterializable())
14911491
return SolutionKind::Error;
14921492

1493-
// Constriants like `inout T0 subtype T1` where (T0 must be
1493+
// Constraints like `inout T0 subtype T1` where (T0 must be
14941494
// materializable) are created when closures are part of the generic
14951495
// function parameters e.g. `func foo<T>(_ t: T, (inout T) -> Void) {}`
14961496
// so when such function gets called e.g.

lib/Sema/CSSolver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ ConstraintSystem::solveSingle(FreeTypeVariableBinding allowFreeTypeVariables) {
14511451
bool ConstraintSystem::Candidate::solve() {
14521452
// Don't attempt to solve candidate if there is closure
14531453
// expression involved, because it's handled specially
1454-
// by parent constaint system (e.g. parameter lists).
1454+
// by parent constraint system (e.g. parameter lists).
14551455
bool containsClosure = false;
14561456
E->forEachChildExpr([&](Expr *childExpr) -> Expr * {
14571457
if (isa<ClosureExpr>(childExpr)) {
@@ -1616,7 +1616,7 @@ void ConstraintSystem::shrink(Expr *expr) {
16161616
}
16171617

16181618
// Let's not attempt to type-check closures or expressions
1619-
// which containt closures, because they require special handling
1619+
// which constrain closures, because they require special handling
16201620
// when dealing with context and parameters declarations.
16211621
if (isa<ClosureExpr>(expr)) {
16221622
return {false, expr};

lib/Sema/ConstraintSystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,11 +866,11 @@ class ConstraintSystem {
866866
unsigned TypeCounter = 0;
867867

868868
/// \brief The number of scopes created so far during the solution
869-
/// of this constriant system.
869+
/// of this constraint system.
870870
///
871871
/// This is a measure of complexity of the solution space. A new
872872
/// scope is created every time we attempt a type variable binding
873-
/// or explore an option in a disjuction.
873+
/// or explore an option in a disjunction.
874874
unsigned CountScopes = 0;
875875

876876
/// \brief Cached member lookups.

lib/Sema/TypeChecker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ class GenericRequirementsCheckListener {
346346
/// \param first The left-hand side type assigned to the requirement,
347347
/// possibly represented by its generic substitute.
348348
///
349-
/// \param second The right-hand side type assinged to the requirement,
349+
/// \param second The right-hand side type assigned to the requirement,
350350
/// possibly represented by its generic substitute.
351351
///
352352
///

stdlib/public/SDK/Foundation/Data.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -973,10 +973,10 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
973973
}
974974
}
975975

976-
/// Initialze a `Data` with a repeating byte pattern
976+
/// Initialize a `Data` with a repeating byte pattern
977977
///
978-
/// - parameter repeatedValue: A byte to initialze the pattern
979-
/// - parameter count: The number of bytes the data initially contains initialzed to the repeatedValue
978+
/// - parameter repeatedValue: A byte to initialize the pattern
979+
/// - parameter count: The number of bytes the data initially contains initialized to the repeatedValue
980980
public init(repeating repeatedValue: UInt8, count: Int) {
981981
self.init(count: count)
982982
withUnsafeMutableBytes { (bytes: UnsafeMutablePointer<UInt8>) -> Void in

stdlib/public/SDK/XCTest/XCTest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ public func XCTAssertEqual<T : Equatable>(_ expression1: @autoclosure () throws
297297
let expressionValueStr1 = String(describing: expressionValue1Optional)
298298
let expressionValueStr2 = String(describing: expressionValue2Optional)
299299

300-
// FIXME: this file seems to use `as NSString` unnecesarily a lot,
301-
// unlesss I'm missing something.
300+
// FIXME: this file seems to use `as NSString` unnecessarily a lot,
301+
// unless I'm missing something.
302302
_XCTRegisterFailure(true, _XCTFailureDescription(assertionType, 0, expressionValueStr1 as NSString, expressionValueStr2 as NSString), message, file, line)
303303
}
304304

stdlib/public/runtime/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ if(SWIFT_BUILD_STATIC_STDLIB AND "${sdk}" STREQUAL "LINUX")
7676
set(static_binary_lnk_file_list)
7777
string(TOLOWER "${sdk}" lowercase_sdk)
7878

79-
# These two libaries are only used with the static swiftcore
79+
# These two libraries are only used with the static swiftcore
8080
add_library(swiftImageInspectionStatic STATIC
8181
ImageInspectionStatic.cpp
8282
StaticBinaryELF.cpp)

stdlib/public/runtime/StaticBinaryELF.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ typedef Elf64_Shdr Elf_Shdr;
4444
typedef Elf64_Phdr Elf_Phdr;
4545
typedef Elf64_Addr Elf_Addr;
4646
typedef Elf64_Word Elf_Word;
47-
typedef Elf64_Sym Elf_Sym;
47+
typedef Elf64_Sym Elf_Sym;
4848
typedef Elf64_Section Elf_Section;
4949
#define ELF_ST_TYPE(x) ELF64_ST_TYPE(x)
5050
#else
@@ -54,7 +54,7 @@ typedef Elf32_Shdr Elf_Shdr;
5454
typedef Elf32_Phdr Elf_Phdr;
5555
typedef Elf32_Addr Elf_Addr;
5656
typedef Elf32_Word Elf_Word;
57-
typedef Elf32_Sym Elf_Sym;
57+
typedef Elf32_Sym Elf_Sym;
5858
typedef Elf32_Section Elf_Section;
5959
#define ELF_ST_TYPE(x) ELF32_ST_TYPE(x)
6060
#endif
@@ -186,7 +186,7 @@ class StaticBinaryELF {
186186
// This is Linux specific - find the full path of the executable
187187
// by looking in /proc/self/maps for a mapping holding the current
188188
// address space. For a static binary it should only be mapping one
189-
// file anyway. Dont use /proc/self/exe as the symlink will be removed
189+
// file anyway. Don't use /proc/self/exe as the symlink will be removed
190190
// if the main thread terminates - see proc(5).
191191
void getExecutablePathName() {
192192
uintptr_t address = (uintptr_t)&elfHeader;

test/Compatibility/bridging-nsnumber-and-nsvalue.swift.gyb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,33 +91,33 @@ func bridgeNSNumberBackToSpecificType(object: ${ObjectType},
9191
_ = dictKeys as? [${Type}: AnyObject]
9292
_ = dictKeys as! [${Type}: AnyObject]
9393

94-
_ = dictValues as [AnyHashable: ${Type}] // expected-warning{{use 'as!'}}
95-
_ = dictValues is [AnyHashable: ${Type}]
94+
_ = dictValues as [AnyHashable: ${Type}] // expected-warning{{use 'as!'}}
95+
_ = dictValues is [AnyHashable: ${Type}]
9696
_ = dictValues as? [AnyHashable: ${Type}]
9797
_ = dictValues as! [AnyHashable: ${Type}]
9898

99-
_ = dictValues as [NSObject: ${Type}] // expected-warning{{use 'as!'}}
100-
_ = dictValues is [NSObject: ${Type}]
99+
_ = dictValues as [NSObject: ${Type}] // expected-warning{{use 'as!'}}
100+
_ = dictValues is [NSObject: ${Type}]
101101
_ = dictValues as? [NSObject: ${Type}]
102102
_ = dictValues as! [NSObject: ${Type}]
103103

104-
_ = dictBoth as [${ObjectType}: ${Type}] // expected-warning{{use 'as!'}}
105-
_ = dictBoth is [${ObjectType}: ${Type}]
104+
_ = dictBoth as [${ObjectType}: ${Type}] // expected-warning{{use 'as!'}}
105+
_ = dictBoth is [${ObjectType}: ${Type}]
106106
_ = dictBoth as? [${ObjectType}: ${Type}]
107107
_ = dictBoth as! [${ObjectType}: ${Type}]
108108

109-
_ = dictBoth as [${Type}: ${ObjectType}] // expected-warning{{use 'as!'}}
110-
_ = dictBoth is [${Type}: ${ObjectType}]
109+
_ = dictBoth as [${Type}: ${ObjectType}] // expected-warning{{use 'as!'}}
110+
_ = dictBoth is [${Type}: ${ObjectType}]
111111
_ = dictBoth as? [${Type}: ${ObjectType}]
112112
_ = dictBoth as! [${Type}: ${ObjectType}]
113113

114-
_ = dictBoth as [${Type}: ${Type}] // expected-warning{{use 'as!'}}
115-
_ = dictBoth is [${Type}: ${Type}]
114+
_ = dictBoth as [${Type}: ${Type}] // expected-warning{{use 'as!'}}
115+
_ = dictBoth is [${Type}: ${Type}]
116116
_ = dictBoth as? [${Type}: ${Type}]
117117
_ = dictBoth as! [${Type}: ${Type}]
118118

119-
_ = set as Set<${Type}> // expected-warning{{use 'as!'}}
120-
_ = set is Set<${Type}>
119+
_ = set as Set<${Type}> // expected-warning{{use 'as!'}}
120+
_ = set is Set<${Type}>
121121
_ = set as? Set<${Type}>
122122
_ = set as! Set<${Type}>
123123
% end

utils/line-directive

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ def run():
246246
sources = sys.argv[1:dashes]
247247

248248
# The first argument of command_args is the process to open.
249-
# subprocess.Popen doesn't normalise arguments. This means that trying
250-
# to open a non-normalised file (e.g. C:/swift/./bin/swiftc.exe) on
249+
# subprocess.Popen doesn't normalize arguments. This means that trying
250+
# to open a non-normalized file (e.g. C:/swift/./bin/swiftc.exe) on
251251
# Windows results in file/directory not found errors, as Popen delegates
252-
# to the Win32 CreateProcess API. Unix systems handle non-normalised
252+
# to the Win32 CreateProcess API. Unix systems handle non-normalized
253253
# paths, so don't have this problem.
254-
# Arguments passed to the process are normalised by the process.
254+
# Arguments passed to the process are normalized by the process.
255255
command_args = sys.argv[dashes + 1:]
256256
command_args[0] = os.path.normpath(command_args[0])
257257

0 commit comments

Comments
 (0)