This fails to build
using newtype;
Id foo = new(5);
Console.WriteLine(foo);
[newtype<decimal>]
public readonly partial struct Id;
with the following message
/home/lasse-edslev/csharp/Playground/NewType.Generator/newtype.generator.AliasGenerator/Id.g.cs(121,56): error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) [/home/lasse-edslev/csharp/Playground/Playground.csproj]
/home/lasse-edslev/csharp/Playground/NewType.Generator/newtype.generator.AliasGenerator/Id.g.cs(124,56): error CS0191: A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer) [/home/lasse-edslev/csharp/Playground/Playground.csproj]
It works if I use double
This fails to build
with the following message
It works if I use
double