From 7da45b5ddecf85c8a12bf155f1983e3644a72a65 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 20 May 2024 15:51:36 +0200 Subject: [PATCH 1/3] fix issues for plain 'dotnet build Fsharp.Compiler.Service.sln` --- .gitignore | 1 + src/Compiler/Service/SemanticClassification.fs | 1 - src/Compiler/Service/SemanticClassification.fsi | 1 - src/Compiler/TypedTree/TypedTreeOps.fs | 2 +- src/Compiler/Utilities/illib.fs | 2 ++ tests/service/data/TestTP/ProvidedTypes.fs | 1 - 6 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e6d289dd19b..013ade3ce24 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,4 @@ nCrunchTemp_* tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.actual *.vsp /tests/AheadOfTime/Trimming/output.txt +*.svclog diff --git a/src/Compiler/Service/SemanticClassification.fs b/src/Compiler/Service/SemanticClassification.fs index 6ebbb3c8ae0..6053f996ece 100644 --- a/src/Compiler/Service/SemanticClassification.fs +++ b/src/Compiler/Service/SemanticClassification.fs @@ -58,7 +58,6 @@ type SemanticClassificationType = | TypeDef = 35 | Plaintext = 36 -[] [] type SemanticClassificationItem = val Range: range diff --git a/src/Compiler/Service/SemanticClassification.fsi b/src/Compiler/Service/SemanticClassification.fsi index ce5d6d88aeb..1fb4cf28df5 100644 --- a/src/Compiler/Service/SemanticClassification.fsi +++ b/src/Compiler/Service/SemanticClassification.fsi @@ -49,7 +49,6 @@ type SemanticClassificationType = | TypeDef = 35 | Plaintext = 36 -[] [] type SemanticClassificationItem = val Range: range diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 4b8f97d3deb..00e0ee4d7f1 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -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) diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index d02f132e0a1..8ebe20265ca 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -2,6 +2,8 @@ namespace Internal.Utilities.Library +#nowarn "842" //This attribute is not valid for use on this language element for `valueFactory` below + open System open System.Collections.Generic open System.Collections.Concurrent diff --git a/tests/service/data/TestTP/ProvidedTypes.fs b/tests/service/data/TestTP/ProvidedTypes.fs index 9cd4c0dc0a2..606ba52b3e2 100644 --- a/tests/service/data/TestTP/ProvidedTypes.fs +++ b/tests/service/data/TestTP/ProvidedTypes.fs @@ -3220,7 +3220,6 @@ module internal AssemblyReader = systemRuntimeScopeRef: ILScopeRef } override __.ToString() = "" - [] [] type ILTableName(idx: int) = member __.Index = idx From c28b21a6291be12c09f8ca24d85a4e123b39455d Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 20 May 2024 16:07:38 +0200 Subject: [PATCH 2/3] update FSharpCoreShippedPackageVersionValue --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 6146affd95a..a83852e3727 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -39,7 +39,7 @@ $(FCSMajorVersion)$(FCSMinorVersion)$(FCSBuildVersion) - 8.0.200 + 8.0.300 $(FSCorePackageVersionValue)-$(PreReleaseVersionLabel).* From 3570b2fc1e3b2c90e199ff37d826dc5e100fc8c2 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 20 May 2024 16:36:52 +0200 Subject: [PATCH 3/3] Wkraround attributetargets issue by using 'obj'. This removes 3x box and adds 1x unbox. --- src/Compiler/Utilities/illib.fs | 13 ++++++------- .../FSharpChecker/TransparentCompiler.fs | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index 8ebe20265ca..aa1fffaf826 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -2,8 +2,6 @@ namespace Internal.Utilities.Library -#nowarn "842" //This attribute is not valid for use on this language element for `valueFactory` below - open System open System.Collections.Generic open System.Collections.Concurrent @@ -18,29 +16,30 @@ type InterruptibleLazy<'T> private (value, valueFactory: unit -> 'T) = let syncObj = obj () [] - 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 'T>) () valueFactory <- Unchecked.defaultof<_> finally Monitor.Exit(syncObj) diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs index cbc0c8a34e8..7cc7080d4f3 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs @@ -475,7 +475,6 @@ type ProjectRequest = ProjectAction * AsyncReplyChannel type FuzzingEvent = StartedChecking | FinishedChecking of bool | AbortedChecking of string | ModifiedImplFile | ModifiedSigFile -[] type SignatureFiles = Yes = 1 | No = 2 | Some = 3 let fuzzingTest seed (project: SyntheticProject) = task {