Map a IsIn b
to Boolean-returning b.Contains(a)
instance or extension method call
#298
Labels
LDM Reviewed: No plans
LDM has reviewed and this feature is unlikely to move forward in the foreseeable future
Examples:
Related proposals
This syntax has been the subject of other proposals:
Proposal #62 -- as leveraging an overloadable operator, and not limited to returning Booleans
This limits the value of this feature exclusively to unsealed types, or types for which the source code can be modified. Also, returning something other than Boolean violates both the plain English meaning, and the commonly accepted meanings in VB.NET and SQL.
Proposal #229 -- Special-case for multitype-checking (#93) range (#25) and enum (#228)
RE: multitype checking -- The syntax in that proposal is specific to checking whether a type matches one of the types (as opposed to checking if it matches against all of the types). (I myself would prefer a more flexible syntax that would allow for both). That scenario would not be covered by this proposal.
RE: range -- If ranges would compile down to a
Range
object, which would have aContains
instance method , it would also be covered by this proposal.RE: enum -- I understand C# now supports
enum
as a constraint for generic methods; if VB.NET would support the same, this scenario could also be covered by this proposal, using a.Contains
extension method with anenum
constraint.The text was updated successfully, but these errors were encountered: