Skip to content

Add support for tuple syntax #146

@BADF00D

Description

@BADF00D

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of DisposableFixer: 2.4.2
  • I have searched open and closed issues to ensure it has not already been reported

Description

If an IDisposable is returned within TupleSyntax

Source Code

namespace Test
{
	class MyClass
	{
		public static (object, IDisposable) Create() => (new object(), new MemoryStream()); //should not yield warning

		public static (object, IDisposable) Create2()//should not yield warning
		{
			return (new object(), new MemoryStream());
		}

		public static (object, IDisposable) Create3()//should not yield warning
		{
			var mem = new MemoryStream();
			return (new object(), mem);
		}

		public MyClass()
		{
			var tpl = Create();//should yield a new warning about contained IDisposable
			var (item1, disposable) = Create();//should yield a warning
		}
	}
}

Screenshot

image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions