@@ -14,8 +14,8 @@ namespace Microsoft.DotNet.Cli.Commands.Test.IPC;
14
14
15
15
internal abstract class NamedPipeBase
16
16
{
17
- private readonly Dictionary < Type , object > _typeSerializer = [ ] ;
18
- private readonly Dictionary < int , object > _idSerializer = [ ] ;
17
+ private readonly Dictionary < Type , INamedPipeSerializer > _typeSerializer = [ ] ;
18
+ private readonly Dictionary < int , INamedPipeSerializer > _idSerializer = [ ] ;
19
19
20
20
public void RegisterSerializer ( INamedPipeSerializer namedPipeSerializer , Type type )
21
21
{
@@ -25,9 +25,9 @@ public void RegisterSerializer(INamedPipeSerializer namedPipeSerializer, Type ty
25
25
26
26
protected INamedPipeSerializer GetSerializer ( int id , bool skipUnknownMessages = false )
27
27
{
28
- if ( _idSerializer . TryGetValue ( id , out object serializer ) )
28
+ if ( _idSerializer . TryGetValue ( id , out INamedPipeSerializer serializer ) )
29
29
{
30
- return ( INamedPipeSerializer ) serializer ;
30
+ return serializer ;
31
31
}
32
32
else
33
33
{
@@ -46,8 +46,8 @@ protected INamedPipeSerializer GetSerializer(int id, bool skipUnknownMessages =
46
46
47
47
48
48
protected INamedPipeSerializer GetSerializer ( Type type )
49
- => _typeSerializer . TryGetValue ( type , out object serializer )
50
- ? ( INamedPipeSerializer ) serializer
49
+ => _typeSerializer . TryGetValue ( type , out INamedPipeSerializer serializer )
50
+ ? serializer
51
51
: throw new ArgumentException ( string . Format (
52
52
CultureInfo . InvariantCulture ,
53
53
#if dotnet
0 commit comments