Last active
July 14, 2017 13:25
-
-
Save DavidArno/a09aa73764231c74077f0c4ffac5cc2d to your computer and use it in GitHub Desktop.
Using C# 7 features, throw expressions & x is T y
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Bar DoSomething(Foo uncheckedFoo) => | |
uncheckedFoo is Foo foo | |
? DoSomething2(foo) | |
: throw new ArgumentNullException(nameof(uncheckedFoo)); | |
private Bar DoSomething2(Foo foo) => // foo is definitely set here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment