Special Attributes and Types This chapter describes attributes and types that have special significance to the F# compiler. Custom Attributes Recognized by F# The following custom attributes have special meanings recognized by the F# compiler. Except where indicated, the attributes may be used in F# code, in referenced assemblies in F#, or in assemblies that are authored in other CLI languages. Attribute Description System.ObsoleteAttribute Indicates that the construct is obsolete and [<Obsolete(...)>] gives a warning or error depending on the settings in the attribute. This attribute may be used in both F# and imported assemblies. System.ParamArrayAttribute When applied to an argument of a method, [<ParamArray(...)>] indicates that the method can accept a variable number of arguments. This attribute may be used in both F# and imported assemblies. System.ThreadStaticAttribute Marks a mutable static value in a class as [<ThreadStatic(...)>] thread static. This attribute may be used in both F# and imported assemblies. System.ContextStaticAttribute Marks a mutable static value in a class as [<ContextStatic(...)>] context static. This attribute may be used in both F# and imported assemblies. System.AttributeUsageAttribute Specifies the attribute usage targets for an [<AttributeUsage(...)>] attribute. This attribute may be used in both F# and imported assemblies. System.Diagnostics.ConditionalAttribute Emits code to call the method only if the [<Conditional(...)>] corresponding conditional compilation symbol is defined. This attribute may be used in both F# and imported assemblies. System.Reflection.AssemblyInformationalVersionAttribute Attaches additional version metadata to the [<AssemblyInformationalVersion(...)>] compiled form of the assembly. This attribute may be used in both F# and imported assemblies. System.Reflection.AssemblyFileVersionAttribute Attaches file version metadata to the compiled [<AssemblyFileVersion(...)>] form of the assembly. This attribute may be used in both F# and imported assemblies.
Special Attributes and Types This chapter describes attributes and types that have special significance to the F# compiler. Custom Attributes Recognized by F# The following custom attributes have special meanings recognized by the F# compiler. Except where indicated, the attributes may be used in F# code, in referenced assemblies in F#, or in assemblies that are authored in other CLI languages. Attribute Description System.ObsoleteAttribute [<Obsolete(...)>] Indicates that the construct is obsolete and gives a warning or error depending on the settings in the attribute. This attribute may be used in both F# and imported assemblies. System.ParamArrayAttribute [<ParamArray(...)>] When applied to an argument of a method, indicates that the method can accept a variable number of arguments. This attribute may be used in both F# and imported assemblies. System.ThreadStaticAttribute [<ThreadStatic(...)>] Marks a mutable static value in a class as thread static. This attribute may be used in both F# and imported assemblies. System.ContextStaticAttribute [<ContextStatic(...)>] Marks a mutable static value in a class as context static. This attribute may be used in both F# and imported assemblies. System.AttributeUsageAttribute [<AttributeUsage(...)>] Specifies the attribute usage targets for an attribute. This attribute may be used in both F# and imported assemblies. System.Diagnostics.ConditionalAttribute [<Conditional(...)>] Emits code to call the method only if the corresponding conditional compilation symbol is defined. This attribute may be used in both F# and imported assemblies. System.Reflection.AssemblyInformationalVersionAttribute [<AssemblyInformationalVersion(...)>] Attaches additional version metadata to the compiled form of the assembly. This attribute may be used in both F# and imported assemblies. System.Reflection.AssemblyFileVersionAttribute [<AssemblyFileVersion(...)>] Attaches file version metadata to the compiled form of the assembly. This attribute may be used in both F# and imported assemblies.
FSharpSpec-4.0-latest.docx