Checking the return type of a method

I have an IMethodDeclaration in hand, and I would like to check if its return type is void. How do I do this?
1 comment
Comment actions Permalink

You should be able to check methodDeclaration.DeclaredElement.ReturnType.IsVoid(), using the PredefinedTypeExtensions extension methods, and where ReturnType is defined on the declared element's IParametersOwner.


Please sign in to leave a comment.