The error "Object is possibly null or undefined" is ambiguous.#49797
Merged
sandersn merged 14 commits intomicrosoft:mainfrom Sep 15, 2022
Merged
The error "Object is possibly null or undefined" is ambiguous.#49797sandersn merged 14 commits intomicrosoft:mainfrom
sandersn merged 14 commits intomicrosoft:mainfrom
Conversation
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request attempts to fix the issue #8274.
The changes made to the diagnostic messages are the following:
When an entity name is found and its total length is shorter than 100 characters, the error messages are replaced with a more explicit equivalent using this entity name.
Object is possibly 'null'.=> TS18047:'{0}' is possibly 'null'.Object is possibly 'undefined'.=> TS18048:'{0}' is possibly 'undefined'.Object is possibly 'null' or 'undefined'.=> TS18049:'{0}' is possibly 'null' or 'undefined'.Object is of type 'unknown'.=> TS18046:'{0}' is of type 'unknown'.In cases which were previously handled by TS2531, TS2532, or TS2533, if the value is explicitly either
nullorundefined:The value '{0}' cannot be used here.Baseline have been updated in order to reflect the changes.
Comments, changes and advice are welcome.
Fixes #8274.
(Note: Updated on September 27th, 2022, for a better overview of the changes)