private static IEnumerable <Instruction> _CreateParameterDeclaration(string methodName, ParameterSyntax parameter, int parameterIndex) { if (parameter.Modifiers.Any(modifier => !modifier.IsKind(SyntaxKind.None))) { throw new UnsupportedSyntaxException($"cannot transform method {methodName} because of unsupported parameter syntax {parameter}"); } var parameterName = parameter.Identifier.Text; return(new Instruction[] { new Declaration(parameterName), new Assignment(new VariableExpression(parameterName), new VariableExpression(InvocationExpression.GetParameterIdentifier(methodName, parameterIndex))) }); }