Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by dialer for Null coalescing operator (??) with return

throw has relatively recently (in C# 7.0) been turned into an expression to enable this. return hasn't - it is always a just statement. The ?? operator requires an expression, not a statement. It was an arbitrary choice by the C# designers, specifically to allow using throw with ??.

See the documentation on the throw expression


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>