Skip to content

new readonly modifiers on Promise.all break lyricist in DT #33559

Description

Broken by #33057

  1. clone dt
  2. cd ~/dt/types/lyricist
  3. tsl
  4. 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.

Activity

  1. changed the title [-]new readonly modifiers on Promise.all breaks lyricist in DT[/-] [+]new readonly modifiers on Promise.all break lyricist in DT[/+] on Sep 23, 2019
  2. sandersn commented on Oct 1, 2019

    @sandersn
    MemberAuthor

    I fixed the error in lyricist for now by adding as const after the array argument to all. Once this issue is fixed, we should try removing that to make sure that it works as before.

  3. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions