Skip to content

Commit fc2021d

Browse files
chore: alias n4e's clashing driver constructor instead of qualifying it
The formatter and the compiler want opposite things here. With N4E present the bare INetworkStreamDriverConstructor binds to N4E's copy in the shared Unity.Netcode root, which the enclosing namespace reaches before the using directive, and the class then fails to implement it. With N4E absent - which is what the standards job's editor resolves - any qualification is redundant and IDE0001 strips it back off, so the last two attempts each traded one failure for the other. A file-scope using alias satisfies both. Its target cannot be shortened, since at file scope there is no enclosing namespace to shorten it against; the use site is a single identifier with no qualified form; and IDE0005 cannot drop the alias because removing it stops the name resolving at all.
1 parent 45db9fc commit fc2021d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

com.unity.netcode.gameobjects/Tests/Editor/Transports/UnityTransportTests.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
using Unity.Networking.Transport;
44
using UnityEngine;
55
using UnityEngine.TestTools;
6+
// Netcode for Entities declares an INetworkStreamDriverConstructor of its own in the shared Unity.Netcode
7+
// root, which the enclosing namespace resolves ahead of the import above. Aliasing it keeps this pointing
8+
// at NGO's, and unlike a qualified name there is nothing here for the formatter to simplify away.
9+
using UtpDriverConstructor = Unity.Netcode.Transports.UTP.INetworkStreamDriverConstructor;
610

711
namespace Unity.Netcode.GameObjects.EditorTests
812
{
@@ -231,9 +235,7 @@ public void UnityTransport_HostnameValidation((string, bool) testCase)
231235
}
232236
#endif
233237

234-
// Qualified: Netcode for Entities declares an INetworkStreamDriverConstructor of its own in the
235-
// Unity.Netcode root, which the enclosing namespace resolves ahead of the using directive above.
236-
private class IPCDriverConstructor : Transports.UTP.INetworkStreamDriverConstructor
238+
private class IPCDriverConstructor : UtpDriverConstructor
237239
{
238240
public void CreateDriver(
239241
UnityTransport transport,

0 commit comments

Comments
 (0)