Created
June 14, 2018 06:54
-
-
Save christiannagel/a25066cfd4157317d442c53e3f401d37 to your computer and use it in GitHub Desktop.
Using old and new libraries from C# 8 applications
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
var newglory = new NewAndGlory(); | |
string? s1 = newglory.GetANullString(); | |
string s2 = newglory.GetAString(); | |
// string s3 = newglory.PassAString(null); // error: cannot convert null literal to non-nullable reference or unconstrained type parameter | |
var old = new Legacy(); | |
string s4 = old.GetANullString(); // no error, s1 is null! | |
string s5 = old.PassAString(null); // no error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment