Skip to content

The nuance of working with the var keyword. #21716

Closed
@lutk

Description

@lutk

Why is there no mention of the nuance of working with the var keyword in any document on this topic?

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/var
"When var is used with nullable reference types enabled, it always implies a nullable reference type even if the expression type isn't nullable."

In my opinion, this outweighs absolutely all the advantages of using nullable reference types and makes reading and refactoring a real hell.
Madness..


Сведения о документе

Не вносите правки в этот раздел. Это необходимо для связывания страницы сайта docs.microsoft.com с вопросом на GitHub.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions