Skip to content

Commit 4998c1e

Browse files
committed
Rename ConstrainedSugarType to SomeOrAnyType to match new SwiftSyntax API (we can still do this because we're not stable yet)
1 parent 5411c55 commit 4998c1e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Sources/MacroToolkit/Documentation.docc/MacroToolkit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ written it as `(((((((Void)))))))` (which is a valid way to write `Void`).
9494
- ``PackExpansionType``
9595
- ``PackReferenceType``
9696
- ``ClassRestrictionType``
97-
- ``ConstrainedSugarType``
97+
- ``SomeOrAnyType``
9898
- ``ImplicitlyUnwrappedOptionalType``
9999

100100
### Diagnostics

Sources/MacroToolkit/ConstrainedSugarType.swift renamed to Sources/MacroToolkit/SomeOrAnyType.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import SwiftSyntax
22

3-
/// Wraps a constrained sugar type (i.e. `any Protocol` or `some Protocol`).
4-
public struct ConstrainedSugarType: TypeProtocol {
3+
/// Wraps a `some` or `any` type (i.e. `any Protocol` or `some Protocol`).
4+
public struct SomeOrAnyType: TypeProtocol {
55
public var _baseSyntax: SomeOrAnyTypeSyntax
66
public var _attributedSyntax: AttributedTypeSyntax?
77

Sources/MacroToolkit/Type.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ public enum Type: TypeProtocol, SyntaxExpressibleByStringInterpolation {
1111
/// A composition of two types (e.g. `Encodable & Decodable`). Used to
1212
/// combine protocol requirements.
1313
case composition(CompositionType)
14-
/// A sugared protocl type (e.g. `any T` or `some T`).
15-
case constrainedSugar(ConstrainedSugarType)
14+
/// A some or any protocol type (e.g. `any T` or `some T`).
15+
case someOrAny(SomeOrAnyType)
1616
/// A dictionary type (e.g. `[Int: String]`).
1717
case dictionary(DictionaryType)
1818
/// A function type (e.g. `() -> ()`).
@@ -43,7 +43,7 @@ public enum Type: TypeProtocol, SyntaxExpressibleByStringInterpolation {
4343
case .array(let type): type
4444
case .classRestriction(let type): type
4545
case .composition(let type): type
46-
case .constrainedSugar(let type): type
46+
case .someOrAny(let type): type
4747
case .dictionary(let type): type
4848
case .function(let type): type
4949
case .implicitlyUnwrappedOptional(let type): type
@@ -65,7 +65,7 @@ public enum Type: TypeProtocol, SyntaxExpressibleByStringInterpolation {
6565
case .array(let type): type
6666
case .classRestriction(let type): type
6767
case .composition(let type): type
68-
case .constrainedSugar(let type): type
68+
case .someOrAny(let type): type
6969
case .dictionary(let type): type
7070
case .function(let type): type
7171
case .implicitlyUnwrappedOptional(let type): type
@@ -96,8 +96,8 @@ public enum Type: TypeProtocol, SyntaxExpressibleByStringInterpolation {
9696
self = .classRestriction(type)
9797
} else if let type = CompositionType(syntax) {
9898
self = .composition(type)
99-
} else if let type = ConstrainedSugarType(syntax) {
100-
self = .constrainedSugar(type)
99+
} else if let type = SomeOrAnyType(syntax) {
100+
self = .someOrAny(type)
101101
} else if let type = DictionaryType(syntax) {
102102
self = .dictionary(type)
103103
} else if let type = FunctionType(syntax) {

0 commit comments

Comments
 (0)