@@ -23,7 +23,7 @@ internal static class CecilExtensions
2323 "System.MulticastDelegate"
2424 } ;
2525
26- // DocID generation and type/parameter encoding is described here:
26+ // DocID generation and type/parameter encoding are described here:
2727 // https://docs.microsoft.com/en-us/cpp/build/reference/dot-xml-file-processing
2828 // https://github.com/dotnet/csharplang/blob/master/spec/documentation-comments.md#id-string-format
2929 public static string GetDocID ( this TypeDefinition t ) => "T:" + encodeTypeName ( t ) ;
@@ -180,7 +180,7 @@ private static IEnumerable<MethodDefinition> getBaseCandidatesFromType(MethodDef
180180 private static bool areParamTypesEquivalent ( TypeReference mp , TypeReference op , IDictionary < TypeReference , TypeReference > genMap )
181181 {
182182 if ( mp is IModifierType mpm && op is IModifierType opm )
183- return areParamTypesEquivalent ( mpm . ModifierType , opm . ModifierType , genMap ) && areParamTypesEquivalent ( mpm . ElementType , opm . ElementType , genMap ) ;
183+ return mpm . ModifierType . FullName == opm . ModifierType . FullName && areParamTypesEquivalent ( mpm . ElementType , opm . ElementType , genMap ) ;
184184
185185 if ( mp is ArrayType mpa && op is ArrayType opa )
186186 return mpa . Rank == opa . Rank && areParamTypesEquivalent ( mpa . ElementType , opa . ElementType , genMap ) ;
@@ -266,14 +266,13 @@ public static RefAssemblyResolver Create(string mainAssembly, string[] refAssemb
266266 private RefAssemblyResolver ( ) { }
267267
268268 private bool isCompatibleName ( AssemblyNameReference name , AssemblyNameReference cname ) =>
269- cname . Name == name . Name && cname . PublicKeyToken . SequenceEqual ( name . PublicKeyToken ) && cname . Version . Major == name . Version . Major && cname . Version . Minor >= name . Version . Minor ;
269+ cname . Name == name . Name && cname . PublicKeyToken . SequenceEqual ( name . PublicKeyToken ) && cname . Version >= name . Version ;
270270
271271 public AssemblyDefinition Resolve ( AssemblyNameReference name )
272272 {
273- if ( cache . TryGetValue ( name . FullName , out var match ) )
274- return match ;
273+ if ( ! cache . TryGetValue ( name . FullName , out var match ) )
274+ cache [ name . FullName ] = match = cache . Values . FirstOrDefault ( c => isCompatibleName ( name , c . Name ) ) ;
275275
276- match = cache [ name . FullName ] = cache . Values . FirstOrDefault ( c => isCompatibleName ( name , c . Name ) ) ;
277276 return match ?? throw new AssemblyResolutionException ( name ) ;
278277 }
279278
0 commit comments