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

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

Closed
boris-petrov opened this issue Apr 15, 2019 · 1 comment
Closed
Labels
bug Something isn't working good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@boris-petrov
Copy link

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.

@boris-petrov boris-petrov added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Apr 15, 2019
@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for maintainers to take a look labels Apr 15, 2019
@bradzacher bradzacher added the good first issue Good for newcomers label Jul 27, 2019
@bradzacher
Copy link
Member

Fixed in #440

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants