rewrite base types & interfaces (#711)

This commit is contained in:
Jesse Plamondon-Willard 2020-05-20 00:56:28 -04:00
parent 136a548fbb
commit b38b7af054
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 6 additions and 0 deletions

View File

@ -67,6 +67,12 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework
anyRewritten |= this.RewriteCustomAttributes(type.CustomAttributes);
anyRewritten |= this.RewriteGenericParameters(type.GenericParameters);
foreach (InterfaceImplementation @interface in type.Interfaces)
anyRewritten |= this.RewriteTypeReference(@interface.InterfaceType, newType => @interface.InterfaceType = newType);
if (type.BaseType.FullName != "System.Object")
anyRewritten |= this.RewriteTypeReference(type.BaseType, newType => type.BaseType = newType);
foreach (MethodDefinition method in type.Methods)
{
anyRewritten |= this.RewriteTypeReference(method.ReturnType, newType => method.ReturnType = newType);