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

Fix up handling for partially written generics #60789

Merged

Conversation

jasonmalinowski
Copy link
Member

@jasonmalinowski jasonmalinowski commented Apr 15, 2022

We have some code to handle partially written generics where it could be a type but the compiler is still parsing it as an expression based on context. This code needed updating for the new unsigned shift operator, but while doing and adding tests I discovered it was broken if you called it while you were in the middle of what the compiler parsed as a shift operator. This fixes that issue too.

@jasonmalinowski jasonmalinowski force-pushed the update-partial-generic-handling branch from b1baaee to 7886251 Compare April 16, 2022 00:33
@jasonmalinowski jasonmalinowski changed the title WIP: Update partial generic handling Fix up handling for partially written generics Apr 16, 2022
@jasonmalinowski jasonmalinowski self-assigned this Apr 16, 2022
@jasonmalinowski jasonmalinowski marked this pull request as ready for review April 16, 2022 00:34
@jasonmalinowski jasonmalinowski requested a review from a team as a code owner April 16, 2022 00:34
Comment on lines -114 to -115
stack++;
goto case SyntaxKind.GreaterThanToken;
Copy link
Member Author

Choose a reason for hiding this comment

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

FWIW, I did a test CI run seeing which tests had a >> token and returned true from this function -- we didn't have any until the tests I added it seems.

We have some code to handle partially written generics where it could be
a type but the compiler is still parsing it as an expression based on
context. This code needed updating for the new unsigned shift operator,
but while doing and adding tests I discovered it was broken if you
called it while you were in the middle of what the compiler parsed as a
shift operator. This fixes that issue too.
@jasonmalinowski jasonmalinowski force-pushed the update-partial-generic-handling branch from 7886251 to c4e6ef5 Compare April 18, 2022 17:58
@jasonmalinowski jasonmalinowski merged commit b73e176 into dotnet:main Apr 18, 2022
@ghost ghost added this to the Next milestone Apr 18, 2022
@jasonmalinowski jasonmalinowski deleted the update-partial-generic-handling branch April 18, 2022 19:32
@dibarbet dibarbet modified the milestones: Next, 17.3.P1 Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants