dotnet / dotnet/core

Return Null Generic Using C#8 Nullable

Open
#4,765 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
22k
Forks
4.9k
Avg merge
5d 5h
Merged PRs (30d)
29

Description

I'm having trouble implementing C#8 Nullable feature.

Very simple case.

```
public class NullableGeneric
{
public T Default => default;
}
```

This now returns "Possible null reference return.

How can I fix this? T can be either a class or struct.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.