This project is read-only.
1
Vote

True & False operators from base class are ignored for short-circuited overloaded operators

description

Source: https://github.com/icsharpcode/ILSpy/blob/cc270c8f206b0e2863dc1866fe30b42faf5a49b1/ICSharpCode.Decompiler/Tests/CustomShortCircuitOperators.cs

This code compiles fine on non-Roslyn, but gives 4 In order for 'CustomShortCircuitOperators.C.operator |(CustomShortCircuitOperators.C, CustomShortCircuitOperators.C)' to be applicable as a short circuit operator, its declaring type 'CustomShortCircuitOperators.C' must define operator true and operator false errors with Roslyn.

The Roslyn compiler needs to look in base classes for overloaded true & false operators too.

comments