Skip to content
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.

Heads up: ConcurrentQueue.TryDequeue hides member in (at least) .NET 5.0 #389

Open
NoTuxNoBux opened this issue Nov 30, 2020 · 0 comments
Open

Comments

@NoTuxNoBux
Copy link

Version Number and Operating System(s):

Windows 10, Forge Network Alloy at da8e129 (develop).

Expected behavior:

No warnings are shown during build.

Actual behavior:

Warnings are shown during build:

...\Concurrency.cs(32,21): warning CS0108: 'ConcurrentQueue<T>.TryDequeue(out T)' hides inherited member 'Queue<T>.TryDequeue(out T)'. Use the new keyword if hiding was intended. [C:\Users\Me\Projecten\Internal\dotnet-wade-server\Forge\Forge.csproj]

Steps to reproduce:

Use Forge Networking Alloy in a .NET 5.0 project, i.e. copy-paste the ForgeNetworkingRemastered/ForgeUnity/Assets/BeardedManStudios/Scripts/Networking/Forge/Networking folder into a non-Unity C# project and try to build using dotnet build.

The warning will be generated.

Context

This can be solved by adding the new keyword, but it turns out that this in turn generates warnings on older .NET versions such as used by Unity. Apparently this method did not exist before in the standard library and now does. This could mean that in more recent versions, the custom implementation is obsolete.

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

No branches or pull requests

1 participant