Skip to content

[gardening] Fix recently introduced typos #6976

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 1 commit into from
Jan 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,7 @@ function(_add_swift_executable_single name)
dependency_target
unused_module_dependency_target
unused_sib_dependency_target
unusged_sibopt_dependency_target
unused_sibopt_dependency_target
unused_sibgen_dependency_target
SWIFTEXE_SINGLE_SOURCES SWIFTEXE_SINGLE_EXTERNAL_SOURCES ${name}
DEPENDS
Expand Down
2 changes: 1 addition & 1 deletion docs/StringManifesto.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ protocol Unicode
var codeUnits: CodeUnits { get }

associatedtype UnicodeScalars
: BidirectionalCollection where Element == UnicodeScalar
: BidirectionalCollection where Element == UnicodeScalar
var unicodeScalars: UnicodeScalars { get }

associatedtype ExtendedASCII
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ class RequirementRepr {
/// \brief Construct a new layout-constraint requirement.
///
/// \param Subject The type that must conform to the given layout
/// requirment.
/// requirement.
/// \param ColonLoc The location of the ':', or an invalid location if
/// this requirement was implied.
/// \param Layout The layout requirement to which the
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsParse.def
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ ERROR(sil_box_expected_r_angle,none,
"expected '>' to complete SIL box generic argument list", ())

//------------------------------------------------------------------------------
// Layout constaints diagnostics
// Layout constraint diagnostics
//------------------------------------------------------------------------------

ERROR(layout_size_should_be_positive,none,
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/LayoutConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ template <class X> inline X dyn_cast_or_null(LayoutConstraint LC) {
}

/// LayoutConstraintLoc - Provides source location information for a
/// parsed layout constaint.
/// parsed layout constraint.
struct LayoutConstraintLoc {
private:
LayoutConstraint Layout;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class Type {
/// If at any time the function returns a null type, the null will be
/// propagated out.
///
/// If the the function returns \c None, the transform operation will
/// If the function returns \c None, the transform operation will
///
/// \param fn A function object with the signature
/// \c Optional<Type>(TypeBase *), which accepts a type pointer and returns a
Expand Down
2 changes: 1 addition & 1 deletion include/swift/ClangImporter/ClangImporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class ClangImporter final : public ClangModuleLoader {
/// \param trackParsedSymbols If true, tracks decls and macros that were
/// parsed from the bridging header.
/// \param implicitImport If true, indicates that this import was implicit
/// from a reference in a module file (deprecated behaviour).
/// from a reference in a module file (deprecated behavior).
///
/// \returns true if there was an error importing the header.
///
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SIL/SILVTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SILVTable : public llvm::ilist_node<SILVTable>,

/// The linkage of the implementing function.
///
/// This is usuallly the same as
/// This is usually the same as
/// stripExternalFromLinkage(Implementation->getLinkage())
/// except if Implementation is a thunk (which has private or shared
/// linkage).
Expand Down
2 changes: 1 addition & 1 deletion lib/Basic/Unix/TaskQueue.inc
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ bool TaskQueue::execute(TaskBeganCallback Began, TaskFinishedCallback Finished,
}

PollFds.push_back({ T->getPipe(), POLLIN | POLLPRI | POLLHUP, 0 });
// We should also poll T->getErrorPipe(), but this intrroduces timing
// We should also poll T->getErrorPipe(), but this introduces timing
// issues with shutting down the task after reading getPipe().
ExecutingTasks[Pid] = std::move(T);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ClangImporter/ImportDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ makeIndirectFieldAccessors(ClangImporter::Implementation &Impl,

// Reverse scan of the members because indirect field are generated just
// after the corresponding anonymous type, so a reverse scan allows
// swiftching from O(n) to O(1) here.
// switching from O(n) to O(1) here.
for (auto decl : reverse(members)) {
if (decl->getClangDecl() == containingField) {
anonymousFieldDecl = cast<VarDecl>(decl);
Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/SILValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ visitUncheckedBitwiseCastInst(UncheckedBitwiseCastInst *UBCI) {
// If we do have a trivial value ownership kind, see if our result type is
// trivial or non-trivial. If it is trivial, then we have trivial
// ownership. Otherwise, we have unowned ownership since from an ownership
// perspective, the value has instantaneously come into existance and
// perspective, the value has instantaneously come into existence and
// nothing has taken ownership of it.
if (ResultTypeIsTrivial) {
return ValueOwnershipKind::Trivial;
Expand Down
8 changes: 4 additions & 4 deletions lib/SILOptimizer/IPO/DeadFunctionElimination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class FunctionLivenessComputation {
makeAlive(F);
}

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

size_t ExistingNumConfs = FoundConformances.getUsedConformances().size();
size_t EsistingMetaTypes = FoundConformances.getEscapingMetaTypes().size();
size_t ExistingMetaTypes = FoundConformances.getEscapingMetaTypes().size();

// First scan all instructions of the function.
for (SILBasicBlock &BB : *F) {
Expand Down Expand Up @@ -329,7 +329,7 @@ class FunctionLivenessComputation {
// All conformances of a type for which the meta-type escapes, must stay
// alive.
auto UsedMTs = FoundConformances.getEscapingMetaTypes();
for (size_t Idx = EsistingMetaTypes; Idx < UsedMTs.size(); ++Idx) {
for (size_t Idx = ExistingMetaTypes; Idx < UsedMTs.size(); ++Idx) {
const NominalTypeDecl *NT = UsedMTs[Idx];
auto Confs = NT->getAllConformances();
for (ProtocolConformance *C : Confs) {
Expand Down Expand Up @@ -548,7 +548,7 @@ class DeadFunctionElimination : FunctionLivenessComputation {
CanType ConformingTy = C->getType()->getCanonicalType();
if (ConformingTy.isAnyClassReferenceType()) {
// We are very conservative with class conformances. Even if a private/
// internal class is never instanciated, it might be created via
// internal class is never instantiated, it might be created via
// reflection by using the stdlib's _getTypeByMangledName function.
makeAlive(&WT);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Mandatory/DIMemoryUseCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ namespace {

/// How should address_to_pointer be handled?
///
/// In DefinitInitialization it is considered as an inout parameter to get
/// In DefiniteInitialization it is considered as an inout parameter to get
/// diagnostics about passing a let variable to an inout mutable-pointer
/// argument.
/// In PredictableMemOpt it is considered as an escape point to be
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/CSDiag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2433,7 +2433,7 @@ bool FailureDiagnosis::diagnoseGeneralMemberFailure(Constraint *constraint) {

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

Expand Down Expand Up @@ -5740,7 +5740,7 @@ bool FailureDiagnosis::diagnoseArgumentGenericRequirements(
if (isUnresolvedOrTypeVarType(argType) || argType->hasError())
return false;

// Record substituation from generic parameter to the argument type.
// Record substitution from generic parameter to the argument type.
substitutions[env->mapTypeOutOfContext(archetype)
->getCanonicalType()
->castTo<SubstitutableType>()] = argType;
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/CSSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
// Subtype constraints are subject for edge contraction,
// which is inappropriate in this case, because it's going to
// erase/lose 'inout' modifier after merging equivalence classes
// (if inout containts type var, see ConstraintGraph::contractEdges()),
// (if inout constraints type var, see ConstraintGraph::contractEdges()),
// since right-hand side type variable must not be materializable
// it can simply get left-hand side as a fixed binding, otherwise fail.
if (type1->is<InOutType>() &&
Expand All @@ -1490,7 +1490,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
if (typeVar2->getImpl().mustBeMaterializable())
return SolutionKind::Error;

// Constriants like `inout T0 subtype T1` where (T0 must be
// Constraints like `inout T0 subtype T1` where (T0 must be
// materializable) are created when closures are part of the generic
// function parameters e.g. `func foo<T>(_ t: T, (inout T) -> Void) {}`
// so when such function gets called e.g.
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/CSSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ ConstraintSystem::solveSingle(FreeTypeVariableBinding allowFreeTypeVariables) {
bool ConstraintSystem::Candidate::solve() {
// Don't attempt to solve candidate if there is closure
// expression involved, because it's handled specially
// by parent constaint system (e.g. parameter lists).
// by parent constraint system (e.g. parameter lists).
bool containsClosure = false;
E->forEachChildExpr([&](Expr *childExpr) -> Expr * {
if (isa<ClosureExpr>(childExpr)) {
Expand Down Expand Up @@ -1616,7 +1616,7 @@ void ConstraintSystem::shrink(Expr *expr) {
}

// Let's not attempt to type-check closures or expressions
// which containt closures, because they require special handling
// which constrain closures, because they require special handling
// when dealing with context and parameters declarations.
if (isa<ClosureExpr>(expr)) {
return {false, expr};
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/ConstraintSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -866,11 +866,11 @@ class ConstraintSystem {
unsigned TypeCounter = 0;

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

/// \brief Cached member lookups.
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class GenericRequirementsCheckListener {
/// \param first The left-hand side type assigned to the requirement,
/// possibly represented by its generic substitute.
///
/// \param second The right-hand side type assinged to the requirement,
/// \param second The right-hand side type assigned to the requirement,
/// possibly represented by its generic substitute.
///
///
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/SDK/Foundation/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -973,10 +973,10 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
}
}

/// Initialze a `Data` with a repeating byte pattern
/// Initialize a `Data` with a repeating byte pattern
///
/// - parameter repeatedValue: A byte to initialze the pattern
/// - parameter count: The number of bytes the data initially contains initialzed to the repeatedValue
/// - parameter repeatedValue: A byte to initialize the pattern
/// - parameter count: The number of bytes the data initially contains initialized to the repeatedValue
public init(repeating repeatedValue: UInt8, count: Int) {
self.init(count: count)
withUnsafeMutableBytes { (bytes: UnsafeMutablePointer<UInt8>) -> Void in
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/SDK/XCTest/XCTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ public func XCTAssertEqual<T : Equatable>(_ expression1: @autoclosure () throws
let expressionValueStr1 = String(describing: expressionValue1Optional)
let expressionValueStr2 = String(describing: expressionValue2Optional)

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

Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if(SWIFT_BUILD_STATIC_STDLIB AND "${sdk}" STREQUAL "LINUX")
set(static_binary_lnk_file_list)
string(TOLOWER "${sdk}" lowercase_sdk)

# These two libaries are only used with the static swiftcore
# These two libraries are only used with the static swiftcore
add_library(swiftImageInspectionStatic STATIC
ImageInspectionStatic.cpp
StaticBinaryELF.cpp)
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/runtime/StaticBinaryELF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ typedef Elf64_Shdr Elf_Shdr;
typedef Elf64_Phdr Elf_Phdr;
typedef Elf64_Addr Elf_Addr;
typedef Elf64_Word Elf_Word;
typedef Elf64_Sym Elf_Sym;
typedef Elf64_Sym Elf_Sym;
typedef Elf64_Section Elf_Section;
#define ELF_ST_TYPE(x) ELF64_ST_TYPE(x)
#else
Expand All @@ -54,7 +54,7 @@ typedef Elf32_Shdr Elf_Shdr;
typedef Elf32_Phdr Elf_Phdr;
typedef Elf32_Addr Elf_Addr;
typedef Elf32_Word Elf_Word;
typedef Elf32_Sym Elf_Sym;
typedef Elf32_Sym Elf_Sym;
typedef Elf32_Section Elf_Section;
#define ELF_ST_TYPE(x) ELF32_ST_TYPE(x)
#endif
Expand Down Expand Up @@ -186,7 +186,7 @@ class StaticBinaryELF {
// This is Linux specific - find the full path of the executable
// by looking in /proc/self/maps for a mapping holding the current
// address space. For a static binary it should only be mapping one
// file anyway. Dont use /proc/self/exe as the symlink will be removed
// file anyway. Don't use /proc/self/exe as the symlink will be removed
// if the main thread terminates - see proc(5).
void getExecutablePathName() {
uintptr_t address = (uintptr_t)&elfHeader;
Expand Down
24 changes: 12 additions & 12 deletions test/Compatibility/bridging-nsnumber-and-nsvalue.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -91,33 +91,33 @@ func bridgeNSNumberBackToSpecificType(object: ${ObjectType},
_ = dictKeys as? [${Type}: AnyObject]
_ = dictKeys as! [${Type}: AnyObject]

_ = dictValues as [AnyHashable: ${Type}] // expected-warning{{use 'as!'}}
_ = dictValues is [AnyHashable: ${Type}]
_ = dictValues as [AnyHashable: ${Type}] // expected-warning{{use 'as!'}}
_ = dictValues is [AnyHashable: ${Type}]
_ = dictValues as? [AnyHashable: ${Type}]
_ = dictValues as! [AnyHashable: ${Type}]

_ = dictValues as [NSObject: ${Type}] // expected-warning{{use 'as!'}}
_ = dictValues is [NSObject: ${Type}]
_ = dictValues as [NSObject: ${Type}] // expected-warning{{use 'as!'}}
_ = dictValues is [NSObject: ${Type}]
_ = dictValues as? [NSObject: ${Type}]
_ = dictValues as! [NSObject: ${Type}]

_ = dictBoth as [${ObjectType}: ${Type}] // expected-warning{{use 'as!'}}
_ = dictBoth is [${ObjectType}: ${Type}]
_ = dictBoth as [${ObjectType}: ${Type}] // expected-warning{{use 'as!'}}
_ = dictBoth is [${ObjectType}: ${Type}]
_ = dictBoth as? [${ObjectType}: ${Type}]
_ = dictBoth as! [${ObjectType}: ${Type}]

_ = dictBoth as [${Type}: ${ObjectType}] // expected-warning{{use 'as!'}}
_ = dictBoth is [${Type}: ${ObjectType}]
_ = dictBoth as [${Type}: ${ObjectType}] // expected-warning{{use 'as!'}}
_ = dictBoth is [${Type}: ${ObjectType}]
_ = dictBoth as? [${Type}: ${ObjectType}]
_ = dictBoth as! [${Type}: ${ObjectType}]

_ = dictBoth as [${Type}: ${Type}] // expected-warning{{use 'as!'}}
_ = dictBoth is [${Type}: ${Type}]
_ = dictBoth as [${Type}: ${Type}] // expected-warning{{use 'as!'}}
_ = dictBoth is [${Type}: ${Type}]
_ = dictBoth as? [${Type}: ${Type}]
_ = dictBoth as! [${Type}: ${Type}]

_ = set as Set<${Type}> // expected-warning{{use 'as!'}}
_ = set is Set<${Type}>
_ = set as Set<${Type}> // expected-warning{{use 'as!'}}
_ = set is Set<${Type}>
_ = set as? Set<${Type}>
_ = set as! Set<${Type}>
% end
Expand Down
8 changes: 4 additions & 4 deletions utils/line-directive
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ def run():
sources = sys.argv[1:dashes]

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

Expand Down