-
Notifications
You must be signed in to change notification settings - Fork 481
Description
I ran into an issue with CommandLine version 2.9.1. You can see the issue in the code available here:
https://github.com/kevinms99/CommandLineIssue2.9.1
The project above has a compilation issue with version 2.9.1 but has no compilation issue with the previous version 2.8.0.
2.9.1 introduced a new, public extension on the object
type via T CommandLine.CastExtensions.Cast<T>(this object obj)
. I was originally using IEnumerable.Cast<T>(this IEnumerable seq)
to cast each element in a sequence to a particular type. However, my particular using
setup ended up switching to the CastExtensions
class's Cast
method, resulting in an unexpected compilation failure.
I can't really classify this as a bug, and I can fix this by simply changing the ordering of my using
statements. However, it's generally a little dangerous to publicly expose extension methods on the object
type due to the potential for name collisions. I'm unsure whether these extension methods are an expected part of an expanded API set as it wasn't obvious to me what feature the changes are associated with. Perhaps CastExtensions
wasn't even meant to be public?
Something to consider as 2.9.1 rolls out to more people.