You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version Used:
.NET SDK (reflecting any global.json):
Version: 6.0.400
Commit: 7771abd614
Steps to Reproduce:
Create a source generator
Create an attribute accepting an open generic type
Retrieve the provided open generic type parameter from the semantic model
Try to obtain type information about the types members, interfaces or base types
Expected Behavior:
The type symbol should return the methods using the type parameters instead of specific types, just like in normal C# where we can have generic method definitions.
Actual Behavior:
The GetMembers() method does not return anything, same for interfaces and base types which makes this symbol kind of useless.
The text was updated successfully, but these errors were encountered:
After a long while of debugging and trying to udnerstand how this works I found out, that the OriginalDefinition of a TypeSymbol marked as IsUnboundGenericType HAS all of the members, the documentation of the IsUnboundGenericType property however only tells you this:
"An unbound generic type yields null for its BaseType and an empty result for its Interfaces."
It should be "...empty results for interfaces and members" and provide you with a hint to OriginalDefinition where you can actually get all of the correct type information.
Not sure though why bound generic types can show you the members but unbound can not. Also if there is a difference, why do bound generic types not substitute the generic type parameters for the provided ones.
I would prefer a consistent behavior for unbound generic types instead of this inconvenience :)
Version Used:
.NET SDK (reflecting any global.json):
Version: 6.0.400
Commit: 7771abd614
Steps to Reproduce:
Expected Behavior:
The type symbol should return the methods using the type parameters instead of specific types, just like in normal C# where we can have generic method definitions.
Actual Behavior:
The GetMembers() method does not return anything, same for interfaces and base types which makes this symbol kind of useless.
The text was updated successfully, but these errors were encountered: