New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C# Metadata Int32 MinValue is wrong #29786
Comments
You are tryinging to decrement a constant value. |
@AdamSpeight2008 Starting in 15.8, if you press F12 to navigate to Metadata as Source for |
This is probably a bug i introduced when i fixed up how literals were converted to syntax nodes. There was probably some special casing here that added a |
Visual Studio 2017 (15.9.11) Same problem with Int64.MinValue #region Assembly mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\mscorlib.dll
#endregion
//
// Summary:
// Represents the smallest possible value of an Int64. This field is constant.
public const Int64 MinValue = --9223372036854775808; The problem with Int32.MinValue exists also :) //
// Summary:
// Represents the smallest possible value of System.Int32. This field is constant.
public const Int32 MinValue = --2147483648; |
@dmitry-lipetsk The milestone for this issue is 16.0. I believe that means you can't expect for it to be fixed in VS 2017, you'll have to upgrade to VS 2019. Have you tried that? |
Hm, you right :) VS2019 shows Int64.MinValue correctly #region сборка mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\mscorlib.dll
#endregion
using System.Globalization;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
namespace System
{
//
// Сводка:
// Представляет 64-разрядное целое число со знаком.
[ComVisible(true)]
public struct Int64 : IComparable, IFormattable, IConvertible, IComparable<Int64>, IEquatable<Int64>
{
//
// Сводка:
// Представляет наибольшее возможное значение типа Int64. Это поле является константой.
public const Int64 MaxValue = 9223372036854775807;
//
// Сводка:
// Представляет наименьшее возможное значение типа Int64. Это поле является константой.
public const Int64 MinValue = -9223372036854775808; |
public const Int32 MinValue = --2147483648;
-- ???? It will not compile ...
Visual Studio 15.8.2 ...
This issue has been moved from https://developercommunity.visualstudio.com/content/problem/328206/c-metadata-int32-minvalue-is-wrong.html
VSTS ticketId: 677394
These are the original issue comments:
BJ Myers on 9/11/2018, 04:25 PM (25 min ago): Reproduced in Visual Studio 15.8.4.
These are the original issue solutions:
(no solutions)
The text was updated successfully, but these errors were encountered: