Skip to content

Slightly improve missing property errors - #28298

Merged
Wesley Wigham (weswigham) merged 8 commits into
microsoft:masterfrom
weswigham:better-missing-properties-error
Nov 12, 2018
Merged

Slightly improve missing property errors#28298
Wesley Wigham (weswigham) merged 8 commits into
microsoft:masterfrom
weswigham:better-missing-properties-error

Conversation

@weswigham

Copy link
Copy Markdown
Member

Fixes #26423

Removes a layer from missing property errors that aren't excess property errors and lists multiple properties when multiple properties are missing, up to a limit.

@weswigham

Copy link
Copy Markdown
Member Author

cc Daniel Rosenwasser (@DanielRosenwasser) who should look over the copy and decide if he likes it~

Comment thread tests/baselines/reference/tsxAttributeResolution1.errors.txt Outdated
Comment thread tests/baselines/reference/tsxInvokeComponentType.errors.txt Outdated
@weswigham

Copy link
Copy Markdown
Member Author

Comment thread tests/baselines/reference/argumentExpressionContextualTyping.errors.txt Outdated
Comment thread tests/baselines/reference/checkJsxChildrenProperty2.errors.txt Outdated
~~
!!! error TS2322: Type 'A' is not assignable to type 'B'.
!!! error TS2322: Property 'b' is missing in type 'A'.
!!! error TS2737: Property 'b' is missing in type 'A' but present in type 'B'.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of me feels like we lose some context on why we're reporting the error message when it's the first elaboration.

Comment thread tests/baselines/reference/typeAssertions.errors.txt Outdated
Comment thread tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt
Comment thread src/compiler/diagnosticMessages.json Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but I filed #28491 as a follow-up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants