从Visual Studio 2015.2到2015.3更新后,隐式转换,等于运算符和nullables的组合无法编译

asg*_*las 5 c# visual-studio visual-studio-2015

下面的代码在VS2015.2中编译,但升级到VS2015.3后失败了error CS0019: Operator '==' cannot be applied to operands of type 'Registration<Something>' and 'Something'.

  public class Class1
  {
      public Class1()
      {
          var a = new Registration<Something>();
          var x = a == Something.Bad; // this line fails in VS2015.3
      }
  }

  public struct Registration<T> where T:struct
  {
      public static implicit operator T?(Registration<T> registration)
      {
          return null;
      }
  }

  public enum Something
  {
      Good,
      Bad
  }
Run Code Online (Sandbox Code Playgroud)

我无法在更新3的更改日志中找到关于此类更改的任何通知.有人可以告诉我,为什么会发生这种情况?哪个是正确的行为?

编辑:隐式转换,等式运算符和nullables ...和枚举的组合.当T是枚举时,这似乎只会失败.

Nea*_*ter 2

看起来像一个错误。我们正在跟踪此问题https://github.com/dotnet/roslyn/issues/13380