From 87db6687c464a778f7723363eb88d4c139b309d6 Mon Sep 17 00:00:00 2001 From: Matt Thalman Date: Tue, 14 Feb 2023 13:56:45 -0600 Subject: [PATCH] Remove unused values from compilation to avoid FS1182 --- src/Compiler/Driver/StaticLinking.fs | 4 ++++ src/Compiler/TypedTree/TypedTreePickle.fs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/Compiler/Driver/StaticLinking.fs b/src/Compiler/Driver/StaticLinking.fs index 972f55fc70c..443294a9b6f 100644 --- a/src/Compiler/Driver/StaticLinking.fs +++ b/src/Compiler/Driver/StaticLinking.fs @@ -98,7 +98,9 @@ type TypeForwarding(tcImports: TcImports) = member _.TypeForwardILTypeRef tref = typeForwardILTypeRef tref +#if !NO_TYPEPROVIDERS let debugStaticLinking = isEnvVarSet "FSHARP_DEBUG_STATIC_LINKING" +#endif let StaticLinkILModules ( @@ -419,6 +421,7 @@ let FindDependentILModulesForStaticLinking (ctok, tcConfig: TcConfig, tcImports: (n.ccu, n.data) ] +#if !NO_TYPEPROVIDERS // Add all provider-generated assemblies into the static linking set let FindProviderGeneratedILModules (ctok, tcImports: TcImports, providerGeneratedAssemblies: (ImportedBinary * _) list) = [ @@ -442,6 +445,7 @@ let FindProviderGeneratedILModules (ctok, tcImports: TcImports, providerGenerate (ccu, dllInfo.ILScopeRef, modul), (ilAssemRef.Name, provAssemStaticLinkInfo) | None -> () ] +#endif /// Split the list into left, middle and right parts at the first element satisfying 'p'. If no element matches return /// 'None' for the middle part. diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 13df0443f5c..818d36ecc9c 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -29,7 +29,9 @@ open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TcGlobals +#if !NO_TYPEPROVIDERS let verbose = false +#endif let ffailwith fileName str = let msg = FSComp.SR.pickleErrorReadingWritingMetadata(fileName, str)