From b38b7af05496e9a844ce8f63a05d23bd6c39430f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 20 May 2020 00:56:28 -0400 Subject: [PATCH] rewrite base types & interfaces (#711) --- .../Framework/ModLoading/Framework/RecursiveRewriter.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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);