GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix union type parameter inference by ahejlsberg · Pull Request #5895 · microsoft/TypeScript

Conversation

@ahejlsberg

@ahejlsberg Anders Hejlsberg (ahejlsberg) commented Dec 2, 2015

Copy link
Copy Markdown
Member

Fixes #5861.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Anders Hejlsberg (ahejlsberg) added 2 commits December 2, 2015 10:23
@ahejlsberg
Ensure that different type parameters are never considered identical
181c10a
@ahejlsberg
Adding regression test
561360d
@msftclas Microsoft Contribution License Agreements (msftclas) added the cla-not-required label Dec 2, 2015
@ahejlsberg

Anders Hejlsberg (ahejlsberg) commented Dec 2, 2015

Copy link
Copy Markdown
Member Author

A bit more context on the fix. We previously would consider two type parameters identical if they were different type parameters but had identical constraints (but, oddly, wouldn't consider them assignable to each other). This of course isn't right, but it sort of worked when we were comparing constraints in generic signatures which was really the only time it would come up. However, we now sometimes need to compare type parameters for identity during union and intersection type inference (because of #5738) and we want different type parameters to actually be considered different, so we have to remove this logic. The effect is that we won't check whether type parameter constraints are identical when comparing generic signatures, as explained here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

yuit
yuit reviewed Dec 2, 2015
View reviewed changes
Comment thread tests/cases/compiler/unionTypeParameterInference.ts Outdated

@yuit Yui (yuit) Dec 2, 2015

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

could you remove the error comment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sandersn

Nathan Shively-Sanders (sandersn) commented Dec 2, 2015

Copy link
Copy Markdown
Member

Could you also add a test for the case that type parameter constraints are not identical, but we don't check? It would be good to have as documentation in case do we go back and decide to start checking.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Anders Hejlsberg (ahejlsberg) added 2 commits December 2, 2015 15:41
@ahejlsberg
Removing comment from test
3e6d40f
@ahejlsberg
Adding test to demonstrate limits of signature identity checking
86d4a4c
@sandersn

Nathan Shively-Sanders (sandersn) commented Dec 2, 2015

Copy link
Copy Markdown
Member

👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Anders Hejlsberg (ahejlsberg) added a commit that referenced this pull request Dec 3, 2015
@ahejlsberg
Merge pull request #5895 from Microsoft/unionTypeParameterInference
3bb5dc6
Fix union type parameter inference
@ahejlsberg
Anders Hejlsberg (ahejlsberg) merged commit 3bb5dc6 into master Dec 3, 2015
@ahejlsberg
Anders Hejlsberg (ahejlsberg) deleted the unionTypeParameterInference branch December 3, 2015 20:23
@mhegazy Mohamed Hegazy (mhegazy) mentioned this pull request Dec 3, 2015
Massive slowdown in compiling complicated union types #5849
Closed
Anders Hejlsberg (ahejlsberg) added a commit that referenced this pull request Dec 3, 2015
@ahejlsberg @vladima
Merge pull request #5895 from Microsoft/unionTypeParameterInference
ccb4326
Fix union type parameter inference
Conflicts:
	src/compiler/checker.ts
@vladima Vladimir Matveev (vladima) mentioned this pull request Dec 3, 2015
Port union reduction to 1.7 #5919
Merged
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@ahejlsberg @sandersn @yuit @msftclas
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.