Skip to content

Commit

Permalink
public的泛化类型里头包含private类型泛化参数时,会把这个类型识别为public,进而导致找不到适配delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Jan 13, 2017
1 parent 6e4bda4 commit 057d031
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Assets/XLua/Src/Editor/Hotfix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,16 @@ static bool isNoPublic(AssemblyDefinition assembly, TypeReference type)
}
else
{
if (type.IsGenericInstance)
{
foreach (var typeArg in ((GenericInstanceType)type).GenericArguments)
{
if (isNoPublic(assembly, typeArg))
{
return true;
}
}
}
var scope = type.Scope;
if (type.Scope.MetadataScopeType == MetadataScopeType.AssemblyNameReference
&& ((AssemblyNameReference)scope).Name != assembly.MainModule.FullyQualifiedName) // other assembly must be public
Expand All @@ -174,16 +184,6 @@ static bool isNoPublic(AssemblyDefinition assembly, TypeReference type)
{
return true;
}
if (type.IsGenericInstance)
{
foreach (var typeArg in ((GenericInstanceType)type).GenericArguments)
{
if (isNoPublic(assembly, typeArg))
{
return true;
}
}
}
return false;
}

Expand Down

0 comments on commit 057d031

Please sign in to comment.