@@ -52,7 +52,7 @@ private static void ProcessType(AssemblyRewriteContext processedAssembly, TypeDe
5252
5353 // If the parent type does not exist in the rewritten assembly, this nested type cannot be emitted safely.
5454 // Promoting it to a top-level type creates orphan compiler-generated types such as __O/__c.
55- if ( unityType . DeclaringType != null && enclosingNewType == null && processedType == null )
55+ if ( ( unityType . DeclaringType is null ) != ( enclosingNewType is null ) )
5656 return ;
5757
5858 if ( unityType . IsEnum )
@@ -106,7 +106,7 @@ private static void ProcessType(AssemblyRewriteContext processedAssembly, TypeDe
106106 ProcessType ( processedAssembly , nestedUnityType , processedType , imports , ref typesUnstripped ) ;
107107 }
108108
109- private static TypeDefinition CloneEnum ( TypeDefinition sourceEnum , string convertedTypeName , RuntimeAssemblyReferences imports )
109+ private static TypeDefinition CloneEnum ( TypeDefinition sourceEnum , Utf8String convertedTypeName , RuntimeAssemblyReferences imports )
110110 {
111111 var newType = new TypeDefinition ( sourceEnum . Namespace , convertedTypeName , ForcePublic ( sourceEnum . Attributes ) ,
112112 imports . Module . Enum ( ) . ToTypeDefOrRef ( ) ) ;
@@ -147,10 +147,10 @@ private static bool HasNonBlittableFields(TypeDefinition type)
147147 return false ;
148148 }
149149
150- private static string GetConvertedUnityTypeName ( RewriteGlobalContext context , TypeDefinition unityType )
150+ private static Utf8String GetConvertedUnityTypeName ( RewriteGlobalContext context , TypeDefinition unityType )
151151 {
152152 if ( context . Options . PassthroughNames )
153- return unityType . Name ;
153+ return unityType . Name ?? Utf8String . Empty ;
154154
155155 return unityType . Name . MakeValidInSource ( ) ;
156156 }
0 commit comments