From 694de7255b23b755a3c0670926c6ae0e3da1bc81 Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Mon, 28 Sep 2020 09:17:33 -0500 Subject: [PATCH] Cannot use generics as declared reader and writers --- .../Editor/Weaver/Processors/ReaderWriterProcessor.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/Mirror/Editor/Weaver/Processors/ReaderWriterProcessor.cs b/Assets/Mirror/Editor/Weaver/Processors/ReaderWriterProcessor.cs index aa4aa671e..cb6d269a1 100644 --- a/Assets/Mirror/Editor/Weaver/Processors/ReaderWriterProcessor.cs +++ b/Assets/Mirror/Editor/Weaver/Processors/ReaderWriterProcessor.cs @@ -66,6 +66,9 @@ static void LoadDeclaredWriters(AssemblyDefinition currentAssembly, TypeDefiniti if (!method.HasCustomAttribute()) continue; + if (method.HasGenericParameters) + continue; + TypeReference dataType = method.Parameters[1].ParameterType; Writers.Register(dataType, currentAssembly.MainModule.ImportReference(method)); } @@ -88,6 +91,9 @@ static void LoadDeclaredReaders(AssemblyDefinition currentAssembly, TypeDefiniti if (!method.HasCustomAttribute()) continue; + if (method.HasGenericParameters) + continue; + Readers.Register(method.ReturnType, currentAssembly.MainModule.ImportReference(method)); } }