Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinRansom committed Jul 24, 2024
1 parent 2eab49c commit fe5df64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
2 changes: 2 additions & 0 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
* Change compiler default setting realsig+ when building assemblies ([Issue #17384](https://github.com/dotnet/fsharp/issues/17384), [PR #17378](https://github.com/dotnet/fsharp/pull/17385))
* Change compiler default setting for compressedMetadata ([Issue #17379](https://github.com/dotnet/fsharp/issues/17379), [PR #17383](https://github.com/dotnet/fsharp/pull/17383))
* Enforce `AttributeTargets` on unions. ([PR #17389](https://github.com/dotnet/fsharp/pull/17389))
* Ensure that isinteractive multi-emit backing fields are not public. ([Issue #17439](https://github.com/dotnet/fsharp/issues/17438)), ([PR #17439](https://github.com/dotnet/fsharp/pull/17439))

https://github.com/dotnet/fsharp/issues/17438
### Breaking Changes
17 changes: 2 additions & 15 deletions src/Compiler/CodeGen/IlxGen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2082,14 +2082,7 @@ type AnonTypeGenerationTable() =
mkILFields
[
for _, fldName, fldTy in flds ->

let access =
if cenv.options.isInteractive && cenv.options.fsiMultiAssemblyEmit then
ILMemberAccess.Public
else
ILMemberAccess.Private

let fdef = mkILInstanceField (fldName, fldTy, None, access)
let fdef = mkILInstanceField (fldName, fldTy, None, ILMemberAccess.Private)
let attrs = [ g.CompilerGeneratedAttribute; g.DebuggerBrowsableNeverAttribute ]
fdef.With(customAttrs = mkILCustomAttrs attrs)
]
Expand Down Expand Up @@ -11059,13 +11052,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) : ILTypeRef option
// The IL field is hidden if the property/field is hidden OR we're using a property
// AND the field is not mutable (because we can take the address of a mutable field).
// Otherwise fields are always accessed via their property getters/setters
//
// Additionally, don't hide fields for multiemit in F# Interactive
let isFieldHidden =
isPropHidden
|| (not useGenuineField
&& not isFSharpMutable
&& not (cenv.options.isInteractive && cenv.options.fsiMultiAssemblyEmit))
let isFieldHidden = isPropHidden || (not useGenuineField && not isFSharpMutable)

let extraAttribs =
match tyconRepr with
Expand Down
7 changes: 6 additions & 1 deletion src/Compiler/Interactive/fsi.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,12 @@ type internal FsiDynamicCompiler

let asm =
match opts.pdbfile, pdbBytes with
| (Some pdbfile), (Some pdbBytes) -> File.WriteAllBytes(pdbfile, pdbBytes)
| (Some pdbfile), (Some pdbBytes) ->
File.WriteAllBytes(pdbfile, pdbBytes)
#if FOR_TESTING
Directory.CreateDirectory(scriptingSymbolsPath.Value) |> ignore
File.WriteAllBytes(Path.ChangeExtension(pdbfile, ".dll"), assemblyBytes)
#endif
| _ -> ()

match pdbBytes with
Expand Down

0 comments on commit fe5df64

Please sign in to comment.