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

Follow up on addition of InternalSpecialType #72704

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

AlekseyTs
Copy link
Contributor

Related to #72646.

@AlekseyTs AlekseyTs added Concept-API This issue involves adding, removing, clarification, or modification of an API. Area-Compilers labels Mar 25, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Mar 25, 2024
@AlekseyTs AlekseyTs marked this pull request as ready for review March 25, 2024 04:07
@AlekseyTs AlekseyTs requested a review from a team as a code owner March 25, 2024 04:07
@AlekseyTs
Copy link
Contributor Author

@333fred, @jcouv, @dotnet/roslyn-compiler Please review

@AlekseyTs
Copy link
Contributor Author

@jcouv, @dotnet/roslyn-compiler For the second review

@@ -645,6 +645,8 @@ private static bool TryGetSpecialTypeMethod(SyntaxNode syntax, SpecialMember spe

public override BoundNode VisitTypeOfOperator(BoundTypeOfOperator node)
{
Debug.Assert(node.Type.ExtendedSpecialType == InternalSpecialType.System_Type ||
Copy link
Member

@jcouv jcouv Mar 25, 2024

Choose a reason for hiding this comment

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

node.Type.ExtendedSpecialType == InternalSpecialType.System_Type

I didn't follow. How do we get to this case (using InternalSpecialType.System_Type in typeof)?
I wasn't able to find a test that hits this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't follow. How do we get to this case (using InternalSpecialType.System_Type in typeof)?

This is a very common case of System.Type defined in mscorlib. The type of typeof is System.Type.

Copy link
Member

Choose a reason for hiding this comment

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

Resolved offline, what I was missing was that you can get a type marked as SpecialType = InternalSpecialType.System_Type even though we don't have any special-type lookups in the code for it. We use well-known type lookup and generally happen to find the type from corlib, which will be marked as special type.
Thanks for clarification @AlekseyTs

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

Done with review pass (iteration 1)

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (iteration 1)

@jcouv jcouv self-assigned this Mar 25, 2024
@AlekseyTs AlekseyTs merged commit 48812dd into dotnet:main Mar 25, 2024
30 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 25, 2024
@RikkiGibson RikkiGibson modified the milestones: Next, 17.10 P3 Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Concept-API This issue involves adding, removing, clarification, or modification of an API. untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants