summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-05-20 00:56:28 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-05-20 00:56:28 -0400
commitb38b7af05496e9a844ce8f63a05d23bd6c39430f (patch)
tree3d1a9f5af3a07ae8ced5fae56aaf136fd7b11971
parent136a548fbbb27e28ac7b8167760388eb5754bdb9 (diff)
downloadSMAPI-b38b7af05496e9a844ce8f63a05d23bd6c39430f.tar.gz
SMAPI-b38b7af05496e9a844ce8f63a05d23bd6c39430f.tar.bz2
SMAPI-b38b7af05496e9a844ce8f63a05d23bd6c39430f.zip
rewrite base types & interfaces (#711)
-rw-r--r--src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs b/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs
index 612d0fdd..3b8cda88 100644
--- a/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs
+++ b/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs
@@ -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);