Skip to content
New issue

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

Slightly improve missing property errors #28298

Merged
merged 8 commits into from
Nov 12, 2018

Conversation

weswigham
Copy link
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
Member Author

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

@weswigham
Copy link
Member Author

@DanielRosenwasser Fixed~

@@ -11,6 +10,6 @@ tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments3.ts(7,35):

var d = f(a, b, u2 => u2.b, t2 => t2);
~~
!!! 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
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.

tests/baselines/reference/typeAssertions.errors.txt Outdated Show resolved Hide resolved
Copy link
Member

@DanielRosenwasser DanielRosenwasser left a comment

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.

@weswigham weswigham merged commit 11eee2b into microsoft:master Nov 12, 2018
@weswigham weswigham deleted the better-missing-properties-error branch November 12, 2018 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants