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.
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').
This seems like a bug?
Thanks and keep up the good work, I can't wait for version 2.0.
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
anysince the compiler don't know anything about the type.Actual behavior:
Instead, I get
undefinedwhich 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.