Closed CoolCoderSuper closed 9 months ago
VB does not enable creation support for ValueTask. Searching at https://github.com/dotnet/vblang/issues , I can't find any feature request for this either.
As @huoyaoyuan noted this behavior is "By Design" as VB does not support Async
methods that return ValueTask
.
I wonder if we can put some effort to bring VB features more parity with corresponding C# feature. Implementation link lowering and specification corners can be borrowed from C#, so the effort should be relatively lower. An example is await
in catch
and finally
.
@CoolCoderSuper @huoyaoyuan
Anthony Green (former head of the VB.NET team at Microsoft) has been working on something he calls ModVB. With it we'll be able to modify the language to suit our needs—to include this issue.
His blog can be found here:
You may follow his progress if you wish, and join the discussion, at our Discord community site:
https://discord.com/channels/682603493386747904/1073635946567835798
We hope to see you there!
Version Used:
Steps to Reproduce:
Put async modifer on function returning ValueTask
For example when implementing IAsyncDisposeable
Diagnostic Id:
BC36945 The 'Async' modifier can only be used on Subs, or on Functions that return Task or Task(Of T).
Expected Behavior: Should be treated like a normal async method. Actual Behavior: