Closed
Description
π Search Terms
type parameter accessor declaration different types
π Version & Regression Information
- This changed between versions 5.2 and 5.3
β― Playground Link
π» Code
function makeV() {
type X<T> = { get done(): false | T; set done(v: T | null) }
return null! as X<number>
}
export const v = makeV();
π Actual behavior
Correct declaration files are generated for accessors that have divergent read/write types.
π Expected behavior
d.ts
keeps type parameter in type for v
:
export declare const v: {
get done(): false | T;
set done(v: T | null);
};
Additional information about the issue
Seems to have not worked since 5.3 when divergent property types were first preserved in declaration files. Discovered while investigating #60864
Metadata
Metadata
Assignees
Labels
No labels