Skip to content

fix where clauses in type aliases and allow empty where clauses #259

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

Merged

Conversation

m4rch3n1ng
Copy link
Contributor

@m4rch3n1ng m4rch3n1ng commented Mar 1, 2025

according to the reference, type aliases can also have a where_clause in front of the = in addition to one after it. this is fixed in 42dce44.

and also according to the reference, where clauses can also be empty. i didn't just change the sepBy1 to a sepBy, because that would allow a trailing comma without any rules, which is not allowed. this is fixed in f2be460.

diff for #229:

this is gonna be so diff trust me
--- .tmp/list.txt	2025-02-28 16:16:12.002933806 +0100
+++ .tmp/list.txt.type-alias-where-before-assignment.optional-where-clause	2025-03-01 01:13:03.203344726 +0100
@@ -21,7 +21,6 @@
 tests/mir-opt/coroutine_tiny.rs
 tests/mir-opt/tail_call_drops.rs
 tests/pretty/delegation.rs
-tests/pretty/issue-25031.rs
 tests/pretty/macro.rs
 tests/pretty/stmt_expr_attributes.rs
 tests/pretty/yeet-expr.rs
@@ -42,7 +41,6 @@
 tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.rs
 tests/ui/associated-type-bounds/return-type-notation/path-self-qself.rs
 tests/ui/associated-type-bounds/return-type-notation/path-works.rs
-tests/ui/associated-type-bounds/type-alias.rs
 tests/ui/associated-types/default-associated-types.rs
 tests/ui/associated-types/issue-25339.rs
 tests/ui/associated-types/issue-32350.rs
@@ -145,7 +143,6 @@
 tests/ui/feature-gates/feature-gate-trivial_bounds-lint.rs
 tests/ui/for-loop-while/loop-break-value.rs
 tests/ui/generic-associated-types/collections.rs
-tests/ui/generic-associated-types/issue-93341.rs
 tests/ui/generic-const-items/assoc-const-AnonConst-ice-108220.rs
 tests/ui/generic-const-items/associated-const-equality.rs
 tests/ui/generic-const-items/basic.rs
@@ -175,7 +172,6 @@
 tests/ui/inline-const/const-match-pat-inference.rs
 tests/ui/inline-const/const-match-pat-range.rs
 tests/ui/inline-const/pat-unsafe.rs
-tests/ui/issues/issue-22471.rs
 tests/ui/issues/issue-26186.rs
 tests/ui/issues/issue-36116.rs
 tests/ui/issues/issue-37051.rs
@@ -313,11 +309,9 @@
 tests/ui/try-block/try-is-identifier-edition2015.rs
 tests/ui/try-trait/yeet-for-option.rs
 tests/ui/try-trait/yeet-for-result.rs
-tests/ui/type-alias-impl-trait/closure_parent_substs.rs
 tests/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
 tests/ui/type-alias-impl-trait/issue-58662-coroutine-with-lifetime.rs
 tests/ui/type-alias-impl-trait/issue-58662-simplified.rs
-tests/ui/type/type-alias-bounds.rs
 tests/ui/type_length_limit.rs
 tests/ui/typeck/auxiliary/tdticc_coherence_lib.rs
 tests/ui/underscore-imports/hygiene-2.rs
@@ -325,5 +319,3 @@
 tests/ui/underscore-method-after-integer.rs
 tests/ui/unsafe-binders/expr.rs
 tests/ui/unsafe-binders/simple.rs
-tests/ui/where-clauses/where-clause-placement-assoc-type-in-impl.rs
-tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.rs

@m4rch3n1ng m4rch3n1ng force-pushed the type-alias-where-clauses branch 2 times, most recently from e98df62 to 001188e Compare March 3, 2025 12:32
@m4rch3n1ng m4rch3n1ng force-pushed the type-alias-where-clauses branch from 001188e to efe16c3 Compare March 5, 2025 21:42
@m4rch3n1ng
Copy link
Contributor Author

rebased this and the other pr

@maxbrunsfeld maxbrunsfeld merged commit 5edb201 into tree-sitter:master Mar 6, 2025
4 checks passed
@maxbrunsfeld
Copy link
Contributor

Sorry you have to rebase so much. At some point, we'll change the workflow so generated files are not checked in, at least on the default branch. Right now it kind of sucks for people who are making lots of PRs.

@m4rch3n1ng m4rch3n1ng deleted the type-alias-where-clauses branch March 6, 2025 00:25
@m4rch3n1ng
Copy link
Contributor Author

m4rch3n1ng commented Mar 6, 2025

lol it's fine, don't have much to do right now anyway and it's not actually that annoying (edit: i'm more worried about your ci minutes lol)

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