Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit anonymous types in deterministic order #948

Merged
merged 1 commit into from
Feb 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Emit;
Expand Down Expand Up @@ -275,7 +276,7 @@ public void AssignTemplatesNamesAndCompile(MethodCompiler compiler, PEModuleBuil
var anonymousTypes = _lazyAnonymousTypeTemplates;
if (anonymousTypes != null)
{
foreach (var template in anonymousTypes.Values)
foreach (var template in from kv in anonymousTypes orderby kv.Key select kv.Value)
{
// NOTE: in interactive scenarios the cache may contain templates
// from other compilation, those should be discarded here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3775,7 +3775,6 @@ .locals init ([unchanged] V_0,
/// Reuse existing anonymous types.
/// </summary>
[WorkItem(825903, "DevDiv")]
[ConditionalFact(typeof(x86))]
public void AnonymousTypes()
{
var source0 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
cache As ConcurrentDictionary(Of String, T))

If cache IsNot Nothing Then
For Each template In cache.Values
For Each template In From kv In cache Order By kv.Key Select kv.Value
If template.Manager Is Me Then
builder.Add(template)
End If
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3276,7 +3276,6 @@ End Class
]]>.Value)
End Sub

<ConditionalFact(GetType(x86))>
Public Sub AnonymousTypes()
Dim sources0 = <compilation>
<file name="a.vb"><![CDATA[
Expand Down