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

Fix attribute embedding determinism #15065

Merged
merged 4 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion src/Compiler/CodeGen/IlxGen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ let mkLocalPrivateAttributeWithPropertyConstructors (cenv, name: string, attrPro
mkLdfldMethodDef ($"get_{name}", ILMemberAccess.Public, false, ilTy, fieldName, ilType, [])
)),
(cenv.g.AddMethodGeneratedAttributes(
mkStsfldMethodDef ($"set_{name}", ILMemberAccess.Private, false, ilTy, fieldName, ilType, [])
mkStsfldMethodDef ($"set_{name}", ILMemberAccess.Public, false, ilTy, fieldName, ilType, [])
)),
(cenv.g.AddPropertyGeneratedAttributes(
mkILNonGenericInstanceProperty (name, ilTypeRef, ilType, PropertyAttributes.None, emptyILCustomAttrs)
Expand Down
3 changes: 2 additions & 1 deletion src/Compiler/TypedTree/TcGlobals.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
module internal FSharp.Compiler.TcGlobals

open System.Collections.Concurrent
open System.Linq
open System.Diagnostics

open Internal.Utilities.Library
Expand Down Expand Up @@ -1052,7 +1053,7 @@ type TcGlobals(
member _.embeddedTypeDefs = embeddedILTypeDefs.Values |> Seq.toList

member _.tryRemoveEmbeddedILTypeDefs () = [
for key in embeddedILTypeDefs.Keys do
for key in embeddedILTypeDefs.Keys.OrderBy(fun k -> k) do
match (embeddedILTypeDefs.TryRemove(key)) with
| true, ilTypeDef -> yield ilTypeDef
| false, _ -> ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
IL_0006: ret
}

.method private hidebysig specialname instance void
.method public hidebysig specialname instance void
set_Type(class [runtime]System.Type 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
Expand All @@ -611,7 +611,7 @@
IL_0006: ret
}

.method private hidebysig specialname instance void
.method public hidebysig specialname instance void
set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@
IL_0006: ret
}

.method private hidebysig specialname instance void
.method public hidebysig specialname instance void
set_Type(class [runtime]System.Type 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
Expand All @@ -613,7 +613,7 @@
IL_0006: ret
}

.method private hidebysig specialname instance void
.method public hidebysig specialname instance void
set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
IL_0006: ret
}

.method private hidebysig specialname instance void
.method public hidebysig specialname instance void
set_Type(class [runtime]System.Type 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
Expand All @@ -601,7 +601,7 @@
IL_0006: ret
}

.method private hidebysig specialname instance void
.method public hidebysig specialname instance void
set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@
IL_0006: ret
}

.method private hidebysig specialname instance void
.method public hidebysig specialname instance void
set_Type(class [runtime]System.Type 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
Expand All @@ -612,7 +612,7 @@
IL_0006: ret
}

.method private hidebysig specialname instance void
.method public hidebysig specialname instance void
set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@
IL_0006: ret
}

.method private hidebysig specialname instance void
.method public hidebysig specialname instance void
set_Type(class [runtime]System.Type 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
Expand All @@ -913,7 +913,7 @@
IL_0006: ret
}

.method private hidebysig specialname instance void
.method public hidebysig specialname instance void
set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
Expand Down