Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

VB -> C#: Literal Hex values ending in C drop the last character #483

Closed
jdunne525 opened this issue Jan 10, 2020 · 1 comment
Closed

VB -> C#: Literal Hex values ending in C drop the last character #483

jdunne525 opened this issue Jan 10, 2020 · 1 comment
Assignees
Labels
VB -> C# Specific to VB -> C# conversion

Comments

@jdunne525
Copy link

Input code

Public Class VisualBasicClass
    Public Test1 as Integer = &H7A
    Public Test2 as Integer = &H7B
    Public Test3 as Integer = &H7C
    Public Test4 as Integer = &H7D
    Public Test5 as Integer = &H7E
    Public Test6 as Integer = &H7F
End Class

Erroneous output

public partial class VisualBasicClass
{
    public int Test1 = 0x7A;
    public int Test2 = 0x7B;
    public int Test3 = 0x7;
    public int Test4 = 0x7D;
    public int Test5 = 0x7E;
    public int Test6 = 0x7F;
}

Expected output

Errant line should have been this:
    public int Test3 = 0x7C;

Details

  • Product in use: both
  • Version in use: 7.4.0.0 (what I saw on the website footer)
  • Did you see it working in a previous version, which? no
  • Any other relevant information to the issue, or your interest in contributing a fix.

Another non-critical, but related issue is observed on the following:
&Hffff
Gets converted to this with a capital letter on the last character for some reason:
0xfffF

@jdunne525 jdunne525 added the VB -> C# Specific to VB -> C# conversion label Jan 10, 2020
@jdunne525
Copy link
Author

I just found a workaround. Add an I suffix (i as in integer) and it converts properly:
Public Test3 as Integer = &H7CI
converts to this:
public int Test3 = 0x7C;

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

No branches or pull requests

2 participants