R#9: Explicit casts not recognized

The following code is based on a class provided by Microsoft:

private static readonly BigInteger DecimalMaxValue = (BigInteger)Decimal.MaxValue;

  • The code compiles and works as expected;
  • R#8 didn't flag any problems with the code;
  • R#9 flags this as an error: Cannot cast expression of type 'decimal' to type 'BigInteger;


The BigInteger class defines an explicit conversion operator from decimal to BigInteger:
http://referencesource.microsoft.com/#System.Numerics/System/Numerics/BigInteger.cs#1186

Why is R# suddenly unable to recognise this perfectly valid use of a conversion operator?
(The same error applies to the cast from double to BigInteger, which is also perfectly valid.)


JetBrains ReSharper Platform 6 Build 6.0.20141204.190160 on 2014-12-04 19:29:31Z
JetBrains ReSharper 9.0 Build 9.0.20141204.190166 on 2014-12-04 19:49:19Z
Visual Studio Professional 2013 Version 12.0.31101.00 Update 4

Please sign in to leave a comment.