Current filter:
                                You should refresh the page.
                                  • Given:

                                    [C#]
                                    public struct MyStruct { public MyStruct(string name) { this.Name = name; } public string Name { get; } }

                                    The implementation should not generate code like:

                                    [C#]
                                    public static bool operator ==(MyStruct first, MyStruct second) { if ((object)first == null) return (object)second == null; return first.Equals(second); } public bool Equals(ExitPointTarget other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(this.Name, other.Name); }

                                    The correct implementation should be:

                                    [C#]
                                    public static bool operator ==(MyStruct first, MyStruct second) { return first.Equals(second); } public bool Equals(ExitPointTarget other) { return Equals(this.Name, other.Name); }
                                • Pavel A (DevExpress) 12.20.2016

                                  Hello Paulo,

                                  Thank you for pointing out this issue and providing a code sample.
                                  We agree with you that we shouldn't do nullability or reference equality checks for structures.

                                  We will change this behavior and notify you as soon as we do this.

                                1 Solution

                                Creation Date Importance Sort by

                                Fixed:

                                • Paulo Morgado 12.23.2016

                                  The fix is versioned 16.2.3.16356, not 16.2.4.

                                  But it works!

                                • Pavel A (DevExpress) 12.23.2016

                                  Hello Paulo,

                                  Thank you for letting us know about your results.
                                  You are right, the fix version is 16.2.3.16356.
                                  CodeRush for Roslyn v16.2.4 will be released in a few weeks, and will include the fix for this issue as well.