diff --git a/tsc/internal/checker/checker.go b/tsc/internal/checker/checker.go index 694fc155b8e16..cf4cafd7dae89 100644 --- a/tsc/internal/checker/checker.go +++ b/tsc/internal/checker/checker.go @@ -23034,7 +23034,7 @@ func (c *Checker) instantiateTypeWorker(t *Type, m *TypeMapper, alias *TypeAlias } types := source.Types() newTypes := c.instantiateTypes(types, m) - if core.Same(newTypes, types) && alias.Symbol() == t.alias.Symbol() { + if core.Same(newTypes, types) && alias.Symbol() == t.alias.Symbol() && slices.Equal(alias.TypeArguments(), t.alias.TypeArguments()) { return t } if alias == nil { diff --git a/tsc/testdata/baselines/reference/compiler/declarationEmitUnusedAliasTypeParameter.js b/tsc/testdata/baselines/reference/compiler/declarationEmitUnusedAliasTypeParameter.js new file mode 100644 index 0000000000000..9ee17dc281e0e --- /dev/null +++ b/tsc/testdata/baselines/reference/compiler/declarationEmitUnusedAliasTypeParameter.js @@ -0,0 +1,54 @@ +//// [tests/cases/compiler/declarationEmitUnusedAliasTypeParameter.ts] //// + +//// [types.ts] +export type Labeled