Skip to content

NoInlining Dev Analyzer Rules #1097

Open
@paulirwin

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions