Skip to content
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

NoInlining Dev Analyzer Rules #1097

Open
1 task done
paulirwin opened this issue Jan 12, 2025 · 0 comments
Open
1 task done

NoInlining Dev Analyzer Rules #1097

paulirwin opened this issue Jan 12, 2025 · 0 comments
Labels
dev-analyzers is:task A chore to be done
Milestone

Comments

@paulirwin
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Task description

We could use some Roslyn analyzers added to our new dev analyzers project around [MethodImpl(MethodImplOptions.NoInlining)] and StackTraceHelper, found while investigating #931:

  • NoInlining should not be used on interface methods or abstract methods. This attribute is not inherited, so it has no effect there.
  • NoInlining should not be used on empty-bodied methods. Since the test code would never be called from an empty-bodied method (since that calls nothing), it can never match to the stack trace. So we should not harm performance by preventing inlining these methods.
  • NoInlining should be used on methods referenced in a call to StackTraceHelper.DoesStackTraceContainMethod (perhaps just the two-argument version for now that also validates the owning class), and the method body is not empty.
@paulirwin paulirwin added is:task A chore to be done dev-analyzers labels Jan 12, 2025
@paulirwin paulirwin added this to the 4.8.0 milestone Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-analyzers is:task A chore to be done
Projects
None yet
Development

No branches or pull requests

1 participant