Skip to content

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

Merged
GrahamTheCoder merged 1 commit intoicsharpcode:masterfrom
Yozer:fix-conversions-calls
Apr 3, 2022
Merged

use explicit cast when integral numeric types are casted to enum#862
GrahamTheCoder merged 1 commit intoicsharpcode:masterfrom
Yozer:fix-conversions-calls

Conversation

@Yozer
Copy link
Copy Markdown
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