3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs
/// <summary>
/// Bug 576354 - Type inference failure
/// </summary>
Bug 576354 - Type inference failure
Bug 576354 - Type inference failure
[Test]
		public void TestBug576354 ()
		{
			CompletionDataList provider = CreateProvider (
@"
delegate T Func<S, T> (S s);
class Foo
{
	string str;
	public Foo (string str)
	{
		this.str = str;
	}
	public void Bar () 
	{
		System.Console.WriteLine (str);
	}
}
class MyTest
{
	static T Test<T> (Func<string, T> myFunc)
	{
		return myFunc (""Hello World"");
	}
	public static void Main (string[] args)
	{
		var result = Test (str => new Foo (str));
		$result.$
	}
}
");
			Assert.IsNotNull (provider, "provider not found.");
			Assert.IsNotNull (provider.Find ("Bar"), "method 'Bar' not found.");
		}
[ Test ] public void TestBug576354 ( ) { CompletionDataList provider = CreateProvider ( @"
delegate T Func<S, T> (S s);

class Foo
{
	string str;
	
	public Foo (string str)
	{
		this.str = str;
	}
	
	public void Bar () 
	{
		System.Console.WriteLine (str);
	}
}

class MyTest
{
	static T Test<T> (Func<string, T> myFunc)
	{
		return myFunc (""Hello World"");
	}
	
	public static void Main (string[] args)
	{
		var result = Test (str => new Foo (str));
		$result.$
	}
}
" ) ; Assert . IsNotNull ( provider , " " ) ; Assert . IsNotNull ( provider . Find ( " " ) , " " ) ; }
Bug 576354 - Type inference failure
Bug 576354 - Type inference failure