Skip to content

Commit c965e12

Browse files
authored
Fix unique ID (#8971)
1 parent e6b00af commit c965e12

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/absil/il.fs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,17 @@ let isMscorlib data =
354354

355355
[<Sealed>]
356356
type ILAssemblyRef(data) =
357-
let uniqueStamp = AssemblyRefUniqueStampGenerator.Encode data
358-
let uniqueIgnoringVersionStamp = AssemblyRefUniqueStampGenerator.Encode { data with assemRefVersion = None }
357+
let pkToken key =
358+
match key with
359+
| Some (PublicKey bytes) -> Some (PublicKey (SHA1.sha1HashBytes bytes))
360+
| Some (PublicKeyToken token) -> Some (PublicKey (token))
361+
| None -> None
362+
363+
let uniqueStamp =
364+
AssemblyRefUniqueStampGenerator.Encode { data with assemRefPublicKeyInfo = pkToken (data.assemRefPublicKeyInfo) }
365+
366+
let uniqueIgnoringVersionStamp =
367+
AssemblyRefUniqueStampGenerator.Encode { data with assemRefVersion = None; assemRefPublicKeyInfo = pkToken (data.assemRefPublicKeyInfo) }
359368

360369
member x.Name=data.assemRefName
361370

0 commit comments

Comments
 (0)