Fix some typos in the codebase

This commit is contained in:
Manu
2023-08-31 18:44:38 -03:00
parent 16d7ba054b
commit 02b5fa2c8e
21 changed files with 25 additions and 25 deletions

View File

@@ -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/.
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->

View File

@@ -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) {

View File

@@ -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
}

View File

@@ -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`

View File

@@ -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.

View File

@@ -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 []

View File

@@ -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<ReferencedDecl> Parameters;
for (auto &RD: RangeInfo.ReferencedDecls) {
// If the referenced decl is declared elsewhere, no need to pass as parameter

View File

@@ -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.

View File

@@ -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

View File

@@ -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) };

View File

@@ -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;
}

View File

@@ -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`.

View File

@@ -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)

View File

@@ -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<each T> {
init() {}

View File

@@ -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

View File

@@ -485,8 +485,8 @@ func foo() -> some P {}
// CHECK: <kw>func</kw> foo() -> <kw>some</kw> <type>P</type> & <type>Q</type> {}
func foo() -> some P & Q {}
// CHECK: <kw>class</kw> PropertyDelgate {
class PropertyDelgate {
// CHECK: <kw>class</kw> PropertyDelegate {
class PropertyDelegate {
// CHECK: @<type>MyDelegate</type>(<int>1</int>, receiveClosure {
@MyDelegate(1, receiveClosure {
// CHECK: <kw>var</kw> x = <int>1</int>; x

View File

@@ -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 () -> ()) -> ()

View File

@@ -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<Wrapper2Param> {

View File

@@ -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)

View File

@@ -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

View File

@@ -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}}