-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(http-client-csharp): fix the int/float literals are generated as …
…strings (#3248) Fixes Azure/autorest.csharp#4630 This PR also includes a refactor to remove the constant/reference/ReferenceOrConstant class, because we now have expressions and statements, we could fully express those concepts using the expressions/statements therefore we do not need these pre-expression era things.
- Loading branch information
1 parent
6d0e2ac
commit eb8e34a
Showing
23 changed files
with
98 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...r/Microsoft.Generator.CSharp/src/Expressions/CodeBlocks/DiagnosticScopeMethodBodyBlock.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.Generator.CSharp.Expressions | ||
{ | ||
public sealed record DiagnosticScopeMethodBodyBlock(Diagnostic Diagnostic, Reference ClientDiagnosticsReference, MethodBodyStatement InnerStatement) : MethodBodyStatement; | ||
public sealed record DiagnosticScopeMethodBodyBlock(Diagnostic Diagnostic, ValueExpression ClientDiagnosticsReference, MethodBodyStatement InnerStatement) : MethodBodyStatement; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
...nerator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ConstantExpression.cs
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...enerator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/LiteralExpression.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.Generator.CSharp.Expressions | ||
{ | ||
/// <summary> | ||
/// Represents a literal expression. | ||
/// </summary> | ||
/// <param name="Literal">The literal value.</param> | ||
public sealed record LiteralExpression(object? Literal) : ValueExpression | ||
{ | ||
public override void Write(CodeWriter writer) | ||
{ | ||
writer.WriteLiteral(Literal); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.