Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.
This repository was 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

@NoTuxNoBux

Description

@NoTuxNoBux

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions