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

use explicit cast when integral numeric types are casted to enum #862

Merged
merged 1 commit into from
Apr 3, 2022

Conversation

Yozer
Copy link
Member

@Yozer Yozer commented Apr 3, 2022

Ideally, I would just call Conversions.ToInteger when we cast strings to enums but it looks like VB.Net does some magic for fractional types as well.

@GrahamTheCoder GrahamTheCoder merged commit a26c6f9 into icsharpcode:master Apr 3, 2022
GrahamTheCoder added a commit that referenced this pull request Apr 5, 2022
use explicit cast when integral numeric types are casted to enum
# Conflicts:
#	CodeConverter/CSharp/ExpressionNodeVisitor.cs
#	CodeConverter/Util/FromRoslyn/ITypeSymbolExtensions.cs
#	Tests/CSharp/TypeCastTests.cs
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

Successfully merging this pull request may close these issues.

VB -> C#: Conversions.ToInteger called when casting integral types to enums
2 participants