Closed p-bojkowski closed 3 years ago
Hi!
I found an issue with float. In some cases "F" is missing:
new System.Drawing.Font("Calibri", 99.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
result:
CompilationUnit() .WithMembers( SingletonList<MemberDeclarationSyntax>( GlobalStatement( ExpressionStatement( ObjectCreationExpression( QualifiedName( QualifiedName( IdentifierName("System"), IdentifierName("Drawing")), IdentifierName("Font"))) .WithArgumentList( ArgumentList( SeparatedList<ArgumentSyntax>( new SyntaxNodeOrToken[]{ Argument( LiteralExpression( SyntaxKind.StringLiteralExpression, Literal("Calibri"))), Token(SyntaxKind.CommaToken), Argument( LiteralExpression( SyntaxKind.NumericLiteralExpression, Literal(99.75))), Token(SyntaxKind.CommaToken), Argument( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, IdentifierName("System"), IdentifierName("Drawing")), IdentifierName("FontStyle")), IdentifierName("Regular"))), Token(SyntaxKind.CommaToken), Argument( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, IdentifierName("System"), IdentifierName("Drawing")), IdentifierName("GraphicsUnit")), IdentifierName("Point")))}))))))) .NormalizeWhitespace()
The "F" for 99.75F is missing:
new System.Drawing.Font("Calibri", 99.75, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
And this will not compile.
But:
float f = 99.75F;
CompilationUnit() .WithMembers( SingletonList<MemberDeclarationSyntax>( GlobalStatement( LocalDeclarationStatement( VariableDeclaration( PredefinedType( Token(SyntaxKind.FloatKeyword))) .WithVariables( SingletonSeparatedList<VariableDeclaratorSyntax>( VariableDeclarator( Identifier("f")) .WithInitializer( EqualsValueClause( LiteralExpression( SyntaxKind.NumericLiteralExpression, Literal(99.75)))))))))) .NormalizeWhitespace()
"F" -> Identifier("f")
thx @KirillOsenkov !!! :)
Hi!
I found an issue with float. In some cases "F" is missing:
result:
The "F" for 99.75F is missing:
And this will not compile.
But:
result:
"F" -> Identifier("f")