Testura/Testura.Code

Bug in rendering Guid? property types

Closed this issue · 3 comments

Think PropertyGenerator::Create contains a bug for a property of Guid? type. It is rendered like this in code file: Nullable'1

For primitive datatypes it goes perfectly well...

Adding this:

if (type == typeof(Guid))
{
typeSyntax = IdentifierName("Guid");
}

to TypeGenerator::CheckPredefinedTypes, after all the other checks, appears to solve the issue

Nice find, can you create a PR with the fix + a test in TypeGeneratorTests.cs? If not I can do it later today.

I found some time to check on it and it seems like we don't support structs that well (or well nullable structs). So I added support for that but made some specific tests for GUID as it's a pretty normal struct to use.