Open
Description
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.