Last active
August 19, 2017 15:11
-
-
Save tomwis/f74bba65d20293d21dbffdd6284655a7 to your computer and use it in GitHub Desktop.
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
string? x = ...; // może być nullem | |
string s = "hello"; // nie może być nullem | |
var s2 = b ? " world" : x; // s2 może być nullem | |
string s3 = s + s2; // błąd, nie użyć tutaj s2, które jest typu string?, wtedy s3 też musiałoby być tego typu | |
string s3 = s + (s2 ?? " you"); // tak będzie ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment