Closed monkey0506 closed 1 month ago
The reason this is failing is because GenericSymbolReferenceTree
doesn't return any symbols that aren't generic, and INativeAction
and IUnmanagedAction
are not generic.
Instead, we should add a separate SyntaxValueProvider
to discover references to these two interfaces' factory methods and create the MethodReference
s for them as an additional step.
We can minimize the number of additional symbols we need to find by checking (in the syntax provider predicate) for a MemberAccessExpressionSyntax
whose Expression
is an IdentifierNameSyntax
whose Identifier
matches the name of the interface. The Name
of the MemberAccessExpressionSyntax
should be "FromAction" or "FromFunctionPointer". The MemberAccessExpressionSyntax
should also have a grandparent node that is an InvocationExpressionSyntax
. After filtering the nodes by this criteria, the first transform can use the IOperation
API to perform a final validation of the INamedTypeSymbol
containing the invoked method.
Fixed by #41.
Describe the issue
The
INativeAction
andIUnmanagedAction
interfaces without type arguments are failing to generate source for their respective factory methods.Proposed solution
The root cause is indeterminate at this time. These interfaces should generate source that mirrors what is generated for the interfaces that have type arguments.
This may be a shortcoming at practically any point in the generator pipeline, and will require further investigation.
Additional considerations
None.