fix(isolated-declarations): optional parameter property misses undefined type#12579
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #12579 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
…ined` type (#12579) [TypeScript Playground](https://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBAYwDYEMDOa4AUoEsBuKMwAwhAHZoxQCuCM0A6rjABYDyYMuFKSWKKCgC2wYlEwBvAFABIMHkLFEFKrXrQAFHNlRgARxq49AEwBccNbnIBzADQ6IXHuT4B+C+RrCARsCgOsvI0Pki4CHBgIWEInNy8SB5wPhAQSMAo5IHyikTAkbnEcS7uFla22XooJhRIAJ5wVTXk9cUJSV6+-oEAlHCSAL7SA0A) Input: ```ts export class PrivateConstructorWithOptionalParameters { private constructor( required: string, optional?: number, public publicOptional?: boolean, private privateOptional?: string, readonly readonlyOptional?: number, ) {} } ``` Output: ```ts export declare class PrivateConstructorWithOptionalParameters { publicOptional?: boolean | undefined; private privateOptional?; readonly readonlyOptional?: number | undefined; private constructor(); } ``` optional parameter property should union the original type with `undefined`
c93fff5 to
4f9cb0b
Compare
6ecb231 to
3cdac4c
Compare

TypeScript Playground
Input:
Output:
optional parameter property should union the original type with
undefined