Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions scratch/Program.cs
Original file line number Diff line number Diff line change
@@ -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<MyUnion>()}");

Expand All @@ -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 {}
Expand Down
8 changes: 4 additions & 4 deletions scratch/ResetNuget.bat
Original file line number Diff line number Diff line change
@@ -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
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
Loading