Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Jan 24, 2025

Fixes issue reported by partner.

Note: nested types are fine and still can be converted (and we have tests for this).

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner January 24, 2025 20:31
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 24, 2025
@CyrusNajmabadi CyrusNajmabadi changed the title DO not offer to convert typeof to nameof on a generic type Do not offer to convert typeof to nameof on a generic type Jan 24, 2025
// it's fine if an outer part of the name is generic (like `typeof(List<int>.Enumerator)`). as that will be
// convertible to `nameof(List<>.Enumerator)`. So we only need to check the type arguments directly on the type
// here, not on any containing types.
return namedType.TypeArguments.Length == 0;
Copy link
Member Author

Choose a reason for hiding this comment

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

note: we have tests for the non-generic nested in a generic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants