Closed buchatsky closed 2 years ago
.IsGeneric applies to C# type, not Typescript type. Arrays in C# are not generic type.
(byte[]?).IsGeneric == false
(Product[]?).IsGeneric == false
(ICollection<byte>).IsGeneric == true
(ICollection<Product>).IsGeneric == true
Typewriter has many bugs, but this is not one of them.
But property.Type.Name returns "number[]", not "byte[]". So I thought it was applied to Typescript
Yeah, it is a mess, you never know in Typewriter if you work with C# or TS type. It is why in NTypewriter there is a clear separation, code model is pure c# and TS functionality is available only through built-in functions.
Description .IsGeneric returns 'false' for primitive[] array types of properties (but correctly returns 'true' for Object[] array props). C# class:
For 'Picture' property (incorrect):
type: number[], isEnum: True, isGeneric: False, unwrapType: number[], isUnwrapPrimitive: False, firstTypeArg: number;
For 'Products' property (correct):
type: Product[], isEnum: True, isGeneric: True, unwrapType: Product, isUnwrapPrimitive: False, firstTypeArg: Product;
Desired behaviour For 'Picture' property: type: number[], isEnum: True, isGeneric: True, unwrapType: number, isUnwrapPrimitive: True, firstTypeArg: number;
Versions Typewriter64: 2.5.0 ( @adaskothebeast 's clone ) Visual Studio: 2022 (17.0.4)