Skip to content

AnalyzeDataFlow fails #59738

@bernd5

Description

@bernd5

Version Used: c5713c6

Steps to Reproduce:
Compile and execute the following test code:
(I used RegionAnalysisTest.cs in roslyn)

[Fact]
public void TestDataFlowsOfIdentifierWithDelegateConversion()
{
	var analysis = CompileAndAnalyzeDataFlowExpression(@"
using System;

namespace ICSharpCode.Decompiler.Tests.TestCases.Ugly
{
	internal static class NoExtensionMethods
	{
		internal static Func<T> AsFunc<T>(this T value) where T : class
		{
			return new Func<T>(/*<bind>*/ value /*</bind>*/.Return);
		}

		private static T Return<T>(this T value)
		{
			return value;
		}

		static void Main()
		{
			Console.WriteLine(((object)42).AsFunc()());
		}
	}
}
	");
	Assert.True(analysis.Succeeded);
}

Expected Behavior:
The test should not fail.

Actual Behavior:
The test fails.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions