When converting a project (in which a template method of IComparable was used a few times) from VS 2005 to VS 2008 I've got some errors:
Error 12 Type argument 'Object' does not inherit from or implement
the constraint type 'System.IComparable'.
Is this an actual fact that System.Object no longer implements that interface, or something went wrong during the convertion? Can I fix this somehow?
The problem is with the following method:
Public Function ValueIn(Of T As IComparable)(ByVal pValue As T, ByVal ParamArray pArgs() As T) As Boolean
For Each MyArg As T In pArgs
If pValue.CompareTo(MyArg) = 0 Then
Return True
End If
Next
Return False
End Function
and even something simple like:
Dim a as Object = 1
ValueIn(a,1,2)
causes the error mentioned above. It worked perfectly in VS 2005, so what can be the problem now?