function validateType(jsdocNode,type){if(!type||!canTypeBeValidated(type.type)){return;}var typesToCheck=[];var elements=[];switch(type.type){case"TypeApplication":// {Array.<String>}
elements=type.applications[0].type==="UnionType"?type.applications[0].elements:type.applications;typesToCheck.push(getCurrentExpectedTypes(type));break;case"RecordType":// {{20:String}}
elements=type.fields;break;case"UnionType":// {String|number|Test}
case"ArrayType":// {[String, number, Test]}
elements=type.elements;break;case"FieldType":// Array.<{count: number, votes: number}>
if(type.value){typesToCheck.push(getCurrentExpectedTypes(type.value));}break;default:typesToCheck.push(getCurrentExpectedTypes(type));}elements.forEach(validateType.bind(null,jsdocNode));typesToCheck.forEach(function(typeToCheck){if(typeToCheck.expectedType&&typeToCheck.expectedType!==typeToCheck.currentType){context.report({node:jsdocNode,message:"Use '{{expectedType}}' instead of '{{currentType}}'.",data:{currentType:typeToCheck.currentType,expectedType:typeToCheck.expectedType}});}});}
Validate type for a given JSDoc node
@param {Object} jsdocNode JSDoc node
@param {Object} type JSDoc tag
@returns {void}
@private