code: def test_constructor_corner(self, dtype):
      index_cls = Index
  
      arr = np.array([1, 2, 3, 4], dtype=object)
  
      index = index_cls(arr, dtype=dtype)
      assert index.values.dtype == index.dtype
      if dtype == np.int64:
          without_dtype = Index(arr)
          # as of 2.0 we do not infer a dtype when we get an object-dtype
          #  ndarray of numbers, matching Series behavior
          assert without_dtype.dtype == object
  
          tm.assert_index_equal(index, without_dtype.astype(np.int64))
  
      # preventing casting
      arr = np.array([1, "2", 3, "4"], dtype=object)
      msg = "Trying to coerce float values to integers"
      with pytest.raises(ValueError, match=msg):
          index_cls(arr, dtype=dtype)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import Index, Series
  import pandas._testing
label_desc: Use image node_id 4 for calling the TestIntNumericIndex obj's underlying member method code with example usage: obj.test_constructor_corner(dtype) without return types