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.
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
Support unbound generic types in 'nameof' operator. #75368
Support unbound generic types in 'nameof' operator. #75368
Changes from 38 commits
b363549
f1f276b
d5d1423
f16971d
6d9a068
b4ff542
092b89c
d0b2d12
2d0155a
db46266
074bd23
52dd592
08e46f4
5f1fd05
bbdb37e
2198c85
ce2286a
116d579
da8e09e
3147497
1df770b
10b1414
5a695dc
4fcadd9
7aff344
f006bbb
74a3fe0
a671848
ae6727f
74bdd91
7a6328a
cf0df29
5af3f7a
48688a5
d0b7fa5
13e7eba
1e6366f
739a4ef
401ec47
9feec81
6f6e987
9497a5e
7ed0bfe
30c1a45
efeea4c
f77d4d0
0a3e50a
21d4a4e
0be4c20
a0e8e13
4d19b86
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always had to be an ExpressionSyntax. Making strongly typed and to match the sig of OpenTypeVisitor.VisitThis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extracted out of TypeOfBinder so it can be used by TypeOfBinder and NameOfBinder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
VisitFunctionPointerType
be overridden as well? #ClosedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. @333fred do function pointers need special handling here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: i've added some typeof and nameof tests taht exercise func-ptrs. The results seem expected to me. But i wouldn't mind SMEs here validating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've played with the change a bit and looked through the logic, and I can't see a scenario where it should matter; since we use
DefaultVisit
for the function pointer, no nested generic types will be marked as allowed. And for any containers, it seems that the following should always hold:IsUnboundGenericName
won't be true for something likeDictionary<,delegate*<List<>>
)I think that covers all the possibilities, so I don't expect there to be any issues. However, @CyrusNajmabadi, please add a test with 3 generics used like this:
C<, delegate*<int>, List<>>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@333fred tests added. test results seemed sensible to me, so i'm moving forward with submitting this. tnx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to sibling type so it could be shared.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.