Skip to content

[vinyl][vinyl-file] Fix 5.5 nightly errors #69319

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

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

gabritto
Copy link
Contributor

microsoft/TypeScript#57341 got merged, which causes this library to have errors on the methods that override methods that have a this is X type predicate as return type.

Similar to what TypeScript already did for non-this type predicates, a function or method is only assignable to another one that has a this type predicate return type if it also has a type predicate return type. Example:

interface Animal {
    isDog(): this is Dog;
    isAnimal(x: unknown): x is Animal;
    isCat(): this is Cat;
}

interface Dog extends Animal {
    isDog(): boolean; // error starting with ts 5.5
    isAnimal(x: unknown): boolean; // already an error
    isCat(): this is Cat; // ok
}

interface Cat extends Animal {}

@gabritto gabritto requested a review from vvakame as a code owner April 10, 2024 03:13
@typescript-bot
Copy link
Contributor

typescript-bot commented Apr 10, 2024

@gabritto Thank you for submitting this PR!

This is a live comment which I will keep updated.

2 packages in this PR

Code Reviews

Because this PR edits multiple packages, it can be merged once it's reviewed by a DT maintainer.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ A DT maintainer needs to approve changes which affect more than one package

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 69319,
  "author": "gabritto",
  "headCommitOid": "f84a6cd4e48cdccbe0bd7b179001c79045cf1e1f",
  "mergeBaseOid": "07c771f1e113e2ebcd6a88778555883f22166ab3",
  "lastPushDate": "2024-04-10T03:13:42.000Z",
  "lastActivityDate": "2024-04-15T18:21:25.000Z",
  "mergeOfferDate": "2024-04-15T18:22:08.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Popular",
  "pkgInfo": [
    {
      "name": "vinyl-file",
      "kind": "edit",
      "files": [
        {
          "path": "types/vinyl-file/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "cleanchedFist"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "vinyl",
      "kind": "edit",
      "files": [
        {
          "path": "types/vinyl/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "vvakame",
        "thorn0"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "andrewbranch",
      "date": "2024-04-15T18:21:25.000Z",
      "isMaintainer": true
    }
  ],
  "mainBotCommentID": 2046470556,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Untested Change This PR does not touch tests labels Apr 10, 2024
@typescript-bot
Copy link
Contributor

typescript-bot commented Apr 10, 2024

🔔 @cleanchedFist @vvakame @thorn0 — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Apr 10, 2024
@typescript-bot
Copy link
Contributor

@gabritto The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review.

@gabritto gabritto changed the title [vinyl] Fix 5.5 nightly errors [vinyl][vinyl-file] Fix 5.5 nightly errors Apr 10, 2024
@typescript-bot typescript-bot added Edits multiple packages and removed The CI failed When GH Actions fails labels Apr 10, 2024
Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

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

I’ll merge soon unless I hear any objections from package owners.

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Apr 15, 2024
@andrewbranch andrewbranch merged commit 0c50781 into DefinitelyTyped:master Apr 15, 2024
@gabritto gabritto deleted the fixVinyl branch April 15, 2024 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Edits multiple packages Maintainer Approved Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner Untested Change This PR does not touch tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants