Skip to content

Commit 25d15b7

Browse files
authored
[SE-0402] Fix some typos (#2101)
1 parent 317e57b commit 25d15b7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

proposals/0402-extension-macros.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ SE-0389 states that whenever a macro produces declarations that are visible to o
7474

7575
The following restrictions apply to generated conformances and names listed in `@attached(extension)`:
7676

77-
* An extension macro cannot add a conformance to a protocol that is not covered by the `conformances:` list in `@attached(extension, conformnaces:)`.
77+
* An extension macro cannot add a conformance to a protocol that is not covered by the `conformances:` list in `@attached(extension, conformances:)`.
7878
* An extension macro cannot add a member that is not covered by the `names:` list in `@attached(extension, names:)`.
7979
* An extension macro cannot introduce an extension with an attached `peer` macro, because the peer-macro-generated names are not covered by the original `@attached(extension)` attribute.
8080

@@ -136,7 +136,7 @@ public protocol ExtensionMacro: AttachedMacro {
136136
/// to.
137137
/// - context: The context in which to perform the macro expansion.
138138
///
139-
/// - Returns: the set of extensions declarations introduced by the macro,
139+
/// - Returns: the set of extension declarations introduced by the macro,
140140
/// which are always inserted at top-level scope. Each extension must extend
141141
/// the `type` parameter.
142142
static func expansion(
@@ -170,7 +170,7 @@ For example, consider the following code which contains an attached extension ma
170170
protocol Encodable {}
171171
protocol Decodable {}
172172

173-
typelias Codable = Encodable & Decodable
173+
typealias Codable = Encodable & Decodable
174174

175175
@attached(extension, conformances: Codable)
176176
macro MyMacro() = #externalMacro(...)
@@ -181,11 +181,11 @@ struct S { ... }
181181
extension S: Encodable { ... }
182182
```
183183

184-
The extension macro can add conformances to `Codable`, aka `Encodable & Decodable`. Because the struct `S` already conforms to `Encodable` in the original source, the `ExtensionMacro.expansion` method will recieve the argument `[TypeSyntax(Encodable)]` for the `conformingTo:` parameter. Using this information, the macro implementation can decide to only add an extension with a conformance to `Decodable`.
184+
The extension macro can add conformances to `Codable`, aka `Encodable & Decodable`. Because the struct `S` already conforms to `Encodable` in the original source, the `ExtensionMacro.expansion` method will receive the argument `[TypeSyntax(Encodable)]` for the `conformingTo:` parameter. Using this information, the macro implementation can decide to only add an extension with a conformance to `Decodable`.
185185

186186
## Source compatibility
187187

188-
This propsoal removes the `conformance` macro role from SE-0389, which is accepted and implemented in Swift 5.9. If this proposal is accepted after 5.9, the `conformance` macro role will remain in the language as sugar for an `extension` macro that adds only a conformance.
188+
This proposal removes the `conformance` macro role from SE-0389, which is accepted and implemented in Swift 5.9. If this proposal is accepted after 5.9, the `conformance` macro role will remain in the language as sugar for an `extension` macro that adds only a conformance.
189189

190190
## ABI compatibility
191191

0 commit comments

Comments
 (0)