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

Add a proper non-inferrable type #30856

Merged
merged 4 commits into from Apr 11, 2019
Merged

Add a proper non-inferrable type #30856

merged 4 commits into from Apr 11, 2019

Conversation

ahejlsberg
Copy link
Member

Fixes #30685.

@RyanCavanaugh
Copy link
Member

@typescript-bot test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 11, 2019

Heya @RyanCavanaugh, I've started to run the extended test suite on this PR at 791f56d. You can monitor the build here. It should now contribute to this PR's status checks.

@RyanCavanaugh
Copy link
Member

RWC shows two new errors (in one file) and one instance where a single large error became three smaller errors. It's not obvious without a full enlistment what's going on as the target type is defined outside the erroring file.

});

const myReducer2 = combineReducers({
>myReducer2 : Reducer<{ combined: { foo: any; }; }>
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this supposed to be Reducer<{ combined: { foo: number; }; }>?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's supposed to be Reducer<{ combined: { foo: Reducer<number> } }>, but we never elaborate more than one level of reverse mapped types, thus the any.

Copy link
Member

Choose a reason for hiding this comment

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

Ahhhhhh, right. I thought we printed those with ... now, rather than any, but that may only be for quickinfo...

@ahejlsberg
Copy link
Member Author

@RyanCavanaugh Looked through the new RWC errors. They all look good. The case of one error turning into three is because we're now elaborating into the object literals instead of reporting at the top level. The two new errors are correct excess property checks that previously were masked by bad inferences.

@ahejlsberg ahejlsberg merged commit 4230270 into master Apr 11, 2019
@ahejlsberg ahejlsberg deleted the nonInferrableType branch April 11, 2019 21:45
@RyanCavanaugh RyanCavanaugh added this to This Week in Design Meeting Docket Apr 15, 2019
RyanCavanaugh pushed a commit to RyanCavanaugh/TypeScript that referenced this pull request Apr 16, 2019
RyanCavanaugh added a commit that referenced this pull request Apr 16, 2019
* Merge pull request #30856 from Microsoft/nonInferrableType

Add a proper non-inferrable type

* Merge pull request #30963 from Microsoft/fixObjectFlagsPropagation

Fix object flags propagation
@DanielRosenwasser DanielRosenwasser removed this from This Week in Design Meeting Docket Apr 26, 2019
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.

None yet

4 participants