Skip to content

Instantly share code, notes, and snippets.

@controlflow
Last active November 21, 2019 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save controlflow/80ca47fa7ff1938732e9a42121d1f70a to your computer and use it in GitHub Desktop.
Save controlflow/80ca47fa7ff1938732e9a42121d1f70a to your computer and use it in GitHub Desktop.
var elementType = GetElementType(declaredElement);
if (elementType is IDeclaredType declaredType)
{
var delegateInvokeMethod = declaredType.GetTypeElement<IDelegate>()?.InvokeMethod;
if (delegateInvokeMethod != null)
{
var returnType = declaredType.GetSubstitution()[delegateInvokeMethod.ReturnType];
if (returnType.IsValid())
{
var elementType = GetElementType(declaredElement);
if (elementType is IDeclaredType (IDelegate { InvokeMethod: { ReturnType: returnType } }, subtitution))
{
var returnType1 = subtitution[returnType];
if (returnType1.IsValid())
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment