fsharp
fsharp copied to clipboard
AttributeTargets better error message
Description
BEFORE
We had one message to fit all the invalid attribute targets messages.
This attribute is not valid for use on this language element
AFTER
We have now: This attribute cannot be applied to (<one or more targets>). Valid targets are: (<one or more targets>) e.g.
This attribute cannot be applied to struct. Valid targets are: classThis attribute cannot be applied to property, field, return value. Valid targets are: methodThis attribute cannot be applied to class. Valid targets are: interfaceThis attribute cannot be applied to method, property. Valid targets are: field
For cases here F# does not support attributes or still not a valid analysis for attribute targets that we want to enforce. We will still fallback to This attribute is not valid for use on this language element.
Checklist
- [x] Test cases added
- [x] Release notes entry updated