anchor.diff:          x.With(attributes = (
                   if x.IsVirtual then x.Attributes &&& ~~~MethodAttributes.CheckAccessOnOverride ||| MethodAttributes.HideBySig
                   else failwith "WithHideBySig"))
  -    member x.WithHideBySig condition = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.HideBySig))
  -    member x.WithFinal condition = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.Final))
  -    member x.WithAbstract condition = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.Abstract))
  -    member x.WithAccess access = x.With(attributes = (x.Attributes &&& ~~~MethodAttributes.MemberAccessMask ||| convertMemberAccess access))
  +    member x.WithHideBySig(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.HideBySig))
  +    member x.WithFinal(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.Final))
  +    member x.WithAbstract(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.Abstract))
  +    member x.WithAccess(access) = x.With(attributes = (x.Attributes &&& ~~~MethodAttributes.MemberAccessMask ||| convertMemberAccess access))
       member x.WithNewSlot = x.With(attributes = (x.Attributes ||| MethodAttributes.NewSlot))
  -    member x.WithSecurity condition = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.HasSecurity))
  -    member x.WithPInvoke condition = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.PinvokeImpl))
  -    member x.WithPreserveSig condition = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.PreserveSig))
  -    member x.WithSynchronized condition = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.Synchronized))
  -    member x.WithNoInlining condition = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.NoInlining))
  -    member x.WithAggressiveInlining condition = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.AggressiveInlining))
  -    member x.WithRuntime condition = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.Runtime))
  +    member x.WithSecurity(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.HasSecurity))
  +    member x.WithPInvoke(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.PinvokeImpl))
  +    member x.WithPreserveSig(condition) = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.PreserveSig))
  +    member x.WithSynchronized(condition) = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.Synchronized))
  +    member x.WithNoInlining(condition) = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.NoInlining))
  +    member x.WithAggressiveInlining(condition) = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.AggressiveInlining))
  +    member x.WithRuntime(condition) = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.Runtime))
   
   /// Index table by name and arity.
   type MethodDefMap = Map<string, ILMethodDef list>
  
positive.code:     member x.NotSerialized = x.Attributes &&& FieldAttributes.NotSerialized <> enum 0
      member x.IsInitOnly = x.Attributes &&& FieldAttributes.InitOnly <> enum 0
      member x.Access = memberAccessOfFlags (int x.Attributes)
      member x.WithAccess access = x.With(attributes = (x.Attributes &&& ~~~FieldAttributes.FieldAccessMask ||| convertFieldAccess access))
      member x.WithInitOnly condition = x.With(attributes = (x.Attributes |> conditionalAdd condition FieldAttributes.InitOnly))
      member x.WithStatic condition = x.With(attributes = (x.Attributes |> conditionalAdd condition FieldAttributes.Static))
      member x.WithSpecialName condition = x.With(attributes = (x.Attributes |> conditionalAdd condition (FieldAttributes.SpecialName ||| FieldAttributes.RTSpecialName)))
      member x.WithNotSerialized condition = x.With(attributes = (x.Attributes |> conditionalAdd condition FieldAttributes.NotSerialized))
      member x.WithLiteralDefaultValue literal = x.With(literalValue = literal, attributes = (x.Attributes |> conditionalAdd literal.IsSome (FieldAttributes.Literal ||| FieldAttributes.HasDefault)))
      member x.WithFieldMarshal marshal = x.With(marshal = marshal, attributes = (x.Attributes |> conditionalAdd marshal.IsSome FieldAttributes.HasFieldMarshal))
  
  // Index table by name. Keep a canonical list to make sure field order is not disturbed for binary manipulation.
  type ILFieldDefs =
  
negative.code: 
      member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex
  
      member x.WithCustomAttrs(customAttrs) = { x with CustomAttrsStored = storeILCustomAttrs customAttrs }
  
  type ILOverridesSpec =
      | OverridesSpec of ILMethodRef * ILType
  