Do not simplify away field as clause - it breaks compilation#43124
Do not simplify away field as clause - it breaks compilation#43124CyrusNajmabadi merged 2 commits intodotnet:masterfrom
Conversation
If option strict is on: Removing the as clause causes a compile error If option strict is off: It changes the inferred type of the field to be Object in all cases
|
@jcouv @KathleenDollard do you know if there are any cases in VB where a |
|
From https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/dim-statement
|
Especially with option strict
|
@CyrusNajmabadi I don't know. I didn't expect |
|
Looks like the tests didn't start properly, then timed out, I assume this just needs a rerun since I can't see any actual failing test. |
|
@GrahamTheCoder Tests are running now |
|
All green - let me know if you need anything else |
|
Thanks! |
Fixes #43123
If there's a case when the As clause actually should be removed (e.g. if you want to do so when option strict is off), let me know and I'll update.
I fixed the obvious explicit test of this. I expect there will be some other tests that need fixing up. My system struggles to run the tests locally so I'll deal with them as they appear from CI.