We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
undefined
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
TypeScript Version:
1.7.5 / nightly (1.9.0-dev.20160221)
Code
Lets say I want to export some empty arrays:
// test.ts export default { foo: [], bar: [], baz: [] }
and I want to generate a definition file for it:
> tsc test.ts --module commonjs -d
Expected behavior:
declare var _default: { foo: any[]; bar: any[]; baz: any[]; }; export default _default;
I expect the type to be any since the compiler don't know anything about the type.
any
Actual behavior:
declare var _default: { foo: undefined[]; bar: undefined[]; baz: undefined[]; }; export default _default;
Instead, I get undefined which is an invalid type (Error: can not find name 'undefined').
Error: can not find name 'undefined'
This seems like a bug?
Thanks and keep up the good work, I can't wait for version 2.0.
The text was updated successfully, but these errors were encountered:
Perhaps the same underlying cause as #6524
Sorry, something went wrong.
It sounds like a default export should acquire the widened type of its RHS. The same issue exists for export = declarations.
export =
export = { foo: [] }
Fix #7173: Widen the type do the defualt export expression before wri…
baa0401
…ting it out.
mhegazy
Successfully merging a pull request may close this issue.
TypeScript Version:
1.7.5 / nightly (1.9.0-dev.20160221)
Code
Lets say I want to export some empty arrays:
and I want to generate a definition file for it:
Expected behavior:
I expect the type to be
any
since the compiler don't know anything about the type.Actual behavior:
Instead, I get
undefined
which is an invalid type (Error: can not find name 'undefined'
).This seems like a bug?
Thanks and keep up the good work, I can't wait for version 2.0.
The text was updated successfully, but these errors were encountered: