Skip to content

Support nullable reference types#28

Open
ycherkes wants to merge 4 commits into
mainfrom
feature/nullable-reference-types
Open

Support nullable reference types#28
ycherkes wants to merge 4 commits into
mainfrom
feature/nullable-reference-types

Conversation

@ycherkes
Copy link
Copy Markdown
Owner

@ycherkes ycherkes commented Jan 6, 2024

Closes #19

Probably is blocked by the inability to get the information of the root object generic parameters nullability:

NullabilityInfo

Reflection API for Nullability Information
It provides nullability information and context from reflection members:

ParameterInfo
FieldInfo
PropertyInfo
EventInfo

so the following code:

private class Foo<T>
{
    public T Value { get; set; } 
}

var foo = new Foo<string?>{Value = null};

will be dumped to:

var foo = new Foo<string>{ Value = null };

@ycherkes ycherkes changed the title Support of nullable reference types Support nullable reference types Jan 8, 2024
# Conflicts:
#	src/VarDump/Utils/ReflectionUtils.cs
#	src/VarDump/Visitor/KnownTypes/AnonymousTypeVisitor.cs
#	src/VarDump/Visitor/KnownTypes/CollectionVisitor.cs
#	src/VarDump/Visitor/KnownTypes/DictionaryVisitor.cs
#	src/VarDump/Visitor/KnownTypes/KeyValuePairVisitor.cs
#	src/VarDump/Visitor/KnownTypes/RecordVisitor.cs
#	src/VarDump/Visitor/KnownTypes/TupleVisitor.cs
#	src/VarDump/Visitor/ObjectVisitor.cs
# Conflicts:
#	src/VarDump/Visitor/KnownTypes/CollectionVisitor.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support of nullable reference types for generic type parameters.

1 participant