AdaskoTheBeAsT / Typewriter

Automatic TypeScript template generation from C# source files
http://frhagn.github.io/Typewriter
Apache License 2.0
66 stars 13 forks source link

IsNullable support for C# 8 nullable reference types #1

Closed RudeySH closed 2 years ago

RudeySH commented 2 years ago

In bae691d241b070cd69ada5ca267582de9b9f7064, you fixed the bug that C# 8 nullable reference types introduced. But, TypeWriter's IsNullable returned false for these types. This pull request changes IsNullable so that it also returns true for nullable reference types.

Technically, nullable reference types aren't System.Nullable<>, but instead have [Nullable] attributes that the compiler generates. However, this distinction is not relevant for Typewriter's purposes. Users of Typewriter are likely using IsNullable to determine if a C# property should be optional (?) in TypeScript, and optional properties in Typescript work for both value types and reference types. So this is why I decided to improve the existing IsNullable implementation instead of adding something new like "IsNullableReferenceType".

AdaskoTheBeAsT commented 2 years ago

Thanks :)

AdaskoTheBeAsT commented 2 years ago

Released in https://github.com/AdaskoTheBeAsT/Typewriter/releases/tag/2.2.5-preview

RudeySH commented 2 years ago

Thank you for fixing many bugs of the original Typewriter. Your fork is my go-to version of Typewriter now. :)

Would you consider enabling GitHub issues on your fork?