From d092fc98cef390698df5e5aee9a65a08f8950ce9 Mon Sep 17 00:00:00 2001 From: Matt Warren Date: Wed, 16 Sep 2026 15:27:47 -0700 Subject: [PATCH] Update scratch project and ResetNuget.bat --- scratch/Program.cs | 13 ++++++------- scratch/ResetNuget.bat | 8 ++++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/scratch/Program.cs b/scratch/Program.cs index 21431f6..132b19a 100644 --- a/scratch/Program.cs +++ b/scratch/Program.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; -var u = new MyUnion(new A(1, 2)); +MyUnion u = new A(1, 2); Console.WriteLine($"size: {Unsafe.SizeOf()}"); @@ -16,14 +16,13 @@ if (u is int) Console.WriteLine("I'm an int"); +// @union public partial struct MyUnion { - partial void Cases( - int x, - IBar bar, - IFoo foo, - byte y - ); + public partial MyUnion(int value); + public partial MyUnion(IBar bar); + public partial MyUnion(IFoo foo); + public partial MyUnion(byte y); } public interface IFoo {} diff --git a/scratch/ResetNuget.bat b/scratch/ResetNuget.bat index a873531..22a23d8 100644 --- a/scratch/ResetNuget.bat +++ b/scratch/ResetNuget.bat @@ -1,4 +1,4 @@ -rd %USERPROFILE%\.nuget\packages\uniontypes.toolkit.generators\0.0.0 /S /Q -dir %USERPROFILE%\.nuget\packages\uniontypes.toolkit.generators -dotnet restore Scratch.csproj -dir %USERPROFILE%\.nuget\packages\uniontypes.toolkit.generators \ No newline at end of file +rd %USERPROFILE%\.nuget\packages\uniontypes.toolkit.generator\0.0.0 /S /Q +dir %USERPROFILE%\.nuget\packages\uniontypes.toolkit.generator +dotnet restore --force-evaluate Scratch.csproj +dir %USERPROFILE%\.nuget\packages\uniontypes.toolkit.generator \ No newline at end of file