Skip to content

Commit 2a7f54b

Browse files
committed
"Lookups" can be readonly
1 parent 8f4e6d7 commit 2a7f54b

File tree

17 files changed

+17
-17
lines changed

17 files changed

+17
-17
lines changed

src/Thinktecture.Runtime.Extensions.SourceGenerator/CodeAnalysis/SmartEnums/SmartEnumCodeGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ void AddItem(").AppendTypeFullyQualified(_state).Append(@" item, string itemName
12191219
#endif
12201220
}
12211221
1222-
private record struct Lookups(
1222+
private readonly record struct Lookups(
12231223
global::System.Collections.Generic.IReadOnlyDictionary<").AppendTypeFullyQualified(keyMember).Append(", ").AppendTypeFullyQualified(_state).Append("> Lookup,");
12241224

12251225
if (keyMember.IsString())

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/Snapshots/EnumSourceGeneratorTests.Should_generate_advanced_string_based_validatable_class_0.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ void AddItem(global::Thinktecture.Tests.TestEnum item, string itemName)
738738
#endif
739739
}
740740

741-
private record struct Lookups(
741+
private readonly record struct Lookups(
742742
global::System.Collections.Generic.IReadOnlyDictionary<string, global::Thinktecture.Tests.TestEnum> Lookup,
743743
#if NET9_0_OR_GREATER
744744
global::System.Collections.Frozen.FrozenDictionary<string, global::Thinktecture.Tests.TestEnum>.AlternateLookup<global::System.ReadOnlySpan<char>> AlternateLookup,

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/Snapshots/EnumSourceGeneratorTests.Should_generate_class_with_abstract_property_0.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ void AddItem(global::Thinktecture.Tests.TestEnum item, string itemName)
385385
#endif
386386
}
387387

388-
private record struct Lookups(
388+
private readonly record struct Lookups(
389389
global::System.Collections.Generic.IReadOnlyDictionary<string, global::Thinktecture.Tests.TestEnum> Lookup,
390390
#if NET9_0_OR_GREATER
391391
global::System.Collections.Frozen.FrozenDictionary<string, global::Thinktecture.Tests.TestEnum>.AlternateLookup<global::System.ReadOnlySpan<char>> AlternateLookup,

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/Snapshots/EnumSourceGeneratorTests.Should_generate_int_based_class_0.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ void AddItem(global::Thinktecture.Tests.TestEnum item, string itemName)
310310
#endif
311311
}
312312

313-
private record struct Lookups(
313+
private readonly record struct Lookups(
314314
global::System.Collections.Generic.IReadOnlyDictionary<int, global::Thinktecture.Tests.TestEnum> Lookup,
315315
global::System.Collections.Generic.IReadOnlyList<global::Thinktecture.Tests.TestEnum> List);
316316
}

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/Snapshots/EnumSourceGeneratorTests.Should_generate_int_based_class_with_ComparisonOperators_DefaultWithKeyTypeOverloads_0.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ void AddItem(global::Thinktecture.Tests.TestEnum item, string itemName)
310310
#endif
311311
}
312312

313-
private record struct Lookups(
313+
private readonly record struct Lookups(
314314
global::System.Collections.Generic.IReadOnlyDictionary<int, global::Thinktecture.Tests.TestEnum> Lookup,
315315
global::System.Collections.Generic.IReadOnlyList<global::Thinktecture.Tests.TestEnum> List);
316316
}

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/Snapshots/EnumSourceGeneratorTests.Should_generate_int_based_class_with_ValueObjectFactoryAttribute_0.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ void AddItem(global::Thinktecture.Tests.TestEnum item, string itemName)
482482
#endif
483483
}
484484

485-
private record struct Lookups(
485+
private readonly record struct Lookups(
486486
global::System.Collections.Generic.IReadOnlyDictionary<int, global::Thinktecture.Tests.TestEnum> Lookup,
487487
global::System.Collections.Generic.IReadOnlyList<global::Thinktecture.Tests.TestEnum> List);
488488
}

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/Snapshots/EnumSourceGeneratorTests.Should_generate_int_based_class_with_ValueObjectFactoryAttribute_and_UseForSerialization_0.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ void AddItem(global::Thinktecture.Tests.TestEnum item, string itemName)
483483
#endif
484484
}
485485

486-
private record struct Lookups(
486+
private readonly record struct Lookups(
487487
global::System.Collections.Generic.IReadOnlyDictionary<int, global::Thinktecture.Tests.TestEnum> Lookup,
488488
global::System.Collections.Generic.IReadOnlyList<global::Thinktecture.Tests.TestEnum> List);
489489
}

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/Snapshots/EnumSourceGeneratorTests.Should_generate_string_based_class_0.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ void AddItem(global::Thinktecture.Tests.TestEnum item, string itemName)
385385
#endif
386386
}
387387

388-
private record struct Lookups(
388+
private readonly record struct Lookups(
389389
global::System.Collections.Generic.IReadOnlyDictionary<string, global::Thinktecture.Tests.TestEnum> Lookup,
390390
#if NET9_0_OR_GREATER
391391
global::System.Collections.Frozen.FrozenDictionary<string, global::Thinktecture.Tests.TestEnum>.AlternateLookup<global::System.ReadOnlySpan<char>> AlternateLookup,

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/Snapshots/EnumSourceGeneratorTests.Should_generate_string_based_class_having_ValueObjectValidationErrorAttribute_0.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ void AddItem(global::Thinktecture.Tests.TestEnum item, string itemName)
556556
#endif
557557
}
558558

559-
private record struct Lookups(
559+
private readonly record struct Lookups(
560560
global::System.Collections.Generic.IReadOnlyDictionary<string, global::Thinktecture.Tests.TestEnum> Lookup,
561561
#if NET9_0_OR_GREATER
562562
global::System.Collections.Frozen.FrozenDictionary<string, global::Thinktecture.Tests.TestEnum>.AlternateLookup<global::System.ReadOnlySpan<char>> AlternateLookup,

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/Snapshots/EnumSourceGeneratorTests.Should_generate_string_based_class_with_base_class_and_non_default_constructors_0.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ void AddItem(global::Thinktecture.Tests.TestEnum item, string itemName)
590590
#endif
591591
}
592592

593-
private record struct Lookups(
593+
private readonly record struct Lookups(
594594
global::System.Collections.Generic.IReadOnlyDictionary<string, global::Thinktecture.Tests.TestEnum> Lookup,
595595
#if NET9_0_OR_GREATER
596596
global::System.Collections.Frozen.FrozenDictionary<string, global::Thinktecture.Tests.TestEnum>.AlternateLookup<global::System.ReadOnlySpan<char>> AlternateLookup,

0 commit comments

Comments
 (0)