Skip to content

Commit 39a9f6c

Browse files
authored
Merge pull request #187 from DustedHam/feature/partial-static-constructor
Potential Fix for Issue #167
2 parents edb8b03 + 9b0e2db commit 39a9f6c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/MemoryPack.Generator/MemoryPackGenerator.Emitter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,9 +941,12 @@ string EmitUnionTemplate(IGeneratorContext context)
941941
942942
partial {{classOrInterfaceOrRecord}} {{TypeName}} : IMemoryPackFormatterRegister
943943
{
944+
static partial void StaticConstructor();
945+
944946
static {{Symbol.Name}}()
945947
{
946948
{{register}}
949+
StaticConstructor();
947950
}
948951
949952
[global::MemoryPack.Internal.Preserve]

0 commit comments

Comments
 (0)