-
Notifications
You must be signed in to change notification settings - Fork 833
Closed
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.help wanted
Milestone
Description
AttributeTargets.Method can be targeted in a constructor incorrectly.
Repro steps
open System
[<AttributeUsage(AttributeTargets.Method)>]
type CustomMethodAttribute() =
inherit Attribute()
type Class [<CustomMethod>] () = class end
type Struct [<CustomMethod>] (x: int) = struct endExpected behavior
Should not compile and Error 842 "This attribute is not valid for use on this language element" should be reported.
Actual behavior
Compiles
Provide a description of the actual behaviour observed.
Known workarounds
Provide a description of any known workarounds.
Related information
Provide any related information (optional):
- Operating system
- .NET Runtime kind (.NET Core, .NET Framework, Mono)
- Editing Tools (e.g. Visual Studio Version, Visual Studio)
Metadata
Metadata
Assignees
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.help wanted
Type
Projects
Status
Done