-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 interpolated string handler for Contract.ThrowIf methods #58173
Conversation
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs
Show resolved
Hide resolved
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs
Outdated
Show resolved
Hide resolved
|
||
public void AppendLiteral(string value) => _stringBuilder?.Append(value); | ||
|
||
public void AppendFormatted<T2>(T2 value) => _stringBuilder?.Append(value?.ToString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't find good names for the type parameters.
src/Compilers/Core/Portable/InternalUtilities/InterpolatedStringHandlerArgumentAttribute.cs
Show resolved
Hide resolved
fe7a3a7
to
78b91d8
Compare
78b91d8
to
c8630e5
Compare
@333fred Anything left here? |
@sharwell @dotnet/roslyn-ide for review. |
@sharwell for review. |
@sharwell Can you review please? Thanks! |
.../SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.InterpolatedStringHandlers.cs
Outdated
Show resolved
Hide resolved
.../SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.InterpolatedStringHandlers.cs
Outdated
Show resolved
Hide resolved
.../SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.InterpolatedStringHandlers.cs
Outdated
Show resolved
Hide resolved
…ities/Contract.InterpolatedStringHandlers.cs Co-authored-by: Sam Harwell <[email protected]>
…ities/Contract.InterpolatedStringHandlers.cs Co-authored-by: Sam Harwell <[email protected]>
…ities/Contract.InterpolatedStringHandlers.cs Co-authored-by: Sam Harwell <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dotnet/roslyn-compiler for a second review of the compiler files.
.../SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.InterpolatedStringHandlers.cs
Outdated
Show resolved
Hide resolved
.../SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.InterpolatedStringHandlers.cs
Outdated
Show resolved
Hide resolved
.../SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.InterpolatedStringHandlers.cs
Outdated
Show resolved
Hide resolved
.../SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.InterpolatedStringHandlers.cs
Outdated
Show resolved
Hide resolved
@jaredpar any more feedback? |
@jaredpar Can you take a look please? Thanks! |
Closes #58165
cc @333fred @sharwell @CyrusNajmabadi
I'm not sure if I'm doing it right