提交 4e1ac990 编写于 作者: N Neal Gafter

Emit anonymous delegates, used for dynamic, in deterministic order

Fixes #1440
上级 c36177f4
......@@ -383,7 +383,17 @@ private void GetCreatedSynthesizedDelegates(ArrayBuilder<SynthesizedDelegateSymb
builder.Add(template.Delegate);
}
}
// Should be sorted, same as AnonymousTypeTemplates. See VB.
builder.Sort(SynthesizedDelegateSymbolComparer.Instance);
}
}
private class SynthesizedDelegateSymbolComparer : IComparer<SynthesizedDelegateSymbol>
{
public static SynthesizedDelegateSymbolComparer Instance = new SynthesizedDelegateSymbolComparer();
public int Compare(SynthesizedDelegateSymbol x, SynthesizedDelegateSymbol y)
{
return x.MetadataName.CompareTo(y.MetadataName);
}
}
......
......@@ -2892,7 +2892,7 @@ class C6
/// metadata should be deterministic.
/// </summary>
[WorkItem(1440, "https://github.com/dotnet/roslyn/issues/1440")]
[Fact(Skip = "1440")]
[Fact]
public void SynthesizedDelegateMetadataOrder()
{
var source =
......@@ -2934,9 +2934,9 @@ static int M(dynamic d, object o)
{
"<Module>",
"<>A{00000004}`3",
"<>A{00000018}`5",
"<>F{00000004}`5",
"<>F{00000008}`5",
"<>A{00000018}`5",
"C1",
"C2",
"C3",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册