In the current F# releases, the Obsolete attribute is not being emitted on the .NET metadata – it is only recorded in the F#-specific metadata blob. We have an open design topic to make this more explicit, which will likely involve emitting the attribute into the .NET metadata, but for now obsolete F# functions do not have .NET attributes indicating this.

For information stored in the F#-specific metadata section, you can use the FSharp.PowerPack.Metadata.dll functionality – in this case:

#r @"FSharp.PowerPack.Metadata.dll"

let fsharpCore = FSharp.PowerPack.Metadata.FSharpAssembly.FSharpLibrary

let obsolete = [

for e in fsharpCore.Entities do

for m in e.MembersOrValues do

let isObsolete =

m.Attributes

|> Seq.exists (fun attr -> attr.ReflectionType = typeof<System.ObsoleteAttribute> )

if isObsolete then

yield m.DisplayName ]

By on 9/4/2009 3:53 PM ()

Where can I find which attributes or categories of attributes are and which are not "emitted on the .net metadata"? I tried a few and so far none shows up on .net. Obsolete was one of these. For those "not emitted" - can you think of any feasible way of "post-emitting" them? Some kind of fsc/fsi post-compiler?

By on 3/4/2010 10:39 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper