We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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:
nightly (1.9.0-dev.20160623-1.0)
Code
let foo = []; foo.push('x');
Expected behavior:
No errors, TypeScript should infer the type any[] for the variable foo.
any[]
foo
Actual behavior:
tsc without any command line option behaves as expected, but when used with --strictNullChecks it emits the error:
--strictNullChecks
foo.ts(2,10): error TS2345: Argument of type 'string' is not assignable to parameter of type 'never'.
The text was updated successfully, but these errors were encountered:
Working in 1.9.0-dev.20160624-1.0
Sorry, something went wrong.
Failing for me as described in current master
@RyanCavanaugh I had misconfigured project. I can indeed reproduce the error. Sorry for the confusion.
This is working as intended. The inferred type for foo is never[] because we don't widen types in --strictNullChecks mode. Full details in #8944.
never[]
No branches or pull requests
TypeScript Version:
nightly (1.9.0-dev.20160623-1.0)
Code
Expected behavior:
No errors, TypeScript should infer the type
any[]
for the variablefoo
.Actual behavior:
tsc without any command line option behaves as expected, but when used with
--strictNullChecks
it emits the error:The text was updated successfully, but these errors were encountered: