Skip to content

Commit

Permalink
Merge pull request #17185 from dotnet/feature-nullness-fix-plain-builds
Browse files Browse the repository at this point in the history
Fix issues for plain 'dotnet build Fsharp.Compiler.Service.sln`
  • Loading branch information
T-Gro authored May 21, 2024
2 parents 03e294f + 3570b2f commit 13e50b4
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ nCrunchTemp_*
tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.actual
*.vsp
/tests/AheadOfTime/Trimming/output.txt
*.svclog
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<FSharpCompilerServiceReleaseNotesVersion>$(FCSMajorVersion)$(FCSMinorVersion)$(FCSBuildVersion)</FSharpCompilerServiceReleaseNotesVersion>
<!-- -->
<!-- The current published nuget package -->
<FSharpCoreShippedPackageVersionValue>8.0.200</FSharpCoreShippedPackageVersionValue>
<FSharpCoreShippedPackageVersionValue>8.0.300</FSharpCoreShippedPackageVersionValue>
<!-- -->
<!-- The pattern for specifying the preview package -->
<FSharpCorePreviewPackageVersionValue>$(FSCorePackageVersionValue)-$(PreReleaseVersionLabel).*</FSharpCorePreviewPackageVersionValue>
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/Service/SemanticClassification.fs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ type SemanticClassificationType =
| TypeDef = 35
| Plaintext = 36

[<RequireQualifiedAccess>]
[<Struct>]
type SemanticClassificationItem =
val Range: range
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/Service/SemanticClassification.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ type SemanticClassificationType =
| TypeDef = 35
| Plaintext = 36

[<RequireQualifiedAccess>]
[<Struct>]
type SemanticClassificationItem =
val Range: range
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/TypedTree/TypedTreeOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3515,7 +3515,7 @@ let TryFindLocalizedFSharpStringAttribute g nm attrs =
| Some(Attrib(_, _, [ AttribStringArg b ], namedArgs, _, _, _)) ->
match namedArgs with
| ExtractAttribNamedArg "Localize" (AttribBoolArg true) ->
#if PROTO
#if PROTO || BUILDING_WITH_LKG
Some b
#else
FSComp.SR.GetTextOpt(b)
Expand Down
11 changes: 6 additions & 5 deletions src/Compiler/Utilities/illib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,30 @@ type InterruptibleLazy<'T> private (value, valueFactory: unit -> 'T) =
let syncObj = obj ()

[<VolatileField>]
let mutable valueFactory = valueFactory
// TODO nullness - this is boxed to obj because of an attribute targets bug fixed in main, but not yet shipped (needs shipped 8.0.400)
let mutable valueFactory : obj = valueFactory

let mutable value = value

new(valueFactory: unit -> 'T) = InterruptibleLazy(Unchecked.defaultof<_>, valueFactory)

member this.IsValueCreated =
match box valueFactory with
match valueFactory with
| null -> true
| _ -> false

member this.Value =
match box valueFactory with
match valueFactory with
| null -> value
| _ ->
Monitor.Enter(syncObj)

try
match box valueFactory with
match valueFactory with
| null -> ()
| _ ->

value <- valueFactory ()
value <- (valueFactory |> unbox<unit -> 'T>) ()
valueFactory <- Unchecked.defaultof<_>
finally
Monitor.Exit(syncObj)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ type ProjectRequest = ProjectAction * AsyncReplyChannel<SyntheticProject>

type FuzzingEvent = StartedChecking | FinishedChecking of bool | AbortedChecking of string | ModifiedImplFile | ModifiedSigFile

[<RequireQualifiedAccess>]
type SignatureFiles = Yes = 1 | No = 2 | Some = 3

let fuzzingTest seed (project: SyntheticProject) = task {
Expand Down
1 change: 0 additions & 1 deletion tests/service/data/TestTP/ProvidedTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3220,7 +3220,6 @@ module internal AssemblyReader =
systemRuntimeScopeRef: ILScopeRef }
override __.ToString() = "<ILGlobals>"

[<AutoOpen>]
[<Struct>]
type ILTableName(idx: int) =
member __.Index = idx
Expand Down

0 comments on commit 13e50b4

Please sign in to comment.