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

The compiler parses unsigned integer as a signed integer for C# #3

Open
transistors opened this issue Mar 3, 2016 · 0 comments
Open

Comments

@transistors
Copy link

Hi drasil,
One more problem. The compiler seems to use a "signed long" for all integers in an ASN1 file.
I have an unsigned integer as follow which is parsed as a signed long:

byteCounter [0] INTEGER (0..18446744073709551615),
`
This is parsed as a signed integer in C#"

private long byteCounter_ ;
    [ASN1Integer( Name = "" )]
    [ASN1ValueRangeConstraint ( 

        Min = 0L, 

        Max = 18446744073709551615L 

        ) ]

        [ASN1Element ( Name = "byteCounter", IsOptional =  false , HasTag =  true, Tag = 0 , HasDefaultValue =  false )  ]

Visual Studio Error:

Error CS0266 Cannot implicitly convert type 'ulong' to 'long'. An explicit conversion exists (are you missing a cast?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant