Description
Broken by #33057
- clone dt
- cd ~/dt/types/lyricist
- tsl
- error on `const songsByArtist: SongByArtist[] = results[5];
Promise
.all([
lyricist.album(1, { fetchTracklist: true, textFormat: LyricistTextFormat.PLAIN }),
lyricist.artist(1, { textFormat: LyricistTextFormat.PLAIN }),
lyricist.artistByName('any_artist', { textFormat: LyricistTextFormat.PLAIN }),
lyricist.search('any_song'),
lyricist.song(1, { fetchLyrics: true, textFormat: LyricistTextFormat.PLAIN }),
lyricist.songsByArtist(1, { page: 1, perPage: 10, sort: 'asc' }),
])
.then((results) => {
const album: Album = results[0];
const artist: Artist = results[1];
const artistByName: Artist = results[2];
const searchResult: SearchResult[] = results[3];
const song: Song = results[4];
const songsByArtist: SongByArtist[] = results[5];
console.log('album', album.name);
console.log('artist', artist.name);
console.log('artistByName', artistByName.name);
console.log('searchResult length', searchResult.length);
console.log('song', song.title);
console.log('songsByArtist length', songsByArtist.length);
});
Expected behavior:
No error, and results[5]: SongByArtist[]
Actual behavior:
Error, and results[5]: SearchResult[]
The two types are VERY similar, although I'm not sure that's relevant. My guess is that it's a very subtle inference problem.