Skip to content

Commit 742bbf8

Browse files
Avoid compilation error in previous test
1 parent 586ec7a commit 742bbf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CodeConverter/CSharp/LiteralConversions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static ExpressionSyntax GetLiteralExpression(object value, string textFor
5151
case double d:
5252
// The value is passed as a double from VB expression: "3.5F"
5353
// Important to use value text, otherwise "10.0" gets coerced to and integer literal of 10 which can change semantics
54-
var syntaxToken = false ? SyntaxFactory.Literal(textForUser, (float) d) : SyntaxFactory.Literal(textForUser, d);
54+
var syntaxToken = convertedType?.SpecialType == SpecialType.System_Single ? SyntaxFactory.Literal(textForUser, (float) d) : SyntaxFactory.Literal(textForUser, d);
5555
return SyntaxFactory.LiteralExpression(CSSyntaxKind.NumericLiteralExpression, syntaxToken);
5656
case float f:
5757
return SyntaxFactory.LiteralExpression(CSSyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal(textForUser, f));

0 commit comments

Comments
 (0)