-
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-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone
Description
Compile this code:
open System
[<AttributeUsage(AttributeTargets.Method)>]
type MethodOnlyAttribute() =
inherit System.Attribute()
[<MethodOnly>]
let abc () =
"abc"
[<MethodOnly>]
let def =
"def"Expected behavior
Compilation should fail because def is not a method; it is a string.
Actual behavior
The code compiles.
Known workarounds
Take care not to use attributes incorrectly.
Related information
#4460 is not quite the same, but a fix will probably touch the same code.
- Operating system: Linux
- .NET Runtime kind: .NET Core, Fable
- Editing Tools: Visual Studio Code
Metadata
Metadata
Assignees
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Type
Projects
Status
Done