-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #8423: Remove undefined while getting the type of the first argument of then signature #8449
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/baselines/reference/asyncFunctionsAndStrictNullChecks.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//// [asyncFunctionsAndStrictNullChecks.ts] | ||
|
||
declare namespace Windows.Foundation { | ||
interface IPromise<TResult> { | ||
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; | ||
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; | ||
then<U>(success?: (value: TResult) => U, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; | ||
then<U>(success?: (value: TResult) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; | ||
done<U>(success?: (value: TResult) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; | ||
|
||
cancel(): void; | ||
} | ||
} | ||
|
||
async function sample(promise: Windows.Foundation.IPromise<number>) { | ||
var number = await promise; | ||
} | ||
|
||
|
||
//// [asyncFunctionsAndStrictNullChecks.js] | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments)).next()); | ||
}); | ||
}; | ||
function sample(promise) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var number = yield promise; | ||
}); | ||
} |
102 changes: 102 additions & 0 deletions
102
tests/baselines/reference/asyncFunctionsAndStrictNullChecks.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
=== tests/cases/compiler/asyncFunctionsAndStrictNullChecks.ts === | ||
|
||
declare namespace Windows.Foundation { | ||
>Windows : Symbol(Windows, Decl(asyncFunctionsAndStrictNullChecks.ts, 0, 0)) | ||
>Foundation : Symbol(Foundation, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 26)) | ||
|
||
interface IPromise<TResult> { | ||
>IPromise : Symbol(IPromise, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 38)) | ||
>TResult : Symbol(TResult, Decl(asyncFunctionsAndStrictNullChecks.ts, 2, 23)) | ||
|
||
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; | ||
>then : Symbol(IPromise.then, Decl(asyncFunctionsAndStrictNullChecks.ts, 2, 33), Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 145), Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 135), Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 135)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 13)) | ||
>success : Symbol(success, Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 16)) | ||
>value : Symbol(value, Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 27)) | ||
>TResult : Symbol(TResult, Decl(asyncFunctionsAndStrictNullChecks.ts, 2, 23)) | ||
>IPromise : Symbol(IPromise, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 38)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 13)) | ||
>error : Symbol(error, Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 58)) | ||
>error : Symbol(error, Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 68)) | ||
>IPromise : Symbol(IPromise, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 38)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 13)) | ||
>progress : Symbol(progress, Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 95)) | ||
>progress : Symbol(progress, Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 108)) | ||
>IPromise : Symbol(IPromise, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 38)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 13)) | ||
|
||
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; | ||
>then : Symbol(IPromise.then, Decl(asyncFunctionsAndStrictNullChecks.ts, 2, 33), Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 145), Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 135), Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 135)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 13)) | ||
>success : Symbol(success, Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 16)) | ||
>value : Symbol(value, Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 27)) | ||
>TResult : Symbol(TResult, Decl(asyncFunctionsAndStrictNullChecks.ts, 2, 23)) | ||
>IPromise : Symbol(IPromise, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 38)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 13)) | ||
>error : Symbol(error, Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 58)) | ||
>error : Symbol(error, Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 68)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 13)) | ||
>progress : Symbol(progress, Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 85)) | ||
>progress : Symbol(progress, Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 98)) | ||
>IPromise : Symbol(IPromise, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 38)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 13)) | ||
|
||
then<U>(success?: (value: TResult) => U, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; | ||
>then : Symbol(IPromise.then, Decl(asyncFunctionsAndStrictNullChecks.ts, 2, 33), Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 145), Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 135), Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 135)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 13)) | ||
>success : Symbol(success, Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 16)) | ||
>value : Symbol(value, Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 27)) | ||
>TResult : Symbol(TResult, Decl(asyncFunctionsAndStrictNullChecks.ts, 2, 23)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 13)) | ||
>error : Symbol(error, Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 48)) | ||
>error : Symbol(error, Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 58)) | ||
>IPromise : Symbol(IPromise, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 38)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 13)) | ||
>progress : Symbol(progress, Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 85)) | ||
>progress : Symbol(progress, Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 98)) | ||
>IPromise : Symbol(IPromise, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 38)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 13)) | ||
|
||
then<U>(success?: (value: TResult) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; | ||
>then : Symbol(IPromise.then, Decl(asyncFunctionsAndStrictNullChecks.ts, 2, 33), Decl(asyncFunctionsAndStrictNullChecks.ts, 3, 145), Decl(asyncFunctionsAndStrictNullChecks.ts, 4, 135), Decl(asyncFunctionsAndStrictNullChecks.ts, 5, 135)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 13)) | ||
>success : Symbol(success, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 16)) | ||
>value : Symbol(value, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 27)) | ||
>TResult : Symbol(TResult, Decl(asyncFunctionsAndStrictNullChecks.ts, 2, 23)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 13)) | ||
>error : Symbol(error, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 48)) | ||
>error : Symbol(error, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 58)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 13)) | ||
>progress : Symbol(progress, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 75)) | ||
>progress : Symbol(progress, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 88)) | ||
>IPromise : Symbol(IPromise, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 38)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 13)) | ||
|
||
done<U>(success?: (value: TResult) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; | ||
>done : Symbol(IPromise.done, Decl(asyncFunctionsAndStrictNullChecks.ts, 6, 125)) | ||
>U : Symbol(U, Decl(asyncFunctionsAndStrictNullChecks.ts, 7, 13)) | ||
>success : Symbol(success, Decl(asyncFunctionsAndStrictNullChecks.ts, 7, 16)) | ||
>value : Symbol(value, Decl(asyncFunctionsAndStrictNullChecks.ts, 7, 27)) | ||
>TResult : Symbol(TResult, Decl(asyncFunctionsAndStrictNullChecks.ts, 2, 23)) | ||
>error : Symbol(error, Decl(asyncFunctionsAndStrictNullChecks.ts, 7, 50)) | ||
>error : Symbol(error, Decl(asyncFunctionsAndStrictNullChecks.ts, 7, 60)) | ||
>progress : Symbol(progress, Decl(asyncFunctionsAndStrictNullChecks.ts, 7, 79)) | ||
>progress : Symbol(progress, Decl(asyncFunctionsAndStrictNullChecks.ts, 7, 92)) | ||
|
||
cancel(): void; | ||
>cancel : Symbol(IPromise.cancel, Decl(asyncFunctionsAndStrictNullChecks.ts, 7, 122)) | ||
} | ||
} | ||
|
||
async function sample(promise: Windows.Foundation.IPromise<number>) { | ||
>sample : Symbol(sample, Decl(asyncFunctionsAndStrictNullChecks.ts, 11, 1)) | ||
>promise : Symbol(promise, Decl(asyncFunctionsAndStrictNullChecks.ts, 13, 22)) | ||
>Windows : Symbol(Windows, Decl(asyncFunctionsAndStrictNullChecks.ts, 0, 0)) | ||
>Foundation : Symbol(Windows.Foundation, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 26)) | ||
>IPromise : Symbol(Windows.Foundation.IPromise, Decl(asyncFunctionsAndStrictNullChecks.ts, 1, 38)) | ||
|
||
var number = await promise; | ||
>number : Symbol(number, Decl(asyncFunctionsAndStrictNullChecks.ts, 14, 7)) | ||
>promise : Symbol(promise, Decl(asyncFunctionsAndStrictNullChecks.ts, 13, 22)) | ||
} | ||
|
103 changes: 103 additions & 0 deletions
103
tests/baselines/reference/asyncFunctionsAndStrictNullChecks.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
=== tests/cases/compiler/asyncFunctionsAndStrictNullChecks.ts === | ||
|
||
declare namespace Windows.Foundation { | ||
>Windows : any | ||
>Foundation : any | ||
|
||
interface IPromise<TResult> { | ||
>IPromise : IPromise<TResult> | ||
>TResult : TResult | ||
|
||
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; | ||
>then : { <U>(success?: ((value: TResult) => IPromise<U>) | undefined, error?: ((error: any) => IPromise<U>) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => IPromise<U>) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => U) | undefined, error?: ((error: any) => IPromise<U>) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => U) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; } | ||
>U : U | ||
>success : ((value: TResult) => IPromise<U>) | undefined | ||
>value : TResult | ||
>TResult : TResult | ||
>IPromise : IPromise<TResult> | ||
>U : U | ||
>error : ((error: any) => IPromise<U>) | undefined | ||
>error : any | ||
>IPromise : IPromise<TResult> | ||
>U : U | ||
>progress : ((progress: any) => void) | undefined | ||
>progress : any | ||
>IPromise : IPromise<TResult> | ||
>U : U | ||
|
||
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; | ||
>then : { <U>(success?: ((value: TResult) => IPromise<U>) | undefined, error?: ((error: any) => IPromise<U>) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => IPromise<U>) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => U) | undefined, error?: ((error: any) => IPromise<U>) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => U) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; } | ||
>U : U | ||
>success : ((value: TResult) => IPromise<U>) | undefined | ||
>value : TResult | ||
>TResult : TResult | ||
>IPromise : IPromise<TResult> | ||
>U : U | ||
>error : ((error: any) => U) | undefined | ||
>error : any | ||
>U : U | ||
>progress : ((progress: any) => void) | undefined | ||
>progress : any | ||
>IPromise : IPromise<TResult> | ||
>U : U | ||
|
||
then<U>(success?: (value: TResult) => U, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; | ||
>then : { <U>(success?: ((value: TResult) => IPromise<U>) | undefined, error?: ((error: any) => IPromise<U>) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => IPromise<U>) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => U) | undefined, error?: ((error: any) => IPromise<U>) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => U) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; } | ||
>U : U | ||
>success : ((value: TResult) => U) | undefined | ||
>value : TResult | ||
>TResult : TResult | ||
>U : U | ||
>error : ((error: any) => IPromise<U>) | undefined | ||
>error : any | ||
>IPromise : IPromise<TResult> | ||
>U : U | ||
>progress : ((progress: any) => void) | undefined | ||
>progress : any | ||
>IPromise : IPromise<TResult> | ||
>U : U | ||
|
||
then<U>(success?: (value: TResult) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; | ||
>then : { <U>(success?: ((value: TResult) => IPromise<U>) | undefined, error?: ((error: any) => IPromise<U>) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => IPromise<U>) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => U) | undefined, error?: ((error: any) => IPromise<U>) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; <U>(success?: ((value: TResult) => U) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise<U>; } | ||
>U : U | ||
>success : ((value: TResult) => U) | undefined | ||
>value : TResult | ||
>TResult : TResult | ||
>U : U | ||
>error : ((error: any) => U) | undefined | ||
>error : any | ||
>U : U | ||
>progress : ((progress: any) => void) | undefined | ||
>progress : any | ||
>IPromise : IPromise<TResult> | ||
>U : U | ||
|
||
done<U>(success?: (value: TResult) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; | ||
>done : <U>(success?: ((value: TResult) => any) | undefined, error?: ((error: any) => any) | undefined, progress?: ((progress: any) => void) | undefined) => void | ||
>U : U | ||
>success : ((value: TResult) => any) | undefined | ||
>value : TResult | ||
>TResult : TResult | ||
>error : ((error: any) => any) | undefined | ||
>error : any | ||
>progress : ((progress: any) => void) | undefined | ||
>progress : any | ||
|
||
cancel(): void; | ||
>cancel : () => void | ||
} | ||
} | ||
|
||
async function sample(promise: Windows.Foundation.IPromise<number>) { | ||
>sample : (promise: Windows.Foundation.IPromise<number>) => Promise<void> | ||
>promise : Windows.Foundation.IPromise<number> | ||
>Windows : any | ||
>Foundation : any | ||
>IPromise : Windows.Foundation.IPromise<TResult> | ||
|
||
var number = await promise; | ||
>number : number | ||
>await promise : number | ||
>promise : Windows.Foundation.IPromise<number> | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// @target: es6 | ||
// @strictNullChecks: true | ||
|
||
declare namespace Windows.Foundation { | ||
interface IPromise<TResult> { | ||
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; | ||
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; | ||
then<U>(success?: (value: TResult) => U, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>; | ||
then<U>(success?: (value: TResult) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>; | ||
done<U>(success?: (value: TResult) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; | ||
|
||
cancel(): void; | ||
} | ||
} | ||
|
||
async function sample(promise: Windows.Foundation.IPromise<number>) { | ||
var number = await promise; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is used in two places
then
onFulfilled
callback.Do we want to strip
undefined
in both places or just in the first one?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well. i went back and forth on this, and then did not see a reason why not...
so we want to get
T
then<U>(success?: (value: T) => U,...): IPromise<U>
the first takes care of the optionality of
succes?
, the second would remove theundefined
ifvalue
was optional. the question is what is the promised type for this:then<U>(success?: (value?: T) => U,...): IPromise<U>
is it
T
orT|undefined
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about cases like this:
Currently type of
x1
isnumber | undefined
andx2
fails with error addressed by this PR.With the fix type of
x2
will be justnumber
which will be inconsistent with type forx1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. fixed. thanks