Skip to content

Emit Roslyn diagnostic when unsupported types are silently skipped #110

@jonathanpeppers

Description

@jonathanpeppers

Both [SortingNetwork] and [HybridSortingNetwork] generators silently skip unsupported element types (e.g., ypeof(decimal)) without any compiler warning or error. This can be confusing for users who expect code to be generated but get nothing.

Proposal

Emit a Roslyn diagnostic (warning or info) when an attribute specifies a type that is not in the supported set. For example:

[SortingNetwork(typeof(decimal))] // SN0001: 'decimal' is not a supported sorting network element type
partial class MySorter { }

This should apply to both attribute pipelines:

  • SortingNetworkAttribute
  • HybridSortingNetworkAttribute

Context

Discussed in PR #108 code review: #108 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions