linux-packaging-mono/mcs/tests/test-null-operator-23.cs

20 lines
217 B
C#
Raw Normal View History

using System;
public class X
{
string field;
public static int Main ()
{
X x = null;
try {
var res = (x?.field).ToString()?.Length;
return 1;
} catch (NullReferenceException) {
}
return 0;
}
}