@@ -3484,12 +3484,12 @@ module EstablishTypeDefinitionCores =
3484
3484
tycon.entity_ tycon_ repr <- repr
3485
3485
// Record the details so we can map System.Type --> TyconRef
3486
3486
let ilOrigRootTypeRef = GetOriginalILTypeRefOfProvidedType ( theRootTypeWithRemapping, m)
3487
- theRootTypeWithRemapping.PUntaint (( fun st -> ignore( lookupTyconRef.Remove ( st)) ; lookupTyconRef.Add ( st, tcref)), m)
3487
+ theRootTypeWithRemapping.PUntaint (( fun st -> ignore( lookupTyconRef.TryRemove ( st)) ; ignore ( lookupTyconRef.TryAdd ( st, tcref) )), m)
3488
3488
3489
3489
// Record the details so we can map System.Type --> ILTypeRef, including the relocation if any
3490
3490
if not isSuppressRelocate then
3491
3491
let ilTgtRootTyRef = tycon.CompiledRepresentationForNamedType
3492
- theRootTypeWithRemapping.PUntaint (( fun st -> ignore( lookupILTypeRef.Remove ( st)) ; lookupILTypeRef.Add ( st, ilTgtRootTyRef)), m)
3492
+ theRootTypeWithRemapping.PUntaint (( fun st -> ignore( lookupILTypeRef.TryRemove ( st)) ; ignore ( lookupILTypeRef.TryAdd ( st, ilTgtRootTyRef) )), m)
3493
3493
3494
3494
// Iterate all nested types and force their embedding, to populate the mapping from System.Type --> TyconRef/ILTypeRef.
3495
3495
// This is only needed for generated types, because for other types the System.Type objects self-describe
@@ -3522,12 +3522,12 @@ module EstablishTypeDefinitionCores =
3522
3522
let ilOrigTypeRef = GetOriginalILTypeRefOfProvidedType ( st, m)
3523
3523
3524
3524
// Record the details so we can map System.Type --> TyconRef
3525
- st.PUntaint (( fun st -> ignore( lookupTyconRef.Remove ( st)) ; lookupTyconRef.Add ( st, nestedTyRef)), m)
3525
+ st.PUntaint (( fun st -> ignore( lookupTyconRef.TryRemove ( st)) ; ignore ( lookupTyconRef.TryAdd ( st, nestedTyRef) )), m)
3526
3526
3527
3527
if isGenerated then
3528
3528
let ilTgtTyRef = nestedTycon.CompiledRepresentationForNamedType
3529
3529
// Record the details so we can map System.Type --> ILTypeRef
3530
- st.PUntaint (( fun st -> ignore( lookupILTypeRef.Remove ( st)) ; lookupILTypeRef.Add ( st, ilTgtTyRef)), m)
3530
+ st.PUntaint (( fun st -> ignore( lookupILTypeRef.TryRemove ( st)) ; ignore ( lookupILTypeRef.TryAdd ( st, ilTgtTyRef) )), m)
3531
3531
3532
3532
// Record the details so we can build correct ILTypeDefs during static linking rewriting
3533
3533
if not isSuppressRelocate then
0 commit comments