Semantics\PrimaryConstructorTests.cs (71)
7269("0001", Success | Shadows, "public int F = p1;"),
7270("0002", Success | Shadows, "public int P {get;} = p1;"),
7271("0003", Success | Shadows, "public event System.Action E = () => p1.ToString();"),
7284("0017", Captured | Success, "void M() { p1 = 0; }"),
7285("0018", Captured | Success, "int P { get { return p1; } }"),
7286("0019", Captured | Success, "int P { set { p1 = 0; } }"),
7287("0020", Captured | Success, "int P { set {} get { return p1; } }"),
7288("0021", Captured | Success, "int P { get => 0; set { p1 = 0; } }"),
7289("0022", Captured | Success, "event System.Action E { add { p1 = 0; } remove {} }"),
7290("0023", Captured | Success, "event System.Action E { add {} remove { p1 = 0; } }"),
7291("0024", Captured | Success, "int this[int x] { get { return p1; } }"),
7292("0025", Captured | Success, "int this[int x] { set { p1 = 0; } }"),
7293("0026", Captured | Success, "int this[int x] { set {} get { return p1; } }"),
7294("0027", Captured | Success, "int this[int x] { get => 0; set { p1 = 0; } }"),
7295("0028", Captured | Success, "~C1() { p1 = 0; }"),
7504("1401", Success | Shadows, "public System.Func<int> F = (() => p1);"),
7505("1402", Success | Shadows, "public System.Func<System.Func<int>> F = (() => (System.Func<int>)(() => p1));"),
7506("1403", Success | Shadows, "public System.Func<int> F = () => { return local(); int local() => p1; };"),
7507("1404", Success | Shadows, "public System.Func<int> P {get;} = (() => p1);"),
7508("1405", Success | Shadows, "public System.Func<System.Func<int>> P {get;} = (() => (System.Func<int>)(() => p1));"),
7509("1406", Success | Shadows, "public System.Func<int> P {get;} = () => { return local(); int local() => p1; };"),
7510("1407", Success | Shadows, "public event System.Func<System.Func<int>> E = (() => (System.Func<int>)(() => p1));"),
7511("1408", Success | Shadows, "public event System.Func<int> E = () => { return local(); int local() => p1; };"),
7519("1502", Captured | Success, "public int P => p1;"),
7529("1517", Captured | Success, "void M() => p1 = 0;"),
7530("1518", Captured | Success, "int P { get => p1; }"),
7531("1519", Captured | Success, "int P { set => p1 = 0; }"),
7532("1520", Captured | Success, "int P { set {} get => p1; }"),
7533("1521", Captured | Success, "int P { get => 0; set => p1 = 0; }"),
7534("1524", Captured | Success, "int this[int x] { get => p1; }"),
7535("1525", Captured | Success, "int this[int x] { set => p1 = 0; }"),
7536("1526", Captured | Success, "int this[int x] { set {} get => p1; }"),
7537("1527", Captured | Success, "int this[int x] { get => 0; set => p1 = 0; }"),
7538("1528", Captured | Success, "~C1() => p1 = 0;"),
7662("2101", Success | Shadows, "public System.Action F = () => { [Attr1(nameof(p1))] void local(){} local(); };"),
7663("2102", Success | Shadows, "public System.Action P {get;} = () => { [Attr1(nameof(p1))] void local(){} local(); };"),
7664("2103", Success | Shadows, "public event System.Action E = () => { [Attr1(nameof(p1))] void local(){} local(); };"),
7724("2301", Success | Shadows, "public System.Action F = () => { void local(string x = nameof(p1)){} local(); };"),
7725("2302", Success | Shadows, "public System.Action P {get;} = () => { void local(string x = nameof(p1)){} local(); };"),
7726("2303", Success | Shadows, "public event System.Action E = () => { void local(string x = nameof(p1)){} local(); };"),
7755("2401", Success | Shadows, "public int F = nameof(p1).Length;"),
7756("2402", Success | Shadows, "public int P {get;} = nameof(p1).Length;"),
7757("2403", Success | Shadows, "public event System.Action E = () => nameof(p1).Length.ToString();"),
20171("0101", Success, "(ref int p1) { void M1() { nameof(p1).ToString(); } }", null),
20172("0102", Success, "(ref int p1) { void M1() { local(); void local() { nameof(p1).ToString(); } } }", null),
20173("0103", Success, "(ref int p1) { void M1() { local1(); void local1() { local2(); void local2() {nameof(p1).ToString(); } } } }", null),
20174("0104", Success, "(in int p1) { void M1() { nameof(p1).ToString(); } }", null),
20175("0105", Success, "(in int p1) { void M1() { local(); void local() { nameof(p1).ToString(); } } }", null),
20176("0106", Success, "(in int p1) { void M1() { local1(); void local1() { local2(); void local2() { nameof(p1).ToString(); } } } }", null),
20177("0107", Success, "(out int p1) { int x = p1 = 0; void M1() { nameof(p1).ToString(); } }", null),
20178("0108", Success, "(out int p1) { int x = p1 = 0; void M1() { local(); void local() { nameof(p1).ToString(); } } }", null),
20179("0109", Success, "(out int p1) { int x = p1 = 0; void M1() { local1(); void local1() { local2(); void local2() { nameof(p1).ToString(); } } } }", null),
20180("0110", Success, "(S1 p1) { void M1() { nameof(p1).ToString(); } } ref struct S1 { public void M(){} }", null),
20181("0111", Success, "(S1 p1) { void M1() { local(); void local() { nameof(p1).ToString(); } } } ref struct S1{ public void M(){} }", null),
20182("0112", Success, "(S1 p1) { void M1() { local1(); void local1() { local2(); void local2() { nameof(p1).ToString(); } } } } ref struct S1{ public void M(){} }", null),
20197("0301", Success, "(ref int p1) { System.Action F = () => nameof(p1).ToString(); }", null),
20198("0302", Success, "(ref int p1) { System.Action P { get; } = () => nameof(p1).ToString(); }", null),
20199("0303", Success, "(ref int p1) { public event System.Action E = () => nameof(p1).ToString(); }", null),
20200("0304", Success, "(in int p1) { System.Action F = () => nameof(p1).ToString(); }", null),
20201("0305", Success, "(in int p1) { System.Action P { get; } = () => nameof(p1).ToString(); }", null),
20202("0306", Success, "(in int p1) { public event System.Action E = () => nameof(p1).ToString(); }", null),
20203("0307", Success, "(out int p1) { System.Action F = (p1 = 0) == 0 ? () => nameof(p1).ToString() : null; }", null),
20204("0308", Success, "(out int p1) { System.Action P { get; } = (p1 = 0) == 0 ? () => nameof(p1).ToString() : null; }", null),
20205("0309", Success, "(out int p1) { public event System.Action E = (p1 = 0) == 0 ? () => nameof(p1).ToString() : null; }", null),
20206("0310", Success, "(S1 p1) { System.Action F = () => nameof(p1).ToString(); } ref struct S1{ public void M(){} }", null),
20207("0311", Success, "(S1 p1) { System.Action P { get; } = () => nameof(p1).ToString(); } ref struct S1{ public void M(){} }", null),
20208("0312", Success, "(S1 p1) { public event System.Action E = () => nameof(p1).ToString(); } ref struct S1{ public void M(){} }", null),
20218("1011", Success, "(ref int p1) : Base(() => nameof(p1).ToString()); class Base { public Base(System.Action x) {} }", null),
20219("1012", Success, "(in int p1) : Base(() => nameof(p1).ToString()); class Base { public Base(System.Action x) {} }", null),
20220("1013", Success, "(out int p1) : Base(p1 = 0, () => nameof(p1).ToString()); class Base { public Base(int y, System.Action x) {} }", null),
20221("1014", Success, "(S1 p1) : Base(() => nameof(p1).ToString()); ref struct S1{ public void M(){} } class Base { public Base(System.Action x) {} }", null),