Greyed out my codes of null checking before invoking a delegate

前端 未结 2 836
北荒
北荒 2021-01-25 04:29

I write unity codes in VS 2015, which means it\'s in c#4 and the null condition operator is not available.

Before invoking a delegate, I did a null check. However the co

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-25 04:59

    I've just heard that grey codes in VS will still be compiled. The null check is still effective. So this is not a problem at all.

    IDE makes it grey to suggest that there's simpler formats, which is the null condition operator in my case. However it should not give such suggestion here, just ignore it would be fine.

提交回复
热议问题