let a = [];
a.push(0);
The code above compiles fine when
- both
noImplicitAnyandstrictNullChecksare set to true - both
noImplicitAnyandstrictNullChecksare set to false
But it issues an error on the second line when
noImplicitAnyis false andstrictNullChecksis true
The error issued is Argument of type 'number' is not assignable to parameter of type 'never'.
It seems that in the first two cases a is being inferred as a any[], and in the last case it is inferred as a never[], but why does this happen?
If noImplicitAny is false, shouldn't it be able to still infer it as any[]? Conversely, why is it being inferred as any[] in the first case where noImplicitAny is true? It seems that the expected behaviors are reversed somehow...
Check the images attached below for the errors and options used.

