Skip to content

Commit

Permalink
support Type.IsAbstract, fix #433
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghuan committed Oct 8, 2023
1 parent 9f7195b commit 0517570
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CSharp.lua/CoreSystem.Lua/CoreSystem/Reflection/Assembly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ function Type.IsDefined(this, attributeType, inherit)
if metadata then
local class = metadata.class
if class then
return isMetadataDefined(class, 2, attributeType)
return isMetadataDefined(class, 3, attributeType)
end
end
return false
Expand All @@ -761,7 +761,7 @@ function Type.IsDefined(this, attributeType, inherit)
if metadata then
local class = metadata.class
if class then
if isMetadataDefined(class, 2, attributeType) then
if isMetadataDefined(class, 3, attributeType) then
return true
end
end
Expand All @@ -785,7 +785,7 @@ function Type.GetCustomAttributes(this, attributeType, inherit)
if metadata then
local class = metadata.class
if class then
fillMetadataCustomAttributes(t, class, 2, attributeType)
fillMetadataCustomAttributes(t, class, 3, attributeType)
end
end
else
Expand All @@ -794,7 +794,7 @@ function Type.GetCustomAttributes(this, attributeType, inherit)
if metadata then
local class = metadata.class
if class then
fillMetadataCustomAttributes(t, class, 2, attributeType)
fillMetadataCustomAttributes(t, class, 3, attributeType)
end
end
cls = getmetatable(cls)
Expand Down Expand Up @@ -889,7 +889,7 @@ function Type.getAttributes(this)
if metadata then
metadata = metadata.class
if metadata then
return metadata[1]
return metadata[2]
end
end
throwNoMatadata(cls.__name__)
Expand Down Expand Up @@ -936,11 +936,11 @@ function Type.GetGenericArguments(this)
if metadata then
metadata = metadata.class
if metadata then
local flags = metadata[1]
local flags = metadata[2]
local typeParameterCount = band(flags, 0xFF00)
if typeParameterCount ~= 0 then
typeParameterCount = typeParameterCount / 256
for i = 2, 1 + typeParameterCount do
for i = 3, 2 + typeParameterCount do
t[count] = typeof(metadata[i])
count = count + 1
end
Expand Down

0 comments on commit 0517570

Please sign in to comment.