summaryrefslogtreecommitdiff
path: root/mcs/tests/test-null-operator-16.cs
blob: 773744ee1455a5fa78f9ed2bb33071705a0ad67f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;

class X
{
	Action<string> a;

	public static void Main ()
	{
		string x = null;
		string y = null;
		string[] z = null;

		x?.Contains (y?.ToLowerInvariant ());
		x?.Contains (y?.Length.ToString ());

		var res = x?[y?.Length ?? 0];

		var res2 = z?[x?.Length ?? 0];

		x?.Foo (y?.ToLowerInvariant ());

		X xx = null;
		xx?.a (y?.ToLowerInvariant ());
	}
}

static class E
{
	public static string Foo (this string arg, string value)
	{
		return "";
	}
}