Skip to content

Alert when using Is.NaN or Is.Not.NaN on an incompatible type #929

@stevenaw

Description

@stevenaw

I noticed recently that we don't alert to misuse of the NaNConstraint. The constrain is only coded to work for double or float (though I think "Single" will also work as {single} is float will evaluate to true).

Other types, such as guids, ints, etc, will always fail (or always pass in the case of Is.Not.NaN). Either case indicates a misuse that could be alerted about. Analyzers have previously triggered an "error" for these cases where it would never pass. Would a "warning" be appropriate for cases which always pass?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions