[x] I have verified that I am running the latest version of DisposableFixer: 1.1.4
[x] I have searched open and closed issues to ensure it has not already been reported
Description
When applying CodeFix, that adds a Dispose-Call for a member in class ''A'', and the class hat a inner class ''B'' with a Dispose-Method, then the Dispose-Call for the member is added to Dispose-Method in class ''B''
Source Code
using System;
using System.IO;
namespace ExtensionMethodYieldsNotDisposed
{
internal class Class1
{
public IDisposable MemoryStream { get; }
public Class1()
{
MemoryStream = new MemoryStream();
}
private class InnerClassWithDisposeMethod
{
public void Dispose(){}
}
}
}
Becomes:
using System;
using System.IO;
namespace ExtensionMethodYieldsNotDisposed
{
internal class Class1 : IDisposable {
public IDisposable MemoryStream { get; }
public Class1()
{
MemoryStream = new MemoryStream();
}
private class InnerClassWithDisposeMethod
{
public void Dispose() {
MemoryStream?.Dispose();
}
}
}
}
But should become:
using System;
using System.IO;
namespace ExtensionMethodYieldsNotDisposed
{
internal class Class1
{
public IDisposable MemoryStream { get; }
public Class1()
{
MemoryStream = new MemoryStream();
}
private class InnerClassWithDisposeMethod
{
public void Dispose(){}
}
public void Dispose()
{
MemoryStream?.Dispose();
}
}
}
Prerequisites
Description
When applying CodeFix, that adds a Dispose-Call for a member in class ''A'', and the class hat a inner class ''B'' with a Dispose-Method, then the Dispose-Call for the member is added to Dispose-Method in class ''B''
Source Code
Becomes:
But should become: