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