Fix type spec

diff_index_specs clearly accepts 'undefined' as an argument because it
calls index_data, which pattern matches on undefined in its definition.