Skip to content

Fix incorrectly reported 2689 error#63072

Closed
Andarist wants to merge 1 commit intomicrosoft:mainfrom
Andarist:fix/confusing-extends-implements-error
Closed

Fix incorrectly reported 2689 error#63072
Andarist wants to merge 1 commit intomicrosoft:mainfrom
Andarist:fix/confusing-extends-implements-error

Conversation

@Andarist
Copy link
Copy Markdown
Contributor

spotted by @LukeAbby

current confusing error:

    class baz<B> {}
    interface foo<A> {
      new (): typeof baz
    }

    const bar = (foo<string>)<number>
                 ~~~
!!! error TS2689: Cannot extend an interface 'foo'. Did you mean 'implements'?

@typescript-bot
Copy link
Copy Markdown
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jan 30, 2026
case SyntaxKind.ExpressionWithTypeArguments:
if (isEntityNameExpression((node as ExpressionWithTypeArguments).expression)) {
return (node as ExpressionWithTypeArguments).expression as EntityNameExpression;
if (isExpressionWithTypeArgumentsInClassExtendsClause(node) && isEntityNameExpression(node.expression)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This func does some goofy stuff with JSDoc, but maybe that's fine

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Weird, Corsa doesn't have this func at all. Wonder why its callers are gone

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This func does some goofy stuff with JSDoc, but maybe that's fine

Yeah, I've seen that but assumed it's fine and won't hurt this.

Weird, Corsa doesn't have this func at all. Wonder why its callers are gone

I'll take a look at Corsa's implementation later but FWIW, it suffers from the same issue: TS GO playground

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, it totally does, I just went to search for this func name and was surprised to see it not existing!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Weird, Corsa doesn't have this func at all. Wonder why its callers are gone

It has c.getEntityNameForExtendingInterface, c.checkAndReportErrorForExtendingInterface, ast.IsEntityNameExpression and ast.IsExpressionWithTypeArgumentsInClassExtendsClause. Maybe you have missed one of those? I don't know which one you referred to as missing.

@github-project-automation github-project-automation bot moved this from Not started to Done in PR Backlog Mar 24, 2026
@typescript-bot
Copy link
Copy Markdown
Collaborator

With 6.0 out as the final release vehicle for this codebase, we're closing all PRs that don't fit the merge criteria for post-6.0 patches. If you think this was a mistake and this PR fits the post-6.0 patch criteria, please post to the 6.0 iteration issue with details (specifically, which PR and which patch criteria it satisfies).

Next steps for PRs:

  • For crash bugfixes or language service improvements, PRs are currently accepted at the typescript-go repo
  • Changes to type system behavior should wait until after 7.0, at which point mainline TypeScript development will resume in this repository with the Go codebase
  • Library file updates (lib.d.ts etc) continue to live in this repo or the DOM Generator repo as appropriate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants