-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFieldAssignmentDetection.cs
More file actions
39 lines (32 loc) · 864 Bytes
/
Copy pathFieldAssignmentDetection.cs
File metadata and controls
39 lines (32 loc) · 864 Bytes
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
34
35
36
37
38
39
using System;
public static class Program {
public static void Main (string[] args) {
var ct = new CustomType(1);
var mc = new MyClass();
Console.WriteLine("ct={0}, mc={1}", ct, mc);
mc.UpdateWithNewState(2, ct);
Console.WriteLine("ct={0}, mc={1}", ct, mc);
ct.Value = 3;
Console.WriteLine("ct={0}, mc={1}", ct, mc);
}
}
public struct CustomType {
public int Value;
public CustomType (int value) {
Value = value;
}
public override string ToString () {
return String.Format("{0}", Value);
}
}
public class MyClass {
public int A;
public CustomType B;
public void UpdateWithNewState (int a, CustomType b) {
A = a;
B = b;
}
public override string ToString () {
return String.Format("(a={0} b={1})", A, B);
}
}