Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

adjacent-overload-signatures false positive with symbol names #1831

Closed
janslow opened this issue Dec 7, 2016 · 0 comments · Fixed by #1848
Closed

adjacent-overload-signatures false positive with symbol names #1831

janslow opened this issue Dec 7, 2016 · 0 comments · Fixed by #1848

Comments

@janslow
Copy link
Contributor

janslow commented Dec 7, 2016

Bug Report

  • TSLint version: 4.0.2
  • TypeScript version: 2.0.10
  • Running TSLint via: CLI

TypeScript code being linted

class Foo {
  readonly [Symbol.toStringTag] = 'Foo';

  bar() {
    throw new Error();
  }

  [Symbol.iterator]() {
    throw new Error();
  }
}

with tslint.json configuration:

{
  "rules": {
    "adjacent-overload-signatures": true
  }
}

Actual behavior

The adjacent-overload-signatures rule appears to coerce method names which are symbols (e.g., Symbol.iterator) into the "undefined", so it can't thinks they are overloads instead of separate methods.

src/test.ts[8, 3]: All 'undefined' signatures should be adjacent

Expected behavior

The rule should not raise an error, as they are separate methods, not overloads.

@janslow janslow changed the title adjacent-overload-signatures rule doesn't handle symbol names adjacent-overload-signatures false positive with symbol names Dec 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants