-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Additional Control.Invoke overloads break Visual Basic Code #10217
Copy link
Copy link
Open
Labels
📖 documentation: breakingplease open a breaking change issue https://github.com/dotnet/docs/issues/new?assignees=gewarrenplease open a breaking change issue https://github.com/dotnet/docs/issues/new?assignees=gewarren💥 regression-releaseRegression from a public releaseRegression from a public releasearea-VisualBasicpriority-2Work that is important, but not critical for the releaseWork that is important, but not critical for the release
Milestone
Metadata
Metadata
Assignees
Labels
📖 documentation: breakingplease open a breaking change issue https://github.com/dotnet/docs/issues/new?assignees=gewarrenplease open a breaking change issue https://github.com/dotnet/docs/issues/new?assignees=gewarren💥 regression-releaseRegression from a public releaseRegression from a public releasearea-VisualBasicpriority-2Work that is important, but not critical for the releaseWork that is important, but not critical for the release
Type
Fields
Give feedbackNo fields configured for issues without a type.
.NET version
.NET 6+
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
.NET 3.1
Issue description
The new overloads we introduced for
Control.Invokebreaks Visual Basic code.This used to be OK before:
This does no longer work.
The reason is that the Visual Basic compiler automatically creates the expected type for a Lambda. So here, the identifier names represents the actual types, which the compiler automatically generates.
To correct this, we need to rewrite it and help the compiler to create the correct type like this (as one solution):
Steps to reproduce
Just try the above discussed code.