Skip to content

Interface cannot override predicate return type with boolean #58202

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

Closed
mjbvz opened this issue Apr 15, 2024 · 2 comments
Closed

Interface cannot override predicate return type with boolean #58202

mjbvz opened this issue Apr 15, 2024 · 2 comments
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Apr 15, 2024

πŸ”Ž Search Terms

  • must be a type predicate

πŸ•— Version & Regression Information

  • This is a crash
  • This changed between versions 5.4.5 and 5.5.0-dev.20240415

⏯ Playground Link

https://www.typescriptlang.org/play?ts=5.5.0-dev.20240415#code/JYOwLgpgTgZghgYwgAgGIHt3IN4CgCQwAzhugBQAeAXMnCAJ4CUNYAFsch6QNy4C+uXKEixEKAEJwoyCBUggAJkTSYcBYqUo06TFlACuEXsj5A

πŸ’» Code

interface Foo {
	isFoo(x: any): this is Foo;
}

interface Bar extends Foo {
	isFoo(x: any): true;
}

πŸ™ Actual behavior

In bar, see:

Signature '(x: any): true' must be a type predicate

πŸ™‚ Expected behavior

No error

Additional information about the issue

Encountering this in the VS Code repo. Seems like an unexpected regression

@gabritto
Copy link
Member

Caused by #57341.

@RyanCavanaugh RyanCavanaugh added the Working as Intended The behavior described is the intended behavior; this is not a bug label Apr 15, 2024
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Working as Intended" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

4 participants