Skip to content

[isolatedDecalaration] Quick fix for isolatedDeclarations drops trailing unknown in generics instantiation #61208

Description

@blickly

🔎 Search Terms

isolatedDeclaerations autofix, drop, missing, unknown, type parameter, type argument, generics, template type

🕗 Version & Regression Information

  • This changed between versions 5.6 and 5.7

⏯ Playground Link

https://www.typescriptlang.org/dev/bug-workbench/?isolatedDeclarations=true&ts=5.7.3#code/PTAEAEEsGcHsBsCGAXApgEwCKoMZIE4qSwB20AXKMvgK6oBQIEi88sA7gFIWgBmL0Bk3DpcBIqUrU69RmHC9I8VCUQBbVFNTRkAOmTR6y5KAAeoSjRIBrEhxIBuWalMAHWPhM5SO0NFAAvKAkqOygAMqoyAAUANqmALoAlA5AA

💻 Code

letx : unknown;exportconsts=newSet([x]);

🙁 Actual behavior

Applying the quick fix gives incorrect code with unknown missing:

letx : unknown;exportconsts: Set=newSet([x]);

🙂 Expected behavior

letx : unknown;exportconsts: Set<unknown>=newSet([x]);

Additional information about the issue

I haven't checked yet, but I'd guess this to be related to #59665

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions