-
Notifications
You must be signed in to change notification settings - Fork 4k
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
More generic attributes tests #55202
More generic attributes tests #55202
Conversation
@@ -2108,6 +2108,22 @@ static void Main(string[] args) | |||
Assert.NotNull(symbolInfo.Symbol); | |||
} | |||
|
|||
// TODO: it's not clear that this test is meaningful. |
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.
TODO?
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.
Yeah, test plan suggests including a LookupSymbols test, but I'm genuinely not sure what would be meaningful here. @333fred in case you have any suggestions.
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.
Have a test with a constructor that takes a parameter of type T, and make sure that you can get constructor information (I can't remember whether you need to use GetSymbolInfo
or LookupSymbols
for that.
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.
For LookupSymbols
we'd want a test like LookupConstrAndDestr
with Attr1</*bind*/string/*bind*/>
to confirm we can tell the IDE symbols are in scope there.
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.
Done with review pass (iteration 6)
Marking as draft for now to make room in the review queue. Ping when ready for another look |
var node = tree.GetRoot().DescendantNodes().OfType<AttributeSyntax>().Single(); | ||
var symbol = model.GetSymbolInfo(node); | ||
Assert.Equal("Attr1<System.String>..ctor(System.String t)", symbol.Symbol.ToTestDisplayString()); | ||
} |
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.
Curious: have you tried a Attr1<Attr1<string>>
?
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.
Done with review pass (iteration 8). Just one remaining suggested test to add, thx
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.
LGTM Thanks (iteration 9)
Integration test failures are not related to these changes so just merging. |
Related to test plan #36285
Related to #55190
This adds coverage for everything considered blocking. Note that there is an issue when an attribute constructor parameter is of a type parameter type in its original definition, even when the parameter is a closed type in its usage. Currently I think this might be a runtime bug but we will have to dig in more closely to be sure.