dotnet / dotnet-api-docs

.NET API reference documentation (.NET 5+, .NET Core, .NET Framework)
https://docs.microsoft.com/dotnet/api/
Other
725 stars 1.56k forks source link

Fix an error in the output comment #10325

Closed salpelter closed 2 months ago

salpelter commented 2 months ago

Summary

It's basically a code example that has a wrong output comment in the end. The number in question (10653) is actually of type long, which makes it a signed 64-bit integer, not 32.

learn-build-service-prod[bot] commented 2 months ago

Learn Build status updates of commit 76fa54e:

:white_check_mark: Validation status: passed

File Status Preview URL Details
snippets/csharp/System/Object/GetType/GetTypeEx2.cs :white_check_mark:Succeeded View

For more details, please refer to the build report.

For any questions, please:

BillWagner commented 2 months ago

Hi @salpelter

I'm closing this because the original code is correct. The declaration casts the type of 10653 to a long. Therefore, it's type is long, even though its value is small enough for a 32 bit int. See sharplab

salpelter commented 2 months ago

Hi @salpelter

I'm closing this because the original code is correct. The declaration casts the type of 10653 to a long. Therefore, it's type is long, even though its value is small enough for a 32 bit int. See sharplab

I don't understand what you're trying to say, to be honest. I never said that the number isn't of type long. And I agree that the number is small enough for a 32-bit integer, but since it was cast to long, that makes it 64-bit, doesn't it?

I followed your sharplab link and it only confirmed that I was right. It literally displayed "10653 is a 64-bit integer," as I expected. Am I missing something? It didn't even cross my mind at the time of making the pull request that my edit was in any way incorrect. Could you please explain what's wrong?

learn-build-service-prod[bot] commented 2 months ago

Learn Build status updates of commit 76fa54e:

:white_check_mark: Validation status: passed

File Status Preview URL Details
snippets/csharp/System/Object/GetType/GetTypeEx2.cs :white_check_mark:Succeeded View

For more details, please refer to the build report.

For any questions, please: