function findTypeIndex(type) {
      if (type === anyType) {
        return 999;
      }

      return typed.types.indexOf(type);
    }
Find the index of a type definition. Handles special case 'any'
@param {TypeDef} type
@return {number}