-
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 variance on generic interface unions
=> release
- Loading branch information
Showing
17 changed files
with
205 additions
and
64 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
.../Sundew.DiscriminatedUnions.Api.Generator/Sundew.DiscriminatedUnions.Api.Generator.csproj
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
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
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
36 changes: 36 additions & 0 deletions
36
...Sundew.DiscriminatedUnions.Tester.IGenericOutParameterExtensions{T}.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,36 @@ | ||
//HintName: Sundew.DiscriminatedUnions.Tester.IGenericOutParameterExtensions{T}.generated.cs | ||
#nullable enable | ||
|
||
namespace Sundew.DiscriminatedUnions.Tester | ||
{ | ||
/// <summary> | ||
/// Segregation extension method for IGenericOutParameter. | ||
/// </summary> | ||
[global::System.Diagnostics.DebuggerNonUserCode] | ||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Sundew.DiscriminateUnions.Generator", "5.3.0.0")] | ||
public static partial class IGenericOutParameterExtensions | ||
{ | ||
/// <summary> | ||
/// Segregates the items in the specified enumerable by type. | ||
/// </summary> | ||
/// <param name="iGenericOutParameters">The iGenericOutParameters.</param> | ||
/// <returns>A new IGenericOutParameterSegregation.</returns> | ||
public static IGenericOutParameterSegregation<T> Segregate<T>(this System.Collections.Generic.IEnumerable<global::Sundew.DiscriminatedUnions.Tester.IGenericOutParameter<T>> iGenericOutParameters) | ||
where T : notnull | ||
{ | ||
var genericOutParameters = new System.Collections.Generic.List<global::Sundew.DiscriminatedUnions.Tester.GenericOutParameter<T>>(); | ||
|
||
foreach (var value in iGenericOutParameters) | ||
{ | ||
switch (value) | ||
{ | ||
case global::Sundew.DiscriminatedUnions.Tester.GenericOutParameter<T> genericOutParameter: | ||
genericOutParameters.Add(genericOutParameter); | ||
break; | ||
} | ||
} | ||
|
||
return new global::Sundew.DiscriminatedUnions.Tester.IGenericOutParameterSegregation<T>(genericOutParameters); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...undew.DiscriminatedUnions.Tester.IGenericOutParameterSegregation{T}.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,25 @@ | ||
//HintName: Sundew.DiscriminatedUnions.Tester.IGenericOutParameterSegregation{T}.generated.cs | ||
#nullable enable | ||
|
||
namespace Sundew.DiscriminatedUnions.Tester | ||
{ | ||
/// <summary> | ||
/// Contains individual lists of the different cases of the discriminated union IGenericOutParameter. | ||
/// </summary> | ||
[global::System.Diagnostics.DebuggerNonUserCode] | ||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Sundew.DiscriminateUnions.Generator", "5.3.0.0")] | ||
public sealed partial class IGenericOutParameterSegregation<T> | ||
where T : notnull | ||
{ | ||
internal IGenericOutParameterSegregation(System.Collections.Generic.IReadOnlyList<global::Sundew.DiscriminatedUnions.Tester.GenericOutParameter<T>> genericOutParameters) | ||
{ | ||
this.GenericOutParameters = genericOutParameters; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the GenericOutParameters. | ||
/// </summary> | ||
/// <returns>The GenericOutParameters.</returns> | ||
public System.Collections.Generic.IReadOnlyList<global::Sundew.DiscriminatedUnions.Tester.GenericOutParameter<T>> GenericOutParameters { get; } | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...edSources#Sundew.DiscriminatedUnions.Tester.IGenericOutParameter{T}.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,22 @@ | ||
//HintName: Sundew.DiscriminatedUnions.Tester.IGenericOutParameter{T}.generated.cs | ||
#nullable enable | ||
|
||
namespace Sundew.DiscriminatedUnions.Tester | ||
{ | ||
#pragma warning disable SA1601 | ||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Sundew.DiscriminateUnions.Generator", "5.3.0.0")] | ||
public partial interface IGenericOutParameter<out T> | ||
where T : notnull | ||
#pragma warning restore SA1601 | ||
{ | ||
/// <summary> | ||
/// Factory method for the GenericOutParameter case. | ||
/// </summary> | ||
/// <param name="value">The value.</param> | ||
/// <returns>A new GenericOutParameter.</returns> | ||
[Sundew.DiscriminatedUnions.CaseType(typeof(global::Sundew.DiscriminatedUnions.Tester.GenericOutParameter<>))] | ||
[global::System.Diagnostics.DebuggerNonUserCode] | ||
public static global::Sundew.DiscriminatedUnions.Tester.IGenericOutParameter<T> GenericOutParameter(T value) | ||
=> new global::Sundew.DiscriminatedUnions.Tester.GenericOutParameter<T>(value); | ||
} | ||
} |
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
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
Oops, something went wrong.