C# and nullable reference types

preview_player
Показать описание
Nullable reference types are not new, but I love them so much that I had to do a video about them! And also the required keyword introduced in C# 11 improved things. So in this video, I will show what it is and how to use them.
Рекомендации по теме
Комментарии
Автор

This is definitely a useful feature. However, reference types don't become Nullable<ReferenceType> when using the "?" operator, as we could observe in your video. The "nullable reference types" feature is merely a support feature to provide warnings to the developer. Even with nullable references types enabled, you can still assign null to any reference type variable and the code will compile just fine. That's why I find the name of this feature confusing, because it suggests that there now can be nullable and non-nullable reference types, but that's actually not true.

jewersp