Methods with MethodKind.Destructor is not supported by the SyntaxGenerator.
Example:
class Object
{
~Object {}
}
Entry point: SyntaxGenerator.cs#L551
var method = (IMethodSymbol)symbol;
+if (method.MethodKind == MethodKind.Destructor)
+{
+ return DestructorDeclaration(method, method.Name);
+}
//...
+ private static SyntaxNode DestructorDeclaration(IMethodSymbol method, string name) {}
as a result, exception is thrown "Symbol cannot be converted to a declaration"