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".
In bae691d241b070cd69ada5ca267582de9b9f7064, you fixed the bug that C# 8 nullable reference types introduced. But, TypeWriter's
IsNullable
returnedfalse
for these types. This pull request changesIsNullable
so that it also returnstrue
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 usingIsNullable
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 existingIsNullable
implementation instead of adding something new like "IsNullableReferenceType".