Skip to content

Conversation

@AdmiralSnyder
Copy link
Contributor

... by sorrounding the fibonacci function/lambda with a proper method.

... also, unified spacing around operators

Summary

Describe your changes here.

Fixes #Issue_Number (if available)

... by sorrounding the fibonacci function/lambda with a proper method.

... also, unified spacing around operators
@AdmiralSnyder AdmiralSnyder requested review from a team and gewarren as code owners January 14, 2026 12:54
Copilot AI review requested due to automatic review settings January 14, 2026 12:54
@dotnet-policy-service dotnet-policy-service bot added dotnet-fundamentals/svc community-contribution Indicates PR is created by someone from the .NET community. labels Jan 14, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the code examples for IDE0039 rule by wrapping the fibonacci function/lambda examples within proper method contexts to make it clearer that the rule is about local functions versus lambdas. The changes also unify spacing around operators for consistency.

Changes:

  • Added enclosing CalcFib5() method wrapper to both code examples
  • Unified operator spacing (consistent spaces around - and + operators)
  • Added a return fibonacci(5); call to demonstrate the usage
  • Added "vs." comment separator between the two examples

```csharp
// csharp_style_prefer_local_over_anonymous_function = true
int fibonacci(int n)
int CalcFib5()
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name should use PascalCase according to .NET naming conventions. Consider renaming to "CalculateFib5" or "GetFibonacci5" to follow standard .NET naming conventions for public methods.

Copilot uses AI. Check for mistakes.
Func<int, int> fibonacci = (int n) =>
// vs.
int CalcFib5()
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name should use PascalCase according to .NET naming conventions. Consider renaming to "CalculateFib5" or "GetFibonacci5" to follow standard .NET naming conventions for public methods.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-fundamentals/svc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant