GalaxyCheck icon indicating copy to clipboard operation
GalaxyCheck copied to clipboard

Gen.Create should handle nullables

Open nth-commit opened this issue 4 years ago • 1 comments

Gen.Create<string?>() should generate like Gen.String().OrNull().

That is, the traversing reflection-based generator in Gen.Create should be able to recognise types that have been declared as nullable, and generate them as null.

nth-commit avatar May 18 '21 09:05 nth-commit

This is actually really hard, there's not much in the framework as of .NET 5 that gives an obvious answer as to whether something was declared as nullable. Apparently this is changing in .NET 6 so let's just enhance Gen.Create when we decide to target that version (to use its features).

nth-commit avatar Nov 15 '21 11:11 nth-commit