##### SUMMARY
See https://github.com/ansible/ansible/blob/88d8cf8197c53edd3bcdcd21429eb4c2bfbf0f6a/lib/ansible/module_utils/basic.py#L699-L706

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
lib/ansible/module_utils/basic.py

##### ANSIBLE VERSION
```paste below
2.9
devel
```

type_checker, wanted_name = self._get_wanted_type(wanted, param)
        validated_params = []
        for value in values:
            try:
                validated_params.append(type_checker(value))
            except (TypeError, ValueError) as e:
                msg = "Elements value for option %s" % param
                if self._options_context:
                    msg += " found in '%s'" % " -> ".join(self._options_context)
                msg += " is of type %s and we were unable to convert to %s: %s" % (type(value), wanted_name, to_native(e))
                self.fail_json(msg=msg)
        return validated_params
    def _check_argument_types(self, spec=None, param=None):
        ''' ensure all arguments have the requested type '''
        if spec is None:
            spec = self.argument_spec
        if param is None:
            param = self.params
        for (k, v) in spec.items():
            wanted = v.get('type', None)
            if k not in param:
                continue
            value = param[k]
            if value is None:
                continue
            type_checker, wanted_name = self._get_wanted_type(wanted, k)
            try:
                param[k] = type_checker(value)
                wanted_elements = v.get('elements', None)