Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

VB -> C#: Exclamation Point (Bang) Operator for IDataReader #765

Closed
MaxKlotz opened this issue Sep 24, 2021 · 3 comments
Closed

VB -> C#: Exclamation Point (Bang) Operator for IDataReader #765

MaxKlotz opened this issue Sep 24, 2021 · 3 comments
Labels
VB -> C# Specific to VB -> C# conversion

Comments

@MaxKlotz
Copy link

MaxKlotz commented Sep 24, 2021

VB.Net input code

Public Sub GetByName(dataReader As IDataReader)
  Dim foo As Object
  foo = dataReader!foo
End Sub

Erroneous output

public void GetByName(IDataReader dataReader)
{
  object foo;
  foo = dataReader.Item;
}

Expected output

public void GetByName(IDataReader dataReader)
{
  object foo;
  foo = dataReader["foo"];
}

Details

  • Product in use: VS extension
  • Version in use: 8.4.0.0
  • The ExclamationMark operatior is handled wrong
@MaxKlotz MaxKlotz added the VB -> C# Specific to VB -> C# conversion label Sep 24, 2021
@MaxKlotz MaxKlotz changed the title VB -> C#: Exclamation Point Operator for IDataReader VB -> C#: Exclamation Point (Bang) Operator for IDataReader Sep 24, 2021
@GrahamTheCoder
Copy link
Member

Thanks for the report. This was the original commit that dealt with this syntax which should be a good starting point for tweaking to fix this:
745007a

@GrahamTheCoder
Copy link
Member

GrahamTheCoder commented Sep 25, 2021

Fixed by d2456b1

@MaxKlotz
Copy link
Author

You made my life a whole lot easier!
Thank you ♥

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

No branches or pull requests

2 participants