Skip to content

Commit 407fba8

Browse files
committed
[NFC] MoveChecker: Simplified constructors.
1 parent 6e1410d commit 407fba8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyTypeUtils.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,12 @@ inline Feature partialMutationFeature(PartialMutation::Kind kind) {
141141
///
142142
/// Emulates the following enum with associated value:
143143
///
144-
/// enum class PartialMutationError {
145-
/// case featureDisabled(SILType)
146-
/// case hasDeinit(SILType, NominalTypeDecl)
144+
/// struct PartialMutationError {
145+
/// let type: SILType
146+
/// enum Kind {
147+
/// case featureDisabled
148+
/// case hasDeinit(NominalTypeDecl)
149+
/// }
147150
/// }
148151
class PartialMutationError {
149152
struct FeatureDisabled {
@@ -154,9 +157,8 @@ class PartialMutationError {
154157
};
155158
TaggedUnion<FeatureDisabled, HasDeinit> kind;
156159

157-
PartialMutationError(SILType type, FeatureDisabled fd)
158-
: kind({fd}), type(type) {}
159-
PartialMutationError(SILType type, HasDeinit r) : kind({r}), type(type) {}
160+
PartialMutationError(SILType type, Payload payload)
161+
: payload(payload), type(type) {}
160162

161163
public:
162164
/// The type within the aggregate responsible for the error.

0 commit comments

Comments
 (0)