Skip to content

Commit

Permalink
Fixed Fusion composition of enums (#6069)
Browse files Browse the repository at this point in the history
  • Loading branch information
martindisch authored Apr 22, 2023
1 parent 6ee6c39 commit b8a604f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public ValueTask<MergeStatus> MergeAsync(
TypeGroup typeGroup,
CancellationToken cancellationToken)
{
// If any type in the group is not a union type, skip merging
if (typeGroup.Parts.Any(t => t.Type.Kind is not TypeKind.Union))
// If any type in the group is not an enum type, skip merging
if (typeGroup.Parts.Any(t => t.Type.Kind is not TypeKind.Enum))
{
return new(MergeStatus.Skipped);
}
Expand Down Expand Up @@ -56,7 +56,7 @@ private static void MergeType(
{
// If the target enum type doesn't have a value with the same name as the
// source value, create a new target value with the source value's name
targetValue = new EnumValue(source.Name);
targetValue = new EnumValue(sourceValue.Name);
target.Values.Add(targetValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public ValueTask<MergeStatus> MergeAsync(
TypeGroup typeGroup,
CancellationToken cancellationToken)
{
// If any type in the group is not a union type, skip merging
if (typeGroup.Parts.Any(t => t.Type.Kind is not TypeKind.Union))
{
return new(MergeStatus.Skipped);
Expand Down

0 comments on commit b8a604f

Please sign in to comment.