Skip to content

MS0024 trigger surface: recognise custom [Queryable] extension methods outside IrLinqMapping #218

Description

@danfma

Background

#205 wired MS0024 into the Phase B walker, but the diagnostic has no production trigger in the current build because:

Net effect: the explicit branch of IsExplicitQueryableOptIn cannot fire today, so user-authored unsupported bodies still leak through silently when they go through a custom [Queryable] extension method.

Proposal

Broaden trigger detection so MS0024 covers the real opt-in path the [Queryable] attribute promises:

  1. Teach IrLinqMapping.TryResolve (or a sibling resolver) to recognise user-authored methods carrying [Queryable] — at least for the LINQ-pipe shape source.MyStage(lambda) where the lambda is the principal predicate / selector.
  2. Or: hoist trigger detection out of the LINQ-chain walker entirely, so any call site with a lambda argument whose target parameter has [Queryable] or Expression<Func<…>> runs through the walker.

Either path turns MS0024 into a real, user-visible diagnostic.

Scope

  • Pick the trigger-surface broadening strategy.
  • Wire it into TryCaptureQueryableMeta (or a new analogous entry point).
  • Add tests that cover a user-authored [Queryable]-tagged extension method with an unsupported body — expecting MS0024.
  • Update IrExpressionTreeExtractor's class-level docstring to drop the "no production trigger" caveat once the surface is broadened.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions