Skip to content
Closed
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
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- F# Version components -->
<FSMajorVersion>7</FSMajorVersion>
<FSMinorVersion>0</FSMinorVersion>
<FSBuildVersion>200</FSBuildVersion>
<FSBuildVersion>201</FSBuildVersion>
<FSRevisionVersion>0</FSRevisionVersion>
<!-- -->
<!-- F# Language version -->
Expand Down
12 changes: 9 additions & 3 deletions src/Compiler/CodeGen/IlxGen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,8 @@ let GenReadOnlyAttribute (g: TcGlobals) =

let GenReadOnlyAttributeIfNecessary (g: TcGlobals) ty =
let add =
g.isSystem_Runtime_CompilerServices_IsReadOnlyAttributeAvailable
false
&& g.isSystem_Runtime_CompilerServices_IsReadOnlyAttributeAvailable
&& isInByrefTy g ty
&& g.attrib_IsReadOnlyAttribute.TyconRef.CanDeref

Expand Down Expand Up @@ -2124,7 +2125,11 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu
[
for propName, fldName, fldTy in flds ->
let attrs =
if g.isSystem_Runtime_CompilerServices_IsReadOnlyAttributeAvailable && isStruct then
if
false
&& g.isSystem_Runtime_CompilerServices_IsReadOnlyAttributeAvailable
&& isStruct
then
[ GenReadOnlyAttribute g ]
else
[]
Expand Down Expand Up @@ -10886,7 +10891,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) =

let attrs =
if
g.isSystem_Runtime_CompilerServices_IsReadOnlyAttributeAvailable
false
&& g.isSystem_Runtime_CompilerServices_IsReadOnlyAttributeAvailable
&& isStruct
&& not isStatic
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
.method public hidebysig specialname
instance int32 get_hash() cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
.assembly extern System.Runtime
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
.ver 6:0:0:0
.ver 7:0:0:0
}
.assembly extern FSharp.Core
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
.ver 6:0:0:0
.ver 7:0:0:0
}
.assembly Structs02
{
Expand All @@ -21,29 +21,29 @@
int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 )

// --- The following custom attribute is added automatically, do not uncomment -------
// .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 )
// .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 )

.hash algorithm 0x00008004
.ver 0:0:0:0
}
.mresource public FSharpSignatureData.Structs02
{
// Offset: 0x00000000 Length: 0x000007C6
// Offset: 0x00000000 Length: 0x000007B3
// WARNING: managed resource file FSharpSignatureData.Structs02 created
}
.mresource public FSharpOptimizationData.Structs02
{
// Offset: 0x000007D0 Length: 0x0000023D
// Offset: 0x000007B8 Length: 0x0000023D
// WARNING: managed resource file FSharpOptimizationData.Structs02 created
}
.module Structs02.exe
// MVID: {628FBBC7-2059-FCB3-A745-0383C7BB8F62}
// MVID: {63DBF1DE-9F75-7AA4-A745-0383DEF1DB63}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x00000201110E0000
// Image base: 0x0000024203AB0000


// =============== CLASS MEMBERS DECLARATION ===================
Expand All @@ -66,9 +66,8 @@
.method public hidebysig specialname
instance int32 get_hash() cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
Expand Down Expand Up @@ -368,4 +367,4 @@
// =============================================================

// *********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file C:\Users\vzari\code\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net6.0\tests\EmittedIL\Misc\Structs02_fs\Structs02.res
// WARNING: Created Win32 resource file D:\code\FS\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net7.0\tests\EmittedIL\Misc\Structs02_fs\Structs02.res
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
.method public hidebysig specialname
instance float64 get_F() cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
Expand Down Expand Up @@ -420,7 +419,6 @@
.method public hidebysig specialname
instance float64 get_D() cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
Expand Down
Loading