-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
union with any
shows as union in signature quickinfo but any
in parameter quickinfo
#58606
Comments
Expected and Actual are swapped, I think? |
No, it's the right way round. |
So this runs into an existing weird situation with reusing existing type declaration. It's not even unique to JSDoc types. type /*1*/O = {
/*2*/foo: any | string
} At marker 1 we can see: type O = {
foo: any | string;
} but at marker 2 we can see: (property) foo: any Note that declaration emit preserves The reason why the type for It's enough to wrap the type in this original repro into an object to get consistent non-reduced results: /**
* @param {{prop: object | null}} o
*/
function create2(o) {}
create2/*1*/(undefined); With the above, |
any
shows as union in signature quickinfo but any
in parameter quickinfo
@sandersn In that case, it’s not true that |
The comment was left over from the original repro, because the original author wanted |
Repro based on the one by @mackuba
Compile with
noImplicitAny: false
andcheckJs: true
Expected:
Quickinfo at
/*1*/
isfunction create(o: any): void
Actual:
function create(o: object | null): void
Note:
The text was updated successfully, but these errors were encountered: