Uh oh!
There was an error while loading. Please reload this page.
Enforce attribute targets on let values - #16128
Conversation
vzarytovskii
commented
Oct 17, 2023
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.
edgarfgp
commented
Nov 29, 2023
Findings:
[AttributeUsage(AttributeTargets.Method|AttributeTargets.Constructor,Inherited=false)]sealedpublicclassMethodImplAttribute:Attribute{[<MethodImpl(MethodImplOptions.NoInlining)>]let__useResumableCode<'T>:bool =falseQuestions:
|
vzarytovskii
commented
Nov 29, 2023
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? |
vzarytovskii
commented
Nov 29, 2023
So, I think whatever rules we enforce now for functions (AttributeTargets.Method, I suppose?), should also be enforced for type functions. |
edgarfgp
commented
Nov 29, 2023
This makes more sense now . Thanks |
…ithub.com/edgarfgp/fsharp into enforce-attribute-targets-on-let-bindings
[<AttributeUsage(AttributeTargets.Method,AllowMultiple=false)>][<Sealed>]typeTailCallAttribute()=inherit System.Attribute()[<TailCall>]letsomeX=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 () = |
Fixes#8547