Skip to content

Commit

Permalink
Upper-Case first character of tuple names in return value of partitio…
Browse files Browse the repository at this point in the history
…n method
  • Loading branch information
Mafii committed Oct 1, 2024
1 parent 0f7730c commit 0f0fd7e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Funcky.DiscriminatedUnion.SourceGeneration/Emitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static void WriteTupleReturningPartitionExtension(DiscriminatedUnion dis
var namedResultPartitions = discriminatedUnion
.Variants
.JoinToInterpolation(
v => $"global::System.Collections.Generic.IReadOnlyList<{discriminatedUnion.Type.Identifier}.{v.LocalTypeName}> {v.ParameterName}",
v => $"global::System.Collections.Generic.IReadOnlyList<{discriminatedUnion.Type.Identifier}.{v.LocalTypeName}> {v.ParameterName[..1].ToUpper()}{v.ParameterName[1..]}",
", ");

writer.WriteLineInterpolated($"public static ({namedResultPartitions}) Partition(this global::System.Collections.Generic.IEnumerable<{discriminatedUnion.Type.Identifier}> source)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ partial record Integer
[global::System.CodeDom.Compiler.GeneratedCode("Funcky.DiscriminatedUnion.SourceGeneration", "1.2.0.0")]
public static partial class FlattenedNestedUnionWithPartitionEnumerableExtensions
{
public static (global::System.Collections.Generic.IReadOnlyList<FlattenedNestedUnionWithPartition.Keyword> keyword, global::System.Collections.Generic.IReadOnlyList<FlattenedNestedUnionWithPartition.Literal.Number.Integer> integer) Partition(this global::System.Collections.Generic.IEnumerable<FlattenedNestedUnionWithPartition> source)
public static (global::System.Collections.Generic.IReadOnlyList<FlattenedNestedUnionWithPartition.Keyword> Keyword, global::System.Collections.Generic.IReadOnlyList<FlattenedNestedUnionWithPartition.Literal.Number.Integer> Integer) Partition(this global::System.Collections.Generic.IEnumerable<FlattenedNestedUnionWithPartition> source)
{
var keywordItems = new global::System.Collections.Generic.List<FlattenedNestedUnionWithPartition.Keyword>();
var integerItems = new global::System.Collections.Generic.List<FlattenedNestedUnionWithPartition.Literal.Number.Integer>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ partial record Integer
[global::System.CodeDom.Compiler.GeneratedCode("Funcky.DiscriminatedUnion.SourceGeneration", "1.2.0.0")]
public static partial class FlattenedUnionWithPartitionEnumerableExtensions
{
public static (global::System.Collections.Generic.IReadOnlyList<FlattenedUnionWithPartition.Keyword> keyword, global::System.Collections.Generic.IReadOnlyList<FlattenedUnionWithPartition.Integer> integer) Partition(this global::System.Collections.Generic.IEnumerable<FlattenedUnionWithPartition> source)
public static (global::System.Collections.Generic.IReadOnlyList<FlattenedUnionWithPartition.Keyword> Keyword, global::System.Collections.Generic.IReadOnlyList<FlattenedUnionWithPartition.Integer> Integer) Partition(this global::System.Collections.Generic.IEnumerable<FlattenedUnionWithPartition> source)
{
var keywordItems = new global::System.Collections.Generic.List<FlattenedUnionWithPartition.Keyword>();
var integerItems = new global::System.Collections.Generic.List<FlattenedUnionWithPartition.Integer>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ partial record Error
[global::System.CodeDom.Compiler.GeneratedCode("Funcky.DiscriminatedUnion.SourceGeneration", "1.2.0.0")]
public static partial class UnionWithPartitionUsageEnumerableExtensions
{
public static (global::System.Collections.Generic.IReadOnlyList<UnionWithPartitionUsage.Success> success, global::System.Collections.Generic.IReadOnlyList<UnionWithPartitionUsage.Warning> warning, global::System.Collections.Generic.IReadOnlyList<UnionWithPartitionUsage.Error> error) Partition(this global::System.Collections.Generic.IEnumerable<UnionWithPartitionUsage> source)
public static (global::System.Collections.Generic.IReadOnlyList<UnionWithPartitionUsage.Success> Success, global::System.Collections.Generic.IReadOnlyList<UnionWithPartitionUsage.Warning> Warning, global::System.Collections.Generic.IReadOnlyList<UnionWithPartitionUsage.Error> Error) Partition(this global::System.Collections.Generic.IEnumerable<UnionWithPartitionUsage> source)
{
var successItems = new global::System.Collections.Generic.List<UnionWithPartitionUsage.Success>();
var warningItems = new global::System.Collections.Generic.List<UnionWithPartitionUsage.Warning>();
Expand Down

0 comments on commit 0f0fd7e

Please sign in to comment.