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

Extends shorthand < and negated forms #907

Merged
merged 3 commits into from
Jan 3, 2024
Merged

Extends shorthand < and negated forms #907

merged 3 commits into from
Jan 3, 2024

Conversation

edemaine
Copy link
Collaborator

@edemaine edemaine commented Jan 2, 2024

As requested by @esthedebeste on Discord, this PR adds:

  • < shorthand for extends in type conditions, matching existing support in classes
  • Negated forms not extends, !<, and not< (though the last is a little ugly), via the trick of swapping the then/else clauses.
  • Tighten some __ and change a NotDedented from last PR to IndentedFurther. Otherwise we accidentally think there is extension going on in e.g. this test:
    type T = undefined
    <div />

Support for unless ... not extends ... is my first legit use of logical xor. 😸

@edemaine edemaine merged commit 6f34d26 into main Jan 3, 2024
2 of 3 checks passed
@edemaine edemaine deleted the extends branch January 3, 2024 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants