Skip to content

add support for either/or type binding for arguments #417

Open
@jonsequitur

Description

@jonsequitur

A common use case is that a given argument should be constrained to be parseable as either DirectoryInfo or FileInfo. There should be an API that makes this simple to express, performs input validation as expected, and binds the result correctly to a handler parameter.

While in this example a common base type (FileSystemInfo) could be passed to the handler, a related question is whether this should be a constraint. If a common base type is not required, the implication is that the type to which the argument is bound at runtime would drive overload resolution between different handlers, although this would add a lot of complexity and is probably not the best direction.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions