TypeScript Version: 2.6.1
Code
Minimal:
null()
Actual real-world mistake:
str !== 'hello' && thing !== null (
<div>blah</div>
)
Expected behavior:
Clear error to the effect of:
Invoking 'null' as a function
Actual behavior:
Technically correct but slightly misleading error:
Object is possibly 'null'
To be consistent, reasonable error message text would be something to the effect of
Cannot invoke an object which is possibly 'null'.
Cannot invoke an object which is possibly 'undefined'.
Cannot invoke an object which is possibly 'null' or 'undefined'.
I have sent a PR (#20157) for this issue. I was able to pass all the tests locally. I'm hoping that there will be no issues in CI. Please let me know if anything is wrong (This is my first PR for the TS compiler :tada:).
thanks @remojansen!
Most helpful comment
thanks @remojansen!