From 85d26ebce642af803445af089e71e2bc3cd043d5 Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Mon, 21 Sep 2020 23:00:30 -0500 Subject: [PATCH] type safe type comparison --- Assets/Mirror/Editor/Weaver/Extensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Mirror/Editor/Weaver/Extensions.cs b/Assets/Mirror/Editor/Weaver/Extensions.cs index 382f7c23d..13616c650 100644 --- a/Assets/Mirror/Editor/Weaver/Extensions.cs +++ b/Assets/Mirror/Editor/Weaver/Extensions.cs @@ -108,12 +108,12 @@ public static bool IsArrayType(this TypeReference tr) public static bool IsArraySegment(this TypeReference td) { - return td.FullName.StartsWith("System.ArraySegment`1", System.StringComparison.Ordinal); + return td.Resolve().Is(typeof(ArraySegment<>)); } public static bool IsList(this TypeReference td) { - return td.FullName.StartsWith("System.Collections.Generic.List`1", System.StringComparison.Ordinal); + return td.Resolve().Is(typeof(List<>)); } public static bool CanBeResolved(this TypeReference parent)