-
Notifications
You must be signed in to change notification settings - Fork 12.9k
error on duplicate symbols in classes #55438
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
error on duplicate symbols in classes #55438
Conversation
@typescript-bot pack this |
Hey @gabritto, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
1 similar comment
@typescript-bot run DT |
Heya @gabritto, I've started to run the regular perf test suite on this PR at 04bd8cb. You can monitor the build here. Update: The results are in! |
Heya @gabritto, I've started to run the diff-based user code test suite on this PR at 04bd8cb. You can monitor the build here. Update: The results are in! |
Heya @gabritto, I've started to run the diff-based top-repos suite on this PR at 04bd8cb. You can monitor the build here. Update: The results are in! |
Heya @gabritto, I've started to run the parallelized Definitely Typed test suite on this PR at 04bd8cb. You can monitor the build here. Update: The results are in! |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@gabritto Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
@gabritto Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
StartupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@gabritto Here are the results of running the top-repos suite comparing Everything looks good! |
Hey @gabritto, the results of running the DT tests are ready. |
module M { | ||
interface I { } | ||
export class C { | ||
[Symbol.iterator]: I; | ||
[Symbol.toPrimitive](x: I) { } | ||
~~~~~~~~~~~~~~~~~~~~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say we'd ideally keep the elaboration "X was also declared here" in the errors, is that possible?
@@ -65,11 +69,19 @@ mappedTypeProperties.ts(40,17): error TS2363: The right-hand side of an arithmet | |||
[P in PlaceType]: any | |||
~~~~~~~~~~~~~~~~ | |||
!!! error TS7061: A mapped type may not declare properties or methods. | |||
~ | |||
!!! error TS2304: Cannot find name 'P'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those seem to be just noise but maybe it's ok to have them as a side effect of the change.
[uniqueSymbol0] = "last"; | ||
~~~~~~~~~~~~~~~ | ||
!!! error TS2300: Duplicate identifier '[uniqueSymbol0]'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to the PR changes, but the error here is way less specific/informative than the comparable one you get in object literals.
Fixes #55163
This is a follow-up of #55193. I was testing whether
getEffectivePropertyNameForPropertyNameNode
should be used more, and it turns out that the answer is yes. It helps identify more duplicate symbol properties.playground