Closed
Description
π Search Terms
transpiledeclaration type generic constraint unknown self referencing union
π Version & Regression Information
β― Playground Link
π» Code
// @strict: true
// @declaration: true
// @showEmit
// @showEmittedFile: a.d.ts
// @filename: a.ts
export const object = {
foo: <T extends Set<T> | []>(): void => {},
};
π Actual behavior
When using the API, a.d.ts is emitted as
export declare const object: {
foo: <T extends unknown>() => void;
};
while when using tsc it gets emitted as
export declare const object: {
foo: <T extends Set<T> | []>() => void;
};
π Expected behavior
Using the API should emit
export declare const object: {
foo: <T extends Set<T> | []>() => void;
};
Additional information about the issue
Weird example I know. Trust me that our actual code makes a bit more sense.