Skip to content
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

Won't compile without error .NET8 - This call is ambiguous... #15

Open
jeff922 opened this issue Nov 17, 2023 · 0 comments
Open

Won't compile without error .NET8 - This call is ambiguous... #15

jeff922 opened this issue Nov 17, 2023 · 0 comments

Comments

@jeff922
Copy link

jeff922 commented Nov 17, 2023

After cloning repo, upgrading to .NET8 release, and building the following error occurs in:

\open-dis-csharp\CsharpDis6\OpenDis\Enumerations\Entity.Information.Minefield\PaintScheme.cs
line 275 public byte[] ToByteArray() => BitConverter.GetBytes(ToByte());

CS0121 The call is ambiguous between the following methods or properties: 'BitConverter.GetBytes(Half)' and 'BitConverter.GetBytes(short)'

This may have been introduced in .NET 7 per the post below:
dotnet/runtime#79034

Recommend changing line to the following to support .NET 8 and past versions
public byte[] ToByteArray() => BitConverter.GetBytes((short)ToByte());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant