diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index b0a0ab2f284..69a013ae046 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,5 +1,5 @@ # Code of Conduct -The code of conduct for this project can be found at https://swift.org/code-of-conduct. +The code of conduct for this project can be found at https://swift.org/code-of-conduct/. diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift index 4fd26affd3e..8421f4ffa95 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift @@ -56,7 +56,7 @@ let computeSideEffects = FunctionPass(name: "compute-side-effects") { // global effects to the argument, because we don't know to which "global" side-effect // instruction the argument might have escaped. for argument in function.arguments { - collectedEffects.addEffectsForEcapingArgument(argument: argument) + collectedEffects.addEffectsForEscapingArgument(argument: argument) } // Don't modify the effects if they didn't change. This avoids sending a change notification @@ -214,7 +214,7 @@ private struct CollectedEffects { } } - mutating func addEffectsForEcapingArgument(argument: FunctionArgument) { + mutating func addEffectsForEscapingArgument(argument: FunctionArgument) { var escapeWalker = ArgumentEscapingWalker() if escapeWalker.hasUnknownUses(argument: argument) { diff --git a/SwiftCompilerSources/Sources/Optimizer/ModulePasses/MandatoryPerformanceOptimizations.swift b/SwiftCompilerSources/Sources/Optimizer/ModulePasses/MandatoryPerformanceOptimizations.swift index a08f0cea0fb..c0c7f3cd576 100644 --- a/SwiftCompilerSources/Sources/Optimizer/ModulePasses/MandatoryPerformanceOptimizations.swift +++ b/SwiftCompilerSources/Sources/Optimizer/ModulePasses/MandatoryPerformanceOptimizations.swift @@ -95,7 +95,7 @@ private func inlineAndDevirtualize(apply: FullApplySite, alreadyInlinedFunctions } if !context.loadFunction(function: callee, loadCalleesRecursively: true) { - // We don't have the funcion body of the callee. + // We don't have the function body of the callee. return } diff --git a/benchmark/single-source/AngryPhonebook.swift b/benchmark/single-source/AngryPhonebook.swift index f14114c8c0e..fb535bc3988 100644 --- a/benchmark/single-source/AngryPhonebook.swift +++ b/benchmark/single-source/AngryPhonebook.swift @@ -91,7 +91,7 @@ public func run_AngryPhonebook(_ n: Int) { // To keep the performance of various scripts roughly comparable, aim for // a total length of approximately 120 characters. // E.g.: `ascii.joined(separator: "").count == 124` -// Every name should fit in 15-bytes UTF-8 encoded, to excercise the small +// Every name should fit in 15-bytes UTF-8 encoded, to exercise the small // string optimization. // E.g.: `armenian.allSatisfy { $0._guts.isSmall } == true` diff --git a/docs/CppInteroperability/UserGuide-CallingSwiftFromC++.md b/docs/CppInteroperability/UserGuide-CallingSwiftFromC++.md index d5ae70bd183..b29b0d2519b 100644 --- a/docs/CppInteroperability/UserGuide-CallingSwiftFromC++.md +++ b/docs/CppInteroperability/UserGuide-CallingSwiftFromC++.md @@ -593,7 +593,7 @@ enum value will abort the program. ### Resilient Enums A resilient Swift enumeration value could represent a case that's unknown to the client. -Swift forces the client to check if the value is `@uknown default` when switching over +Swift forces the client to check if the value is `@unknown default` when switching over the enumeration to account for that. C++ follows a similar principle, by exposing an `unknownDefault` case that can then be matched in a switch. diff --git a/lib/Macros/Sources/ObservationMacros/ObservableMacro.swift b/lib/Macros/Sources/ObservationMacros/ObservableMacro.swift index b8b8c6e65e0..3be52221092 100644 --- a/lib/Macros/Sources/ObservationMacros/ObservableMacro.swift +++ b/lib/Macros/Sources/ObservationMacros/ObservableMacro.swift @@ -243,7 +243,7 @@ extension ObservableMacro: MemberAttributeMacro { return [] } - // dont apply to ignored properties or properties that are already flaged as tracked + // dont apply to ignored properties or properties that are already flagged as tracked if property.hasMacroApplication(ObservableMacro.ignoredMacroName) || property.hasMacroApplication(ObservableMacro.trackedMacroName) { return [] diff --git a/lib/Refactoring/Refactoring.cpp b/lib/Refactoring/Refactoring.cpp index 7a116e688fa..bcf4d4f7c16 100644 --- a/lib/Refactoring/Refactoring.cpp +++ b/lib/Refactoring/Refactoring.cpp @@ -1403,7 +1403,7 @@ bool RefactoringActionExtractFunction::performChange() { // Correct the given name if collision happens. PreferredName = correctNewDeclName(InsertToDC, PreferredName); - // Collect the paramters to pass down to the new function. + // Collect the parameters to pass down to the new function. std::vector Parameters; for (auto &RD: RangeInfo.ReferencedDecls) { // If the referenced decl is declared elsewhere, no need to pass as parameter diff --git a/lib/SILGen/SILGenApply.cpp b/lib/SILGen/SILGenApply.cpp index f5add11f01d..a091eb4efe6 100644 --- a/lib/SILGen/SILGenApply.cpp +++ b/lib/SILGen/SILGenApply.cpp @@ -3381,7 +3381,7 @@ private: loweredSubstParamType, origParamType, paramSlice)) return; - // If we have a guaranteed paramter, see if we have a move only type and + // If we have a guaranteed parameter, see if we have a move only type and // can emit it borrow. // // We check for move only in tryEmitBorrowedMoveOnly. diff --git a/lib/SILGen/SILGenProlog.cpp b/lib/SILGen/SILGenProlog.cpp index 10b52baac53..d0649e3c3d1 100644 --- a/lib/SILGen/SILGenProlog.cpp +++ b/lib/SILGen/SILGenProlog.cpp @@ -1161,7 +1161,7 @@ static void emitCaptureArguments(SILGenFunction &SGF, fArg->setClosureCapture(true); arg = SILValue(fArg); - // If we have an inout noncopyable paramter, insert a consumable and + // If we have an inout noncopyable parameter, insert a consumable and // assignable. // // NOTE: If we have an escaping closure, we are going to emit an error later diff --git a/lib/SILOptimizer/Mandatory/AddressLowering.h b/lib/SILOptimizer/Mandatory/AddressLowering.h index 25d2ca2a30e..60522377f59 100644 --- a/lib/SILOptimizer/Mandatory/AddressLowering.h +++ b/lib/SILOptimizer/Mandatory/AddressLowering.h @@ -117,7 +117,7 @@ namespace swift { /// %d_0 -def-> ... -def-> %d_N -use-> %u_0 -use-> ... -use-> %u_M /// /// a sequence (possibly empty) of def projections followed by a sequence -/// (possibly emtpy) of use projections [projection_chain_structure]. +/// (possibly empty) of use projections [projection_chain_structure]. struct ValueStorage { enum : uint32_t { InvalidID = uint32_t(~0) }; enum : uint16_t { InvalidOper = uint16_t(~0) }; diff --git a/lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp b/lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp index b45a39a550f..70a1a40628a 100644 --- a/lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp +++ b/lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp @@ -267,7 +267,7 @@ bool PerformanceDiagnostics::checkClosureValue(SILValue closure, return false; } else { PrettyStackTracePerformanceDiagnostics stackTrace( - "validating closure (function ref, callee) - unkown callee", callInst); + "validating closure (function ref, callee) - unknown callee", callInst); diagnose(LocWithParent(callInst->getLoc().getSourceLoc(), parentLoc), diag::performance_unknown_callees); return true; @@ -410,7 +410,7 @@ bool PerformanceDiagnostics::visitInst(SILInstruction *inst, } // The default error message. PrettyStackTracePerformanceDiagnostics stackTrace( - "default error (fallthrough, unkown inst)", inst); + "default error (fallthrough, unknown inst)", inst); diagnose(loc, diag::performance_metadata, "this code pattern"); break; } diff --git a/stdlib/public/core/UnsafeBufferPointerSlice.swift b/stdlib/public/core/UnsafeBufferPointerSlice.swift index 70b7c172376..1056a395792 100644 --- a/stdlib/public/core/UnsafeBufferPointerSlice.swift +++ b/stdlib/public/core/UnsafeBufferPointerSlice.swift @@ -70,7 +70,7 @@ extension Slice where Base == UnsafeMutableRawBufferPointer { /// initialized memory to the elements' type. /// /// When calling the `initializeMemory(as:from:)` method on a buffer slice, - /// the memory referenced by the slice must be uninitialized or initialised + /// the memory referenced by the slice must be uninitialized or initialized /// to a trivial type, and must be properly aligned for accessing `S.Element`. /// The buffer must contain sufficient memory to accommodate /// `source.underestimatedCount`. diff --git a/test/ClangImporter/incomplete_objc_types_availability.swift b/test/ClangImporter/incomplete_objc_types_availability.swift index 4b418f00798..fc7707eb913 100644 --- a/test/ClangImporter/incomplete_objc_types_availability.swift +++ b/test/ClangImporter/incomplete_objc_types_availability.swift @@ -28,7 +28,7 @@ CFunctionTakingAForwardDeclaredInterface1(incompleteInterface) let incompleteProtocol = incompleteTypeConsumer.methodReturningForwardDeclaredProtocol1()! incompleteTypeConsumer.methodTakingAForwardDeclaredProtocol1(incompleteProtocol) -let protcolPropertyCopy = incompleteTypeConsumer.propertyUsingAForwardDeclaredProtocol1 +let protocolPropertyCopy = incompleteTypeConsumer.propertyUsingAForwardDeclaredProtocol1 incompleteTypeConsumer.propertyUsingAForwardDeclaredProtocol1 = incompleteProtocol _ = CFunctionReturningAForwardDeclaredProtocol1() CFunctionTakingAForwardDeclaredProtocol1(incompleteProtocol) diff --git a/test/Constraints/pack-expansion-expressions.swift b/test/Constraints/pack-expansion-expressions.swift index f0c490bca46..f3c49615aeb 100644 --- a/test/Constraints/pack-expansion-expressions.swift +++ b/test/Constraints/pack-expansion-expressions.swift @@ -443,7 +443,7 @@ func test_no_unused_result_warning(arr: inout [Any]) { } } -func test_partually_flattened_expansions() { +func test_partially_flattened_expansions() { struct S { init() {} diff --git a/test/Driver/baremetal-target.swift b/test/Driver/baremetal-target.swift index 25f292954a1..91b2a006fab 100644 --- a/test/Driver/baremetal-target.swift +++ b/test/Driver/baremetal-target.swift @@ -1,4 +1,4 @@ -// RUN: %swiftc_driver_plain -target aarch64-unknwon-none-none -driver-print-jobs %s 2>&1 | %FileCheck %s +// RUN: %swiftc_driver_plain -target aarch64-unknown-none-none -driver-print-jobs %s 2>&1 | %FileCheck %s // CHECK: {{.*}}swift{{c|-frontend}}{{(.exe)?"?}} -frontend -c // CHECK: {{.*}}clang{{(.exe)?"?}} -fuse-ld=gold diff --git a/test/IDE/coloring.swift b/test/IDE/coloring.swift index a4c8475b2a1..06841ff70ac 100644 --- a/test/IDE/coloring.swift +++ b/test/IDE/coloring.swift @@ -485,8 +485,8 @@ func foo() -> some P {} // CHECK: func foo() -> some P & Q {} func foo() -> some P & Q {} -// CHECK: class PropertyDelgate { -class PropertyDelgate { +// CHECK: class PropertyDelegate { +class PropertyDelegate { // CHECK: @MyDelegate(1, receiveClosure { @MyDelegate(1, receiveClosure { // CHECK: var x = 1; x diff --git a/test/IDE/print_ast_tc_decls.swift b/test/IDE/print_ast_tc_decls.swift index 3250088c54c..a80e3ab0200 100644 --- a/test/IDE/print_ast_tc_decls.swift +++ b/test/IDE/print_ast_tc_decls.swift @@ -1364,7 +1364,7 @@ public func ParamAttrs5(a : (@escaping () -> ()) -> ()) { // PASS_PRINT_AST: public typealias ParamAttrs6 = (@autoclosure () -> ()) -> () public typealias ParamAttrs6 = (@autoclosure () -> ()) -> () -// The following type only has the internal paramter name inferred from the +// The following type only has the internal parameter name inferred from the // closure on the right-hand side of `=`. Thus, it is only part of the `Type` // and not part of the `TypeRepr`. // PASS_PRINT_AST_TYPE: public var ParamAttrs7: (_ f: @escaping () -> ()) -> () diff --git a/test/Index/index_generic_params.swift b/test/Index/index_generic_params.swift index eb8c757e79a..f7ef24acd39 100644 --- a/test/Index/index_generic_params.swift +++ b/test/Index/index_generic_params.swift @@ -9,7 +9,7 @@ protocol P1 { // CHECK: [[@LINE+1]]:10 | protocol/Swift | P2 | s:14swift_ide_test2P2P | Def | protocol P2 {} -// MARK: - Test extening a simple generic type +// MARK: - Test extending a simple generic type // CHECK: [[@LINE+4]]:7 | class/Swift | Foo | s:14swift_ide_test3FooC | Def | // CHECK: [[@LINE+3]]:11 | type-alias/generic-type-param/Swift | OtherParam | s:14swift_ide_test3FooC10OtherParamxmfp | Def,RelChild | @@ -63,7 +63,7 @@ extension Wrapper.Wrapped where WrapperParam: P2 { func bar(x: Bar.Assoc) {} } -// MARK: - Test extening a non-generic type in a generic context +// MARK: - Test extending a non-generic type in a generic context // CHECK: [[@LINE+1]]:16 | type-alias/generic-type-param/Swift | Wrapper2Param | s:14swift_ide_test8Wrapper2C0D5Paramxmfp | Def,RelChild | class Wrapper2 { diff --git a/test/Sema/availability_unavailable_overrides.swift b/test/Sema/availability_unavailable_overrides.swift index 9b72fe77ca3..50e1365d26e 100644 --- a/test/Sema/availability_unavailable_overrides.swift +++ b/test/Sema/availability_unavailable_overrides.swift @@ -243,7 +243,7 @@ func testOverrideOfUnavailableDeclFromUnavailableDerivedType() { func testImplicitSuperInit() { // FIXME: The diagnostics for the implicit call to super.init() could be - // relaxed since both initialziers are unreachable and the developer cannot + // relaxed since both initializers are unreachable and the developer cannot // wrap the call to super in a conditional compilation block. class Base { @available(*, unavailable) diff --git a/test/decl/var/variables.swift b/test/decl/var/variables.swift index 8a780b1766e..fb6d591b173 100644 --- a/test/decl/var/variables.swift +++ b/test/decl/var/variables.swift @@ -51,7 +51,7 @@ struct Broken { var emptyTuple = testShadowing() // expected-warning {{variable 'emptyTuple' inferred to have type '()'}} \ // expected-note {{add an explicit type annotation to silence this warning}} {{15-15=: ()}} -// rdar://15263687 - Diagnose variables inferenced to 'AnyObject' +// rdar://15263687 - Diagnose variables inferred to 'AnyObject' var ao1 : AnyObject var ao2 = ao1 diff --git a/test/expr/unary/switch_expr.swift b/test/expr/unary/switch_expr.swift index 88c11409588..3aa4d9e6e4d 100644 --- a/test/expr/unary/switch_expr.swift +++ b/test/expr/unary/switch_expr.swift @@ -530,7 +530,7 @@ do { }, 0) // expected-error {{expected '{' after 'switch' subject expression}} } -// These are syntatically okay because the #if starts on a newline. This seems +// These are syntactically okay because the #if starts on a newline. This seems // like the common case. _ = (switch Bool.random() { // expected-error@-1 {{'switch' may only be used as expression in return, throw, or as the source of an assignment}}