diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md index 786a741dbfa..de16637a362 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -12,6 +12,7 @@ * Fix discriminated union initialization. ([#PR 16661](https://github.com/dotnet/fsharp/pull/16661)) * Allow calling method with both Optional and ParamArray. ([#PR 16688](https://github.com/dotnet/fsharp/pull/16688), [suggestions #1120](https://github.com/fsharp/fslang-suggestions/issues/1120)) * Enforce AttributeTargets on let values and functions. ([PR #16692](https://github.com/dotnet/fsharp/pull/16692)) +* Pretty naming: remove extra checks in `AddBackticksToIdentifierIfNeeded` ([PR #16614](https://github.com/dotnet/fsharp/pull/16614)) ### Added @@ -22,6 +23,7 @@ * Allow returning bool instead of unit option for partial active patterns. ([Language suggestion #1041](https://github.com/fsharp/fslang-suggestions/issues/1041), [PR #16473](https://github.com/dotnet/fsharp/pull/16473)) * Symbols: Add GenericArguments to FSharpEntity ([PR #16470](https://github.com/dotnet/fsharp/pull/16470)) + ### Changed * Autogenerated .Is* members for unions skipped for single-case unions. ([PR 16571](https://github.com/dotnet/fsharp/pull/16571)) diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index 3000297d866..12e0a84d7f1 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -529,11 +529,7 @@ let DoesIdentifierNeedBackticks (name: string) : bool = /// A utility to help determine if an identifier needs to be quoted let AddBackticksToIdentifierIfNeeded (name: string) : string = - if - DoesIdentifierNeedBackticks name - && not (name.StartsWithOrdinal("`")) - && not (name.EndsWithOrdinal("`")) - then + if DoesIdentifierNeedBackticks name then "``" + name + "``" else name