From b4f509bb1011dfc1fcfab94f3142ae4053377e2d Mon Sep 17 00:00:00 2001 From: Orden4 Date: Sat, 6 Mar 2021 06:22:36 +0100 Subject: [PATCH] Fix GetGenericArguments for more than 1 generic type when retrieving it out of the name. --- CSharp.lua/CoreSystem.Lua/CoreSystem/Reflection/Assembly.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CSharp.lua/CoreSystem.Lua/CoreSystem/Reflection/Assembly.lua b/CSharp.lua/CoreSystem.Lua/CoreSystem/Reflection/Assembly.lua index b835dfb4..3d13bd48 100644 --- a/CSharp.lua/CoreSystem.Lua/CoreSystem/Reflection/Assembly.lua +++ b/CSharp.lua/CoreSystem.Lua/CoreSystem/Reflection/Assembly.lua @@ -893,15 +893,16 @@ function Type.GetGenericArguments(this) local name = cls.__name__ local i = name:find("%[") if i then + i = i + 1 while true do - i = i + 1 local j = name:find(",", i) or -1 local clsName = name:sub(i, j - 1) t[count] = typeof(System.getClass(clsName)) - count = count + 1 if j == -1 then break end + count = count + 1 + i = j + 1 end end return arrayFromTable(t, Type)