Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Exclude arrays and tuples from full intersection property check #38395

Merged
merged 2 commits into from
May 7, 2020

Conversation

ahejlsberg
Copy link
Member

With this PR we exclude array and tuple types from the extra check introduced in #37195.

Fixes #38348.

@DanielRosenwasser
Copy link
Member

@typescript-bot cherry-pick this to release-3.9

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 7, 2020

Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into release-3.9 on this PR at 9019e39. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

Hey @DanielRosenwasser, I've opened #38402 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request May 7, 2020
Component commits:
6fe4be2 Exclude arrays and tuples from full intersection property check

9019e39 Add regression test
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.

I'm trying to think of a reasonable type that could defeat the check but

  1. No, I just can't think of one thanks to how "properties" on tuples work
  2. Even if I thought of one, I can't imagine why you'd end up here and feel like you "lost out" on this check.

Even though I'm not a fan of the types that were constructed, @NWilson put it best: it is what it is, and it doesn't look like too much work to revert back to the pre-3.9 behavior.

@ahejlsberg ahejlsberg merged commit 0091fd6 into master May 7, 2020
DanielRosenwasser added a commit that referenced this pull request May 8, 2020
Component commits:
6fe4be2 Exclude arrays and tuples from full intersection property check

9019e39 Add regression test

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
cangSDARM added a commit to cangSDARM/TypeScript that referenced this pull request May 12, 2020
* upstream/master: (54 commits)
  LEGO: check in for master to temporary branch.
  LEGO: check in for master to temporary branch.
  Fix for jsdoc modifiers on constructor params (microsoft#38403)
  Improve assert message in binder (microsoft#38270)
  fix broken regex on "src/services/completions.ts#getCompletionData" (microsoft#37546)
  report error for duplicate @type declaration (microsoft#38340)
  fix(38073): hide 'Extract to function in global scope' action for arrow functions which use 'this' (microsoft#38107)
  Update user baselines (microsoft#38472)
  Update user baselines (microsoft#38405)
  Changed template strings to emit void 0 instead of undefined (microsoft#38430)
  Fix js missing type arguments on existing nodes and jsdoc object literal declaration emit (microsoft#38368)
  LEGO: check in for master to temporary branch.
  Make isDynamicFileName available publicly (microsoft#38269)
  LEGO: check in for master to temporary branch.
  LEGO: check in for master to temporary branch.
  Exclude arrays and tuples from full intersection property check (microsoft#38395)
  Fix crash caused by assertion with evolving array type (microsoft#38398)
  Update user baselines (microsoft#38128)
  LEGO: check in for master to temporary branch.
  moveToNewFile: handle namespace imports too
  ...

# Conflicts:
#	src/compiler/types.ts
#	src/compiler/utilities.ts
@jakebailey jakebailey deleted the fix38348 branch November 7, 2022 17:36
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: Intersection of array and tuple not assignable to tuple
3 participants