-
Notifications
You must be signed in to change notification settings - Fork 833
Enforce attribute targets on let values #16128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce attribute targets on let values #16128
Conversation
Yes, at the very least. However, just language version will not be good enought for people who will all of the sudden have this issue when upgrading SDKs. I.e. it won't explain why do the have it now and how do they rollback to previous behaviour. |
Hum, a new error number and message it is the way to go here |
This comment was marked as outdated.
This comment was marked as outdated.
|
Findings:
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)]
sealed public class MethodImplAttribute: Attribute
{[<MethodImpl(MethodImplOptions.NoInlining)>]
let __useResumableCode<'T> : bool = falseQuestions:
|
|
MethodImpl is something we don't control, right? I don't think we should hack attribute checking in compiler. And __useResumableCode is not a value, it's a type function and compiler intrinsic at the same time. What codegen does it currently result in? |
|
So, I think whatever rules we enforce now for functions (AttributeTargets.Method, I suppose?), should also be enforced for type functions. |
This makes more sense now . Thanks |
…ithub.com/edgarfgp/fsharp into enforce-attribute-targets-on-let-bindings
[<AttributeUsage(AttributeTargets.Method,AllowMultiple=false)>]
[<Sealed>]
type TailCallAttribute() =
inherit System.Attribute()
[<TailCall>]
let someX = 23With this PR will also enforce that you can not use |
…m:edgarfgp/fsharp into enforce-attribute-targets-on-let-bindings
|
|
||
| [<Fact>] | ||
| let ShouldTriggerCompletionAtStartOfFileWithInsertion = | ||
| let ShouldTriggerCompletionAtStartOfFileWithInsertion () = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better now :)
Fixes #8547