-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed generating union factory methods for unions with a single type …
…parameter => release
- Loading branch information
Showing
6 changed files
with
56 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...Sources#Sundew.DiscriminatedUnions.Tester.NestedGenericUnion{TItem}.generated.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//HintName: Sundew.DiscriminatedUnions.Tester.NestedGenericUnion{TItem}.generated.cs | ||
#nullable enable | ||
|
||
namespace Sundew.DiscriminatedUnions.Tester | ||
{ | ||
#pragma warning disable SA1601 | ||
[global::System.Diagnostics.DebuggerNonUserCode] | ||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Sundew.DiscriminateUnions.Generator", "5.3.0.0")] | ||
public partial record NestedGenericUnion<TItem> | ||
#pragma warning restore SA1601 | ||
{ | ||
/// <summary> | ||
/// Factory method for the Target case. | ||
/// </summary> | ||
/// <param name="item">The item.</param> | ||
/// <returns>A new Target.</returns> | ||
[Sundew.DiscriminatedUnions.CaseType(typeof(global::Sundew.DiscriminatedUnions.Tester.NestedGenericUnion.Target<>))] | ||
public static global::Sundew.DiscriminatedUnions.Tester.NestedGenericUnion<TItem> _Target(TItem item) | ||
=> new global::Sundew.DiscriminatedUnions.Tester.NestedGenericUnion.Target<TItem>.Target(item); | ||
|
||
/// <summary> | ||
/// Factory method for the TargetList case. | ||
/// </summary> | ||
/// <param name="item">The item.</param> | ||
/// <returns>A new TargetList.</returns> | ||
[Sundew.DiscriminatedUnions.CaseType(typeof(global::Sundew.DiscriminatedUnions.Tester.NestedGenericUnion.TargetList<>))] | ||
public static global::Sundew.DiscriminatedUnions.Tester.NestedGenericUnion<TItem> _TargetList(global::System.Collections.Generic.List<TItem> item) | ||
=> new global::Sundew.DiscriminatedUnions.Tester.NestedGenericUnion.TargetList<TItem>.TargetList(item); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
Source/Sundew.DiscriminatedUnions.Tester/NestedGenericUnion.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Sundew.DiscriminatedUnions.Tester; | ||
|
||
using System.Collections.Generic; | ||
|
||
[Sundew.DiscriminatedUnions.DiscriminatedUnion] | ||
public abstract partial record NestedGenericUnion<TItem> | ||
{ | ||
public sealed record Target(TItem Item) : NestedGenericUnion<TItem>; | ||
|
||
public sealed record TargetList(List<TItem> Item) : NestedGenericUnion<TItem>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters