title: VB.NET: Value of Type 'Integer' cannot be converted to 'System.Array'
body: <p>In the below code I am getting the following error on line <code>If (Not hash.Add(Numbers(Num))) Then</code> Value of Type 'Integer' cannot be converted to 'System.Array'. What am I doing wrong?</p>
  
  <pre><code>Module Module1
  
  Sub Main()
  
      Dim array() As Integer = {5, 10, 12, 8, 8, 14}
  
      ' Pass array as argument.
      Console.WriteLine(findDup(array))
  
  End Sub
  
  Function findDup(ByVal Numbers() As Integer) As Integer
  
      Dim hash As HashSet(Of Array)
  
      For Each Num In Numbers
  
          If (Not hash.Add(Numbers(Num))) Then
              Return (Num)
          End If
  
      Next
  
  End Function
  
  End Module
  </code></pre>