Incorrect handling of types matched as idents #1054
Merged
+51
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The issue was originally discovered on URLO. Minimal example:
The reason for this error is the fact that, after being matched as
ident
, the identifier is not a bare ident anymore, it's asyn::TypeGroup
, which is not handled correctly.I've added the example above as test and modified the
TypeExt::unparenthesized
accordingly. It's entirely possible, however, that there are other places where either explicit match forTypeGroup
or the call tounparenthesized
should be added; I'm just not sure how to generate realistic test cases similar to the one above.Side note: I wasn't able to run tests for this workspace, until I added features
chrono
andchrono-tz
to the invocation. It's likely the consequence of #1010, and I'm not sure whether this is intentional (or desirable).