Repository navigation
Closed
Labels
VB -> C#Specific to VB -> C# conversioncompilation errorA bug where the converted output won't compile
Description
Error thrown by compiler on erroreous code is "Delegate Action does not take 0 arguments" (CS1593)
VB.Net input code
Private Sub btnFilter_Click(sender As Object, e As EventArgs) Handles btnFilter.Click
upMCIF.Height = Me.Height - Me.Panel1.Height - 20
upMCIF.Width = Me.Width - 20
upMCIF.ShowPopup(8, Me.Panel1.Height, Sub()
'upMCIF.Height = 1
'upMCIF.Width = 1
Me.SetFilters()
Me.Focus()
btnFilter.Refresh()
btnFilter.Invalidate()
btnFilter.Update()
End Sub)
upMCIF.Focus()
End SubErroneous output
private void btnFilter_Click(object sender, EventArgs e)
{
upMCIF.Height = Height - Panel1.Height - 20;
upMCIF.Width = Width - 20;
upMCIF.ShowPopup(8, Panel1.Height, () =>
{
// upMCIF.Height = 1
// upMCIF.Width = 1
SetFilters();
Focus();
btnFilter.Refresh();
btnFilter.Invalidate();
btnFilter.Update();
});
upMCIF.Focus();
}Expected output
//Unsure of what the right code should be, but this would compile.
private void btnFilter_Click(object sender, EventArgs e)
{
upMCIF.Height = Height - Panel1.Height - 20;
upMCIF.Width = Width - 20;
upMCIF.ShowPopup(8, Panel1.Height, (onclose) =>
{
// upMCIF.Height = 1
// upMCIF.Width = 1
SetFilters();
Focus();
btnFilter.Refresh();
btnFilter.Invalidate();
btnFilter.Update();
});
upMCIF.Focus();
}Details
CC 8.41 vs2019 extension
Signature of ShowPopup is
public void ShowPopup(int x, int y, Action<UserPopup> onclose = null);
Metadata
Metadata
Assignees
Labels
VB -> C#Specific to VB -> C# conversioncompilation errorA bug where the converted output won't compile
Activity
GrahamTheCoder commentedon Dec 11, 2021
Thanks, I'm pretty sure the converter has some code to deal with this case already, will have to investigate why it's not working in this case
Declare parameters omitted by VB's relaxed delegate conversion - fixes …