Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[restrict-plus-operands] False positive when using Extract and generics #431

Copy link
Copy link
Closed
@boris-petrov

Description

@boris-petrov
Issue body actions

I'm using the latest version of all packages (1.6.0).

function x<T>(z: Extract<keyof T, string>): string {
  return z + '__';
}

This warns that the addition is unsafe but it shouldn't. It works correctly if it's not keyof T but keyof obj where obj is some object, i.e. generics are not involved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomerspackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.