diff --git a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj
index d53494b86f2..8686318fe23 100644
--- a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj
+++ b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj
@@ -17,7 +17,6 @@
LIBRARY
58;75
v4.6
- EXTENSIONTYPING;$(DefineConstants)
false
..\..\$(Configuration)\fcs\net45\
true
diff --git a/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj b/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj
index b756152b993..dd1add15a55 100644
--- a/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj
+++ b/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj
@@ -13,6 +13,7 @@
$(DefineConstants);COMPILER_SERVICE
$(DefineConstants);COMPILER_SERVICE_ASSUMES_FSHARP_CORE_4_4_0_0
$(DefineConstants);EXTENSIBLE_DUMPER
+ $(DefineConstants);NO_EXTENSIONTYPING
$(DefineConstants);FSHARP_CORE_4_5
$(DefineConstants);FX_PORTABLE_OR_NETSTANDARD
$(DefineConstants);FX_ATLEAST_PORTABLE
diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj
index a955e015b80..b1cebac3a08 100644
--- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj
+++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj
@@ -24,7 +24,6 @@
v4.5
- $(DefineConstants);EXTENSIONTYPING
$(DefineConstants);CROSS_PLATFORM_COMPILER
$(DefineConstants);ENABLE_MONO_SUPPORT
$(DefineConstants);COMPILER
diff --git a/fcs/samples/FscExe/FscExe.fsproj b/fcs/samples/FscExe/FscExe.fsproj
index e0ef6ebd4da..946034ec67c 100644
--- a/fcs/samples/FscExe/FscExe.fsproj
+++ b/fcs/samples/FscExe/FscExe.fsproj
@@ -15,7 +15,6 @@
$(NoWarn);62;44
FscExe
FscExe
- EXTENSIONTYPING;$(DefineConstants)
COMPILER;$(DefineConstants)
FX_RESIDENT_COMPILER;$(DefineConstants)
true
diff --git a/src/absil/il.fsi b/src/absil/il.fsi
index 8b4743bb72b..a4621052292 100644
--- a/src/absil/il.fsi
+++ b/src/absil/il.fsi
@@ -287,7 +287,7 @@ type ILTypeRef =
member QualifiedName: string
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member QualifiedNameWithNoShortPrimaryAssembly: string
#endif
diff --git a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj
index a8c1de7f177..e8a37a4ac28 100644
--- a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj
+++ b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj
@@ -9,7 +9,6 @@
$(NoWarn);45;55;62;75;1182;1204
true
true
- EXTENSIONTYPING;$(DefineConstants)
$(OtherFlags) --maxerrors:20 --extraoptimizationloops:1
diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj
index bc676dbbef6..a35c9a3bdf4 100644
--- a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj
+++ b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj
@@ -8,7 +8,7 @@
FSharp.Compiler.Private
$(NoWarn);45;55;62;75;1204
true
- $(DefineConstants);EXTENSIONTYPING;COMPILER
+ $(DefineConstants);COMPILER
$(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1
diff --git a/src/buildfromsource/Fsc/Fsc.fsproj b/src/buildfromsource/Fsc/Fsc.fsproj
index c40121222e6..572a8c8efaf 100644
--- a/src/buildfromsource/Fsc/Fsc.fsproj
+++ b/src/buildfromsource/Fsc/Fsc.fsproj
@@ -9,7 +9,7 @@
fsc
$(NoWarn);45;55;62;75;1204
true
- $(DefineConstants);EXTENSIONTYPING;COMPILER
+ $(DefineConstants);COMPILER
$(OtherFlags) --maxerrors:20 --extraoptimizationloops:1
diff --git a/src/buildfromsource/Fsi/Fsi.fsproj b/src/buildfromsource/Fsi/Fsi.fsproj
index d06056fe096..9ecd22b7265 100644
--- a/src/buildfromsource/Fsi/Fsi.fsproj
+++ b/src/buildfromsource/Fsi/Fsi.fsproj
@@ -9,7 +9,7 @@
fsi
$(NoWarn);45;55;62;75;1204
true
- $(DefineConstants);BUILD_FROM_SOURCE;COMPILER;EXTENSIONTYPING
+ $(DefineConstants);BUILD_FROM_SOURCE;COMPILER
$(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1
diff --git a/src/fsharp/AccessibilityLogic.fs b/src/fsharp/AccessibilityLogic.fs
index 6c4362d9a4f..c69d00cd0a0 100644
--- a/src/fsharp/AccessibilityLogic.fs
+++ b/src/fsharp/AccessibilityLogic.fs
@@ -14,7 +14,7 @@ open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.Tastops
open Microsoft.FSharp.Compiler.TcGlobals
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -228,7 +228,7 @@ let ComputeILAccess isPublic isFamily isFamilyOrAssembly isFamilyAndAssembly =
let IsILFieldInfoAccessible g amap m ad x =
match x with
| ILFieldInfo (tinfo,fd) -> IsILTypeAndMemberAccessible g amap m ad ad tinfo fd.Access
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField (amap, tpfi, m) as pfi ->
let access = tpfi.PUntaint((fun fi -> ComputeILAccess fi.IsPublic fi.IsFamily fi.IsFamilyOrAssembly fi.IsFamilyAndAssembly), m)
IsProvidedMemberAccessible amap m ad pfi.EnclosingType access
@@ -314,7 +314,7 @@ let IsTypeAndMethInfoAccessible amap m adTyp ad = function
| ILMeth (g,x,_) -> IsILMethInfoAccessible g amap m adTyp ad x
| FSMeth (_,_,vref,_) -> IsValAccessible ad vref
| DefaultStructCtor(g,typ) -> IsTypeAccessible g amap m ad typ
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap,tpmb,_,m) as etmi ->
let access = tpmb.PUntaint((fun mi -> ComputeILAccess mi.IsPublic mi.IsFamily mi.IsFamilyOrAssembly mi.IsFamilyAndAssembly), m)
IsProvidedMemberAccessible amap m ad etmi.EnclosingType access
@@ -325,7 +325,7 @@ let IsPropInfoAccessible g amap m ad = function
| ILProp (_,x) -> IsILPropInfoAccessible g amap m ad x
| FSProp (_,_,Some vref,_)
| FSProp (_,_,_,Some vref) -> IsValAccessible ad vref
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp (amap, tppi, m) as pp->
let access =
let a = tppi.PUntaint((fun ppi ->
diff --git a/src/fsharp/AttributeChecking.fs b/src/fsharp/AttributeChecking.fs
index ccd5c6d2706..d3902075119 100644
--- a/src/fsharp/AttributeChecking.fs
+++ b/src/fsharp/AttributeChecking.fs
@@ -19,7 +19,7 @@ open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.Tastops
open Microsoft.FSharp.Compiler.TcGlobals
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
open Microsoft.FSharp.Core.CompilerServices
#endif
@@ -130,7 +130,7 @@ let AttribInfosOfFS g attribs =
let GetAttribInfosOfEntity g amap m (tcref:TyconRef) =
match metadataOfTycon tcref.Deref with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// TODO: provided attributes
| ProvidedTypeMetadata _info -> []
//let provAttribs = info.ProvidedType.PApply((fun a -> (a :> IProvidedCustomAttributeProvider)),m)
@@ -149,7 +149,7 @@ let GetAttribInfosOfMethod amap m minfo =
| ILMeth (g,ilminfo,_) -> ilminfo.RawMetadata.CustomAttrs |> AttribInfosOfIL g amap ilminfo.MetadataScope m
| FSMeth (g,_,vref,_) -> vref.Attribs |> AttribInfosOfFS g
| DefaultStructCtor _ -> []
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// TODO: provided attributes
| ProvidedMeth (_,_mi,_,_m) ->
[]
@@ -162,7 +162,7 @@ let GetAttribInfosOfProp amap m pinfo =
| FSProp(g,_,Some vref,_)
| FSProp(g,_,_,Some vref) -> vref.Attribs |> AttribInfosOfFS g
| FSProp _ -> failwith "GetAttribInfosOfProp: unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// TODO: provided attributes
| ProvidedProp _ -> []
#endif
@@ -171,7 +171,7 @@ let GetAttribInfosOfEvent amap m einfo =
match einfo with
| ILEvent(g, x) -> x.RawMetadata.CustomAttrs |> AttribInfosOfIL g amap x.ILTypeInfo.ILScopeRef m
| FSEvent(_, pi, _vref1, _vref2) -> GetAttribInfosOfProp amap m pi
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// TODO: provided attributes
| ProvidedEvent _ -> []
#endif
@@ -183,7 +183,7 @@ let GetAttribInfosOfEvent amap m einfo =
let TryBindTyconRefAttribute g m (AttribInfo (atref,_) as args) (tcref:TyconRef) f1 f2 f3 =
ignore m; ignore f3
match metadataOfTycon tcref.Deref with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info ->
let provAttribs = info.ProvidedType.PApply((fun a -> (a :> IProvidedCustomAttributeProvider)),m)
match provAttribs.PUntaint((fun a -> a.GetAttributeConstructorArgs(provAttribs.TypeProvider.PUntaintNoFailure(id), atref.FullName)),m) with
@@ -207,14 +207,14 @@ let BindMethInfoAttributes m minfo f1 f2 f3 =
| ILMeth (_,x,_) -> f1 x.RawMetadata.CustomAttrs
| FSMeth (_,_,vref,_) -> f2 vref.Attribs
| DefaultStructCtor _ -> f2 []
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth (_,mi,_,_) -> f3 (mi.PApply((fun st -> (st :> IProvidedCustomAttributeProvider)),m))
#endif
/// Analyze three cases for attributes declared on methods: IL-declared attributes, F#-declared attributes and
/// provided attributes.
let TryBindMethInfoAttribute g m (AttribInfo(atref,_) as attribSpec) minfo f1 f2 f3 =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
#else
// to prevent unused parameter warning
ignore f3
@@ -222,7 +222,7 @@ let TryBindMethInfoAttribute g m (AttribInfo(atref,_) as attribSpec) minfo f1 f2
BindMethInfoAttributes m minfo
(fun ilAttribs -> TryDecodeILAttribute g atref ilAttribs |> Option.bind f1)
(fun fsAttribs -> TryFindFSharpAttribute g attribSpec fsAttribs |> Option.bind f2)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
(fun provAttribs ->
match provAttribs.PUntaint((fun a -> a.GetAttributeConstructorArgs(provAttribs.TypeProvider.PUntaintNoFailure(id), atref.FullName)),m) with
| Some args -> f3 args
@@ -316,7 +316,7 @@ let CheckFSharpAttributes g attribs m =
CompleteD
)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Check a list of provided attributes for 'ObsoleteAttribute', returning errors and warnings as data
let private CheckProvidedAttributes (g: TcGlobals) m (provAttribs: Tainted) =
let (AttribInfo(tref,_)) = g.attrib_SystemObsolete
@@ -368,7 +368,7 @@ let CheckFSharpAttributesForUnseen g attribs _m =
(CheckFSharpAttributesForObsolete g attribs ||
CheckFSharpAttributesForHidden g attribs)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Indicate if a list of provided attributes contains 'ObsoleteAttribute'. Used to suppress the item in intellisense.
let CheckProvidedAttributesForUnseen (provAttribs: Tainted) m =
provAttribs.PUntaint((fun a -> a.GetAttributeConstructorArgs(provAttribs.TypeProvider.PUntaintNoFailure(id), typeof.FullName).IsSome),m)
@@ -381,7 +381,7 @@ let CheckPropInfoAttributes pinfo m =
| FSProp(g,_,Some vref,_)
| FSProp(g,_,_,Some vref) -> CheckFSharpAttributes g vref.Attribs m
| FSProp _ -> failwith "CheckPropInfoAttributes: unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp (amap,pi,m) ->
CheckProvidedAttributes amap.g m (pi.PApply((fun st -> (st :> IProvidedCustomAttributeProvider)),m))
@@ -393,7 +393,7 @@ let CheckILFieldAttributes g (finfo:ILFieldInfo) m =
match finfo with
| ILFieldInfo(_,pd) ->
CheckILAttributes g pd.CustomAttrs m |> CommitOperationResult
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField (amap,fi,m) ->
CheckProvidedAttributes amap.g m (fi.PApply((fun st -> (st :> IProvidedCustomAttributeProvider)),m)) |> CommitOperationResult
#endif
@@ -411,7 +411,7 @@ let CheckMethInfoAttributes g m tyargsOpt minfo =
else
CompleteD)
Some res)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
(fun provAttribs -> Some (CheckProvidedAttributes g m provAttribs))
#else
(fun _provAttribs -> None)
@@ -427,7 +427,7 @@ let MethInfoIsUnseen g m typ minfo =
match BindMethInfoAttributes m minfo
(fun ilAttribs -> Some(CheckILAttributesForUnseen g ilAttribs m))
(fun fsAttribs -> Some(CheckFSharpAttributesForUnseen g fsAttribs m))
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
(fun provAttribs -> Some(CheckProvidedAttributesForUnseen provAttribs m))
#else
(fun _provAttribs -> None)
@@ -437,7 +437,7 @@ let MethInfoIsUnseen g m typ minfo =
| None -> false
let isUnseenByHidingAttribute =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
not (isObjTy g typ) &&
isAppTy g typ &&
isObjTy g minfo.EnclosingType &&
@@ -470,7 +470,7 @@ let PropInfoIsUnseen m pinfo =
| FSProp (g,_,Some vref,_)
| FSProp (g,_,_,Some vref) -> CheckFSharpAttributesForUnseen g vref.Attribs m
| FSProp _ -> failwith "CheckPropInfoAttributes: unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp (_amap,pi,m) ->
CheckProvidedAttributesForUnseen (pi.PApply((fun st -> (st :> IProvidedCustomAttributeProvider)),m)) m
#endif
diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs
index 0d35f05dc1c..adb43bcef77 100644
--- a/src/fsharp/CompileOps.fs
+++ b/src/fsharp/CompileOps.fs
@@ -49,7 +49,7 @@ open Microsoft.FSharp.Compiler.PrettyNaming
open Microsoft.FSharp.Compiler.Import
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
open Microsoft.FSharp.Core.CompilerServices
#endif
@@ -101,7 +101,7 @@ exception HashLoadedScriptConsideredSource of range
let GetRangeOfDiagnostic(err:PhasedDiagnostic) =
let rec RangeFromException = function
| ErrorFromAddingConstraint(_, err2, _) -> RangeFromException err2
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ExtensionTyping.ProvidedTypeResolutionNoRange(e) -> RangeFromException e
| ExtensionTyping.ProvidedTypeResolution(m, _)
#endif
@@ -233,7 +233,7 @@ let GetRangeOfDiagnostic(err:PhasedDiagnostic) =
// Strip TargetInvocationException wrappers
| :? System.Reflection.TargetInvocationException as e ->
RangeFromException e.InnerException
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| :? TypeProviderError as e -> e.Range |> Some
#endif
@@ -352,7 +352,7 @@ let GetDiagnosticNumber(err:PhasedDiagnostic) =
| UnresolvedConversionOperator _ -> 93
// avoid 94-100 for safety
| ObsoleteError _ -> 101
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ExtensionTyping.ProvidedTypeResolutionNoRange _
| ExtensionTyping.ProvidedTypeResolution _ -> 103
#endif
@@ -369,7 +369,7 @@ let GetDiagnosticNumber(err:PhasedDiagnostic) =
| Failure _ -> 192
| NumberedError((n, _), _) -> n
| IllegalFileNameChar(fileName, invalidChar) -> fst (FSComp.SR.buildUnexpectedFileNameCharacter(fileName, string invalidChar))
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| :? TypeProviderError as e -> e.Number
#endif
| ErrorsFromAddingSubsumptionConstraint (_, _, _, _, _, ContextInfo.DowncastUsedInsteadOfUpcast _, _) -> fst (FSComp.SR.considerUpcast("", ""))
@@ -747,7 +747,7 @@ let OutputPhasedErrorR (os:StringBuilder) (err:PhasedDiagnostic) =
| ErrorFromAddingConstraint(_, e, _) ->
OutputExceptionR os e
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ExtensionTyping.ProvidedTypeResolutionNoRange(e)
| ExtensionTyping.ProvidedTypeResolution(_, e) ->
@@ -1726,7 +1726,7 @@ let CollectDiagnostic (implicitIncludeDir, showFullPaths, flattenErrors, errorSt
relatedErrors |> List.iter OutputRelatedError
match err with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| {Exception = (:? TypeProviderError as tpe)} ->
tpe.Iter (fun e ->
let newErr = {err with Exception = e}
@@ -2137,14 +2137,14 @@ type AssemblyReference =
override x.ToString() = sprintf "AssemblyReference(%s)" x.Text
type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * AssemblyReference list
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list
#endif
type ImportedBinary =
{ FileName: string
RawMetadata: IRawFSharpAssemblyData
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
ProviderGeneratedAssembly: System.Reflection.Assembly option
IsProviderGenerated: bool
ProviderGeneratedStaticLinkMap : ProvidedAssemblyStaticLinkingMap option
@@ -2157,7 +2157,7 @@ type ImportedAssembly =
FSharpViewOfMetadata: CcuThunk
AssemblyAutoOpenAttributes: string list
AssemblyInternalsVisibleToAttributes: string list
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
IsProviderGenerated: bool
mutable TypeProviders: Tainted list
#endif
@@ -2291,7 +2291,7 @@ type TcConfigBuilder =
mutable showTimes : bool
mutable showLoadedAssemblies : bool
mutable continueAfterParseFailure : bool
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// show messages about extension type resolution?
mutable showExtensionTypeMessages : bool
#endif
@@ -2450,7 +2450,7 @@ type TcConfigBuilder =
showTimes = false
showLoadedAssemblies = false
continueAfterParseFailure = false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
showExtensionTypeMessages = false
#endif
pause = false
@@ -2916,7 +2916,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) =
member x.showTimes = data.showTimes
member x.showLoadedAssemblies = data.showLoadedAssemblies
member x.continueAfterParseFailure = data.continueAfterParseFailure
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member x.showExtensionTypeMessages = data.showExtensionTypeMessages
#endif
member x.pause = data.pause
@@ -3913,7 +3913,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
let mutable disposed = false
let mutable ilGlobalsOpt = ilGlobalsOpt
let mutable tcGlobals = None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let mutable generatedTypeRoots = new System.Collections.Generic.Dictionary()
#endif
@@ -4032,7 +4032,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
| UnresolvedImportedAssembly _ -> UnresolvedCcu(assref.QualifiedName)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member tcImports.GetProvidedAssemblyInfo(ctok, m, assembly: Tainted) =
let anameOpt = assembly.PUntaint((fun assembly -> match assembly with null -> None | a -> Some (a.GetName())), m)
match anameOpt with
@@ -4183,7 +4183,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
{ new Import.AssemblyLoader with
member x.FindCcuFromAssemblyRef (ctok, m, ilAssemblyRef) =
tcImports.FindCcuFromAssemblyRef (ctok, m, ilAssemblyRef)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member x.GetProvidedAssemblyInfo (ctok, m, assembly) = tcImports.GetProvidedAssemblyInfo (ctok, m, assembly)
member x.RecordGeneratedTypeRoot root = tcImports.RecordGeneratedTypeRoot root
#endif
@@ -4215,7 +4215,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
CheckDisposed()
tcGlobals <- Some g
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member private tcImports.InjectProvidedNamespaceOrTypeIntoEntity
(typeProviderEnvironment,
tcConfig:TcConfig,
@@ -4413,14 +4413,14 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
ILScopeRef = ilScopeRef
AssemblyAutoOpenAttributes = GetAutoOpenAttributes ilg ilModule
AssemblyInternalsVisibleToAttributes = GetInternalsVisibleToAttributes ilg ilModule
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
IsProviderGenerated = false
TypeProviders = []
#endif
FSharpOptimizationData = notlazy None }
tcImports.RegisterCcu(ccuinfo)
let phase2 () =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
ccuinfo.TypeProviders <- tcImports.ImportTypeProviderExtensions (ctok, tcConfig, filename, ilScopeRef, ilModule.ManifestOfAssembly.CustomAttrs.AsList, ccu.Contents, invalidateCcu, m)
#endif
[ResolvedImportedAssembly(ccuinfo)]
@@ -4428,7 +4428,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
member tcImports.PrepareToImportReferencedFSharpAssembly (ctok, m, filename, dllinfo:ImportedBinary) =
CheckDisposed()
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let tcConfig = tcConfigP.Get(ctok)
#endif
let ilModule = dllinfo.RawMetadata
@@ -4448,7 +4448,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
let minfo : PickledCcuInfo = data.RawData
let mspec = minfo.mspec
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let invalidateCcu = new Event<_>()
#endif
@@ -4461,7 +4461,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
SourceCodeDirectory = codeDir (* note: in some cases we fix up this information later *)
IsFSharp=true
Contents = mspec
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
InvalidateEvent=invalidateCcu.Publish
IsProviderGenerated = false
ImportProvidedType = (fun ty -> Import.ImportProvidedType (tcImports.GetImportMap()) m ty)
@@ -4489,13 +4489,13 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
AssemblyAutoOpenAttributes = ilModule.GetAutoOpenAttributes(ilg)
AssemblyInternalsVisibleToAttributes = ilModule.GetInternalsVisibleToAttributes(ilg)
FSharpOptimizationData=optdata
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
IsProviderGenerated = false
TypeProviders = []
#endif
ILScopeRef = ilScopeRef }
let phase2() =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match ilModule.TryGetRawILModule() with
| None -> () // no type providers can be used without a real IL Module present
| Some ilModule ->
@@ -4511,7 +4511,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
(* Relink *)
(* dprintf "Phase2: %s\n" filename; REMOVE DIAGNOSTICS *)
ccuRawDataAndInfos |> List.iter (fun (data, _, _) -> data.OptionalFixup(fun nm -> availableToOptionalCcu(tcImports.FindCcu(ctok, m, nm, lookupOnly=false))) |> ignore)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
ccuRawDataAndInfos |> List.iter (fun (_, _, phase2) -> phase2())
#endif
ccuRawDataAndInfos |> List.map p23 |> List.map ResolvedImportedAssembly
@@ -4549,7 +4549,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
let dllinfo =
{ RawMetadata=assemblyData
FileName=filename
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
ProviderGeneratedAssembly=None
IsProviderGenerated=false
ProviderGeneratedStaticLinkMap = None
@@ -4616,7 +4616,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
if tryFile (assemblyName + ".dll") then ()
else tryFile (assemblyName + ".exe") |> ignore
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member tcImports.TryFindProviderGeneratedAssemblyByName(ctok, assemblyName:string) : System.Reflection.Assembly option =
// The assembly may not be in the resolutions, but may be in the load set including EST injected assemblies
match tcImports.TryFindDllInfo (ctok, range0, assemblyName, lookupOnly=true) with
@@ -5359,7 +5359,7 @@ let GetInitialTcState(m, ccuName, tcConfig:TcConfig, tcGlobals, tcImports:TcImpo
let ccuData : CcuData =
{ IsFSharp=true
UsesFSharp20PlusQuotations=false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
InvalidateEvent=(new Event<_>()).Publish
IsProviderGenerated = false
ImportProvidedType = (fun ty -> Import.ImportProvidedType (tcImports.GetImportMap()) m ty)
diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi
index c5f14dc8bcf..8f782ccee16 100755
--- a/src/fsharp/CompileOps.fsi
+++ b/src/fsharp/CompileOps.fsi
@@ -23,7 +23,7 @@ open Microsoft.FSharp.Compiler.Infos
open Microsoft.FSharp.Compiler.ReferenceResolver
open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Core.CompilerServices
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -207,7 +207,7 @@ type AssemblyResolution =
type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * AssemblyReference list
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list
#endif
@@ -347,7 +347,7 @@ type TcConfigBuilder =
mutable showTimes: bool
mutable showLoadedAssemblies: bool
mutable continueAfterParseFailure: bool
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
mutable showExtensionTypeMessages: bool
#endif
mutable pause: bool
@@ -499,7 +499,7 @@ type TcConfig =
member showTimes: bool
member showLoadedAssemblies: bool
member continueAfterParseFailure: bool
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member showExtensionTypeMessages: bool
#endif
member pause: bool
@@ -555,7 +555,7 @@ type TcConfigProvider =
type ImportedBinary =
{ FileName: string
RawMetadata: IRawFSharpAssemblyData
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
ProviderGeneratedAssembly: System.Reflection.Assembly option
IsProviderGenerated: bool
ProviderGeneratedStaticLinkMap: ProvidedAssemblyStaticLinkingMap option
@@ -570,7 +570,7 @@ type ImportedAssembly =
FSharpViewOfMetadata: CcuThunk
AssemblyAutoOpenAttributes: string list
AssemblyInternalsVisibleToAttributes: string list
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
IsProviderGenerated: bool
mutable TypeProviders: Tainted list
#endif
@@ -599,7 +599,7 @@ type TcImports =
member FindDllInfo: CompilationThreadToken * range * string -> ImportedBinary
member TryFindDllInfo: CompilationThreadToken * range * string * lookupOnly: bool -> option
member FindCcuFromAssemblyRef: CompilationThreadToken * range * ILAssemblyRef -> CcuResolutionResult
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member ProviderGeneratedTypeRoots: ProviderGeneratedType list
#endif
member GetImportMap: unit -> Import.ImportMap
@@ -617,7 +617,7 @@ type TcImports =
/// Try to find the given assembly reference.
member TryFindExistingFullyQualifiedPathByExactAssemblyRef: CompilationThreadToken * ILAssemblyRef -> string option
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Try to find a provider-generated assembly
member TryFindProviderGeneratedAssemblyByName: CompilationThreadToken * assemblyName:string -> System.Reflection.Assembly option
#endif
diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs
index ce26cafde0a..1c78fd9aa33 100644
--- a/src/fsharp/CompileOptions.fs
+++ b/src/fsharp/CompileOptions.fs
@@ -903,7 +903,7 @@ let internalFlags (tcConfigB:TcConfigBuilder) =
CompilerOption("splitting", tagNone, OptionSwitch(splittingSwitch tcConfigB),Some(InternalCommandLineOption("splitting", rangeCmdArgs)), None)
CompilerOption("versionfile", tagString, OptionString (fun s -> tcConfigB.version <- VersionFile s), Some(InternalCommandLineOption("versionfile", rangeCmdArgs)), None)
CompilerOption("times" , tagNone, OptionUnit (fun () -> tcConfigB.showTimes <- true), Some(InternalCommandLineOption("times", rangeCmdArgs)), None) // "Display timing profiles for compilation")
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
CompilerOption("showextensionresolution" , tagNone, OptionUnit (fun () -> tcConfigB.showExtensionTypeMessages <- true), Some(InternalCommandLineOption("showextensionresolution", rangeCmdArgs)), None) // "Display information about extension type resolution")
#endif
(* BEGIN: Consider as public Retail option? *)
diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs
index 8529b3f0c4e..0ec8f9f832a 100644
--- a/src/fsharp/ConstraintSolver.fs
+++ b/src/fsharp/ConstraintSolver.fs
@@ -1333,7 +1333,7 @@ and RecordMemberConstraintSolution css m trace traitInfo res =
/// Convert a MethInfo into the data we save in the TAST
and MemberConstraintSolutionOfMethInfo css m minfo minst =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
#else
// to prevent unused parameter warning
ignore css
@@ -1347,7 +1347,7 @@ and MemberConstraintSolutionOfMethInfo css m minfo minst =
FSMethSln(typ, vref, minst)
| MethInfo.DefaultStructCtor _ ->
error(InternalError("the default struct constructor was the unexpected solution to a trait constraint", m))
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap, mi, _, m) ->
let g = amap.g
let minst = [] // GENERIC TYPE PROVIDERS: for generics, we would have an minst here
diff --git a/src/fsharp/ExtensionTyping.fs b/src/fsharp/ExtensionTyping.fs
index 57ddfff1a6e..dade9c9650e 100755
--- a/src/fsharp/ExtensionTyping.fs
+++ b/src/fsharp/ExtensionTyping.fs
@@ -4,7 +4,7 @@
namespace Microsoft.FSharp.Compiler
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
module internal ExtensionTyping =
open System
diff --git a/src/fsharp/ExtensionTyping.fsi b/src/fsharp/ExtensionTyping.fsi
index 7ac14362cbc..f796881c357 100755
--- a/src/fsharp/ExtensionTyping.fsi
+++ b/src/fsharp/ExtensionTyping.fsi
@@ -4,7 +4,7 @@
namespace Microsoft.FSharp.Compiler
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
module internal ExtensionTyping =
diff --git a/src/fsharp/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/src/fsharp/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
index f81d227e8d6..b68ab16911c 100644
--- a/src/fsharp/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
+++ b/src/fsharp/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
@@ -20,7 +20,7 @@
netcore
- $(DefineConstants);EXTENSIONTYPING;$(TargetDotnetProfile.ToLower())
+ $(DefineConstants);$(TargetDotnetProfile.ToLower())
true
diff --git a/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj
index 257443d115b..554547215cd 100644
--- a/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj
+++ b/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj
@@ -10,7 +10,6 @@
AnyCPU
{649FA588-F02E-457C-9FCF-87E46407481E}
Library
- EXTENSIONTYPING;$(DefineConstants)
FSharp.Compiler.Interactive.Settings
512
diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj
index e68a817dbba..dccca2632f1 100644
--- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj
+++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj
@@ -10,7 +10,6 @@
AnyCPU
Library
FSharp.Compiler.Private
- EXTENSIONTYPING;$(DefineConstants)
COMPILER;$(DefineConstants)
$(NoWarn);62;9
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}
diff --git a/src/fsharp/FSharp.Compiler.Unittests/FSharp.Compiler.Unittests.fsproj b/src/fsharp/FSharp.Compiler.Unittests/FSharp.Compiler.Unittests.fsproj
index 1e4f6603e7d..765e8cc5bb9 100644
--- a/src/fsharp/FSharp.Compiler.Unittests/FSharp.Compiler.Unittests.fsproj
+++ b/src/fsharp/FSharp.Compiler.Unittests/FSharp.Compiler.Unittests.fsproj
@@ -17,9 +17,6 @@
false
false
-
- $(DefineConstants);EXTENSIONTYPING
-
true
false
diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj b/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj
index 379990b793b..9a655b05f7d 100644
--- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj
+++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj
@@ -24,7 +24,7 @@
$(NoWarn);217
- $(DefineConstants);EXTENSIONTYPING;$(TargetDotnetProfile.ToLower())
+ $(DefineConstants);$(TargetDotnetProfile.ToLower())
true
diff --git a/src/fsharp/Fsc-proto/Fsc-proto.fsproj b/src/fsharp/Fsc-proto/Fsc-proto.fsproj
index 047e70052fb..82219020124 100644
--- a/src/fsharp/Fsc-proto/Fsc-proto.fsproj
+++ b/src/fsharp/Fsc-proto/Fsc-proto.fsproj
@@ -11,6 +11,7 @@
Exe
$(NoWarn);62
fsc-proto
+ NO_EXTENSIONTYPING;$(DefineConstants)
BUILDING_PROTO;$(DefineConstants)
BUILDING_WITH_LKG;$(DefineConstants)
COMPILER;$(DefineConstants)
diff --git a/src/fsharp/Fsc/Fsc.fsproj b/src/fsharp/Fsc/Fsc.fsproj
index 9775469cf1c..127f1c4753a 100644
--- a/src/fsharp/Fsc/Fsc.fsproj
+++ b/src/fsharp/Fsc/Fsc.fsproj
@@ -18,7 +18,6 @@
Exe
$(NoWarn);62
fsc
- EXTENSIONTYPING;$(DefineConstants)
COMPILER;$(DefineConstants)
true
$(OtherFlags) --warnon:1182
diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs
index dcc82333144..e0311b39529 100644
--- a/src/fsharp/IlxGen.fs
+++ b/src/fsharp/IlxGen.fs
@@ -400,7 +400,7 @@ and GenNamedTyAppAux (amap:ImportMap) m tyenv ptrsOK tcref tinst =
if ptrsOK = PtrTypesOK && tyconRefEq g tcref g.nativeptr_tcr && (freeInTypes CollectTypars tinst).FreeTypars.IsEmpty then
GenNamedTyAppAux amap m tyenv ptrsOK g.ilsigptr_tcr tinst
else
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match tcref.TypeReprInfo with
// Generate the base type, because that is always the representation of the erased type, unless the assembly is being injected
| TProvidedTypeExtensionPoint info when info.IsErased ->
@@ -6179,7 +6179,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) =
let tcref = mkLocalTyconRef tycon
if tycon.IsTypeAbbrev then () else
match tycon.TypeReprInfo with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedNamespaceExtensionPoint _ -> ()
| TProvidedTypeExtensionPoint _ -> ()
#endif
diff --git a/src/fsharp/InfoReader.fs b/src/fsharp/InfoReader.fs
index 375571f1afe..c6f8a7629ce 100644
--- a/src/fsharp/InfoReader.fs
+++ b/src/fsharp/InfoReader.fs
@@ -53,7 +53,7 @@ let GetImmediateIntrinsicMethInfosOfType (optFilter,ad) g amap m typ =
let minfos =
match metadataOfTy g typ with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info ->
let st = info.ProvidedType
let meths =
@@ -122,7 +122,7 @@ let GetImmediateIntrinsicPropInfosOfType (optFilter,ad) g amap m typ =
let pinfos =
match metadataOfTy g typ with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info ->
let st = info.ProvidedType
let matchingProps =
@@ -185,7 +185,7 @@ type InfoReader(g:TcGlobals, amap:Import.ImportMap) =
let GetImmediateIntrinsicILFieldsOfType (optFilter,ad) m typ =
let infos =
match metadataOfTy g typ with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info ->
let st = info.ProvidedType
match optFilter with
@@ -210,7 +210,7 @@ type InfoReader(g:TcGlobals, amap:Import.ImportMap) =
let ComputeImmediateIntrinsicEventsOfType (optFilter,ad) m typ =
let infos =
match metadataOfTy g typ with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info ->
let st = info.ProvidedType
match optFilter with
@@ -426,7 +426,7 @@ let GetIntrinsicConstructorInfosOfType (infoReader:InfoReader) m ty =
let amap = infoReader.amap
if isAppTy g ty then
match metadataOfTy g ty with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info ->
let st = info.ProvidedType
[ for ci in st.PApplyArray((fun st -> st.GetConstructors()), "GetConstructors", m) do
diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs
index ab6d2c0c762..8221e808746 100644
--- a/src/fsharp/MethodCalls.fs
+++ b/src/fsharp/MethodCalls.fs
@@ -27,7 +27,7 @@ open Microsoft.FSharp.Compiler.Tastops.DebugPrint
open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Compiler.TypeRelations
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -654,7 +654,7 @@ let MakeMethInfoCall amap m minfo minst args =
BuildFSharpMethodCall g m (typ,vref) valUseFlags minst args |> fst
| DefaultStructCtor(_,typ) ->
mkDefault (m,typ)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap,mi,_,m) ->
let isProp = false // not necessarily correct, but this is only used post-creflect where this flag is irrelevant
let ilMethodRef = Import.ImportProvidedMethodBaseAsILMethodRef amap m mi
@@ -668,7 +668,7 @@ let MakeMethInfoCall amap m minfo minst args =
#endif
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// This imports a provided method, and checks if it is a known compiler intrinsic like "1 + 2"
let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap:Import.ImportMap, m:range, mbase: Tainted) =
let methodName = mbase.PUntaint((fun x -> x.Name),m)
@@ -718,7 +718,7 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA
valUseFlags
match minfo with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// By this time this is an erased method info, e.g. one returned from an expression
// REVIEW: copied from tastops, which doesn't allow protected methods
| ProvidedMeth (amap,providedMeth,_,_) ->
@@ -835,7 +835,7 @@ let CoerceFromFSharpFuncToDelegate g amap infoReader ad callerArgTy m callerArgE
//-------------------------------------------------------------------------
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// This file is not a great place for this functionality to sit, it's here because of BuildMethodCall
module ProvidedMethodCalls =
diff --git a/src/fsharp/MethodOverrides.fs b/src/fsharp/MethodOverrides.fs
index 56092362db0..a326248b553 100644
--- a/src/fsharp/MethodOverrides.fs
+++ b/src/fsharp/MethodOverrides.fs
@@ -650,7 +650,7 @@ let FinalTypeDefinitionChecksAtEndOfInferenceScope (infoReader:InfoReader, nenv,
// Note you only have to explicitly implement 'System.IComparable' to customize structural comparison AND equality on F# types
if isImplementation &&
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
not tycon.IsProvidedGeneratedTycon &&
#endif
Option.isNone tycon.GeneratedCompareToValues &&
@@ -667,7 +667,7 @@ let FinalTypeDefinitionChecksAtEndOfInferenceScope (infoReader:InfoReader, nenv,
AugmentWithHashCompare.CheckAugmentationAttribs isImplementation g amap tycon
// Check some conditions about generic comparison and hashing. We can only check this condition after we've done the augmentation
if isImplementation
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
&& not tycon.IsProvidedGeneratedTycon
#endif
then
diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs
index 5a30b96cd2f..1962251c389 100644
--- a/src/fsharp/NameResolution.fs
+++ b/src/fsharp/NameResolution.fs
@@ -27,7 +27,7 @@ open Microsoft.FSharp.Compiler.InfoReader
open Microsoft.FSharp.Compiler.PrettyNaming
open System.Collections.Generic
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -1068,7 +1068,7 @@ type PermitDirectReferenceToGeneratedType =
| No
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Check for direct references to generated provided types.
let CheckForDirectReferenceToGeneratedType (tcref: TyconRef, genOk, m) =
@@ -1143,7 +1143,7 @@ let LookupTypeNameInEntityMaybeHaveArity (amap, m, ad, nm, staticResInfo:TypeNam
match LookupTypeNameInEntityHaveArity nm staticResInfo mtyp with
| Some tycon -> [modref.NestedTyconRef tycon]
| None -> []
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let tcrefs =
match tcrefs with
| [] -> ResolveProvidedTypeNameInEntity (amap, m, nm, modref)
@@ -1173,7 +1173,7 @@ let GetNestedTypesOfType (ad, ncenv:NameResolver, optFilter, staticResInfo, chec
let tycon = tcref.Deref
let mty = tycon.ModuleOrNamespaceType
// No dotting through type generators to get to a nested type!
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
if checkForGenerated then
CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m)
#else
@@ -1185,7 +1185,7 @@ let GetNestedTypesOfType (ad, ncenv:NameResolver, optFilter, staticResInfo, chec
let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, m, ad, nm, staticResInfo, tcref)
tcrefs |> List.map (MakeNestedType ncenv tinst m)
| None ->
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match tycon.TypeReprInfo with
| TProvidedTypeExtensionPoint info ->
[ for nestedType in info.ProvidedType.PApplyArray((fun sty -> sty.GetNestedTypes()), "GetNestedTypes", m) do
@@ -1729,7 +1729,7 @@ let CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities
| _ ->
tcrefs
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
for (_,tcref) in tcrefs do
// Type generators can't be returned by name resolution, unless PermitDirectReferenceToGeneratedType.Yes
CheckForDirectReferenceToGeneratedType (tcref, genOk, m)
@@ -1933,7 +1933,7 @@ let SelectMethInfosFromExtMembers (infoReader:InfoReader) optFilter apparentTy m
// F#-defined IL-style extension methods are not seen as extension methods in F# code
| FSMeth(g,_,vref,_) ->
yield (FSMeth(g, apparentTy, vref, Some pri))
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// // Provided extension methods are not yet supported
| ProvidedMeth(amap,providedMeth,_,m) ->
yield (ProvidedMeth(amap, providedMeth, Some pri,m))
@@ -1991,7 +1991,7 @@ let CoreDisplayName(pinfo:PropInfo) =
| FSProp(_,_,Some get,_) -> get.CoreDisplayName
| FSProp _ -> failwith "unexpected (property must have either getter or setter)"
| ILProp(_,ILPropInfo(_,def)) -> def.Name
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) -> pi.PUntaint((fun pi -> pi.Name), m)
#endif
@@ -2164,7 +2164,7 @@ let ResolveLongIdentInType sink ncenv nenv lookupKind m ad lid findFlag typeName
item,rest
let private ResolveLongIdentInTyconRef (ncenv:NameResolver) nenv lookupKind resInfo depth m ad lid typeNameResInfo tcref =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// No dotting through type generators to get to a member!
CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m)
#endif
@@ -2720,7 +2720,7 @@ let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo
match lid with
| [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m))
| [id] ->
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// No dotting through type generators to get to a nested type!
CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m)
#endif
@@ -2738,7 +2738,7 @@ let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo
raze (UndefinedName(depth,FSComp.SR.undefinedNameType,id,suggestTypes))
| id::rest ->
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// No dotting through type generators to get to a nested type!
CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m)
#endif
@@ -3565,7 +3565,7 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso
if addersAndRemovers.IsEmpty then minfos
else minfos |> List.filter (fun minfo -> not (addersAndRemovers.Contains minfo.LogicalName))
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// Filter out the ones with mangled names from applying static parameters
let minfos =
let methsWithStaticParams =
@@ -4191,7 +4191,7 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics typ
if addersAndRemovers.IsEmpty then minfos
else minfos |> List.filter (fun minfo -> not (addersAndRemovers.Contains minfo.LogicalName))
- #if EXTENSIONTYPING
+ #if !NO_EXTENSIONTYPING
// Filter out the ones with mangled names from applying static parameters
let minfos =
let methsWithStaticParams =
diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs
index 2387b0365c3..258f12a520c 100755
--- a/src/fsharp/NicePrint.fs
+++ b/src/fsharp/NicePrint.fs
@@ -27,7 +27,7 @@ open Microsoft.FSharp.Compiler.PrettyNaming
open Microsoft.FSharp.Core.Printf
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
open Microsoft.FSharp.Core.CompilerServices
#endif
@@ -1370,7 +1370,7 @@ module InfoMemberPrinting =
let prettyTyparInst, prettyMethInfo, minst = prettifyILMethInfo amap m methInfo typarInst ilminfo
let resL = layoutMethInfoCSharpStyle amap m denv prettyMethInfo minst
prettyTyparInst, resL
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _ ->
let prettyTyparInst, _ = PrettyTypes.PrettifyInst amap.g typarInst
prettyTyparInst, layoutMethInfoCSharpStyle amap m denv methInfo methInfo.FormalMethodInst
@@ -1469,7 +1469,7 @@ module private TastDefinitionPrinting =
| TAsmRepr _
| TILObjectRepr _
| TMeasureableRepr _
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedTypeExtensionPoint _
| TProvidedNamespaceExtensionPoint _
#endif
@@ -1477,7 +1477,7 @@ module private TastDefinitionPrinting =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let private layoutILFieldInfo denv amap m (e: ILFieldInfo) =
let staticL = if e.IsStatic then WordL.keywordStatic else emptyL
let nameL = wordL (tagField (adjustILName e.FieldName))
@@ -1642,7 +1642,7 @@ module private TastDefinitionPrinting =
let tpsL = layoutTyparDecls denv nameL tycon.IsPrefixDisplay tps
typewordL ^^ tpsL
let start = Option.map tagKeyword start
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match tycon.IsProvided with
| true ->
layoutProvidedTycon denv infoReader ad m start lhsL ty
diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs
index 029de52c39f..8906c9a4e8f 100644
--- a/src/fsharp/PostInferenceChecks.fs
+++ b/src/fsharp/PostInferenceChecks.fs
@@ -1379,7 +1379,7 @@ let CheckRecdField isUnion cenv env (tycon:Tycon) (rfield:RecdField) =
CheckForByrefLikeType cenv env rfield.FormalType (fun () -> errorR(Error(FSComp.SR.chkCantStoreByrefValue(), tycon.Range)))
let CheckEntityDefn cenv env (tycon:Entity) =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
if not tycon.IsProvidedGeneratedTycon then
#endif
let env = { env with reflect = env.reflect || HasFSharpAttribute cenv.g cenv.g.attrib_ReflectedDefinitionAttribute tycon.Attribs }
diff --git a/src/fsharp/QuotationTranslator.fs b/src/fsharp/QuotationTranslator.fs
index 5ca9483fe8a..0f599ff60fd 100644
--- a/src/fsharp/QuotationTranslator.fs
+++ b/src/fsharp/QuotationTranslator.fs
@@ -802,7 +802,7 @@ and ConvType cenv env m typ =
| TType_ucase(UCRef(tcref,_),tyargs) // Note: we erase union case 'types' when converting to quotations
| TType_app(tcref,tyargs) ->
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match TryElimErasableTyconRef cenv m tcref with
| Some baseTy -> ConvType cenv env m baseTy
| _ ->
@@ -926,7 +926,7 @@ and ConvDecisionTree cenv env tgs typR x =
and IsILTypeRefStaticLinkLocal cenv m (tr:ILTypeRef) =
ignore cenv; ignore m
match tr.Scope with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ILScopeRef.Assembly aref
when not cenv.g.isInteractive &&
aref.Name <> cenv.g.ilg.primaryAssemblyName && // optimization to avoid this check in the common case
@@ -985,7 +985,7 @@ and ConvILType cenv env m ty =
| ILType.FunctionPointer _ -> wfail(Error(FSComp.SR.crefQuotationsCantContainThisType(), m))
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
and TryElimErasableTyconRef cenv m (tcref:TyconRef) =
match tcref.TypeReprInfo with
// Get the base type
@@ -994,7 +994,7 @@ and TryElimErasableTyconRef cenv m (tcref:TyconRef) =
#endif
and ConvTyconRef cenv (tcref:TyconRef) m =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match TryElimErasableTyconRef cenv m tcref with
| Some baseTy -> ConvTyconRef cenv (tcrefOfAppTy cenv.g baseTy) m
| None ->
diff --git a/src/fsharp/SignatureConformance.fs b/src/fsharp/SignatureConformance.fs
index cd41c20fca9..21d2fd06132 100644
--- a/src/fsharp/SignatureConformance.fs
+++ b/src/fsharp/SignatureConformance.fs
@@ -17,7 +17,7 @@ open Microsoft.FSharp.Compiler.Tastops
open Microsoft.FSharp.Compiler.Lib
open Microsoft.FSharp.Compiler.Infos
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -446,7 +446,7 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) =
| (TRecdRepr _
| TUnionRepr _
| TILObjectRepr _
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedTypeExtensionPoint _
| TProvidedNamespaceExtensionPoint _
#endif
@@ -498,7 +498,7 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) =
| (TMeasureableRepr ty1), (TMeasureableRepr ty2) ->
if typeAEquiv g aenv ty1 ty2 then true else (errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false)
| TNoRepr, TNoRepr -> true
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedTypeExtensionPoint info1 , TProvidedTypeExtensionPoint info2 ->
Tainted.EqTainted info1.ProvidedType.TypeProvider info2.ProvidedType.TypeProvider && ProvidedType.TaintedEquals(info1.ProvidedType,info2.ProvidedType)
| TProvidedNamespaceExtensionPoint _, TProvidedNamespaceExtensionPoint _ ->
diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs
index 5b0c0eaf0aa..d2d378508de 100644
--- a/src/fsharp/TastOps.fs
+++ b/src/fsharp/TastOps.fs
@@ -22,7 +22,7 @@ open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Compiler.Layout
open Microsoft.FSharp.Compiler.Layout.TaggedTextOps
open Microsoft.FSharp.Compiler.PrettyNaming
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -627,14 +627,14 @@ let reduceTyconRefAbbrev (tcref:TyconRef) tyargs =
reduceTyconAbbrev tcref.Deref tyargs
let reduceTyconMeasureableOrProvided (g:TcGlobals) (tycon:Tycon) tyargs =
-#if !EXTENSIONTYPING
+#if NO_EXTENSIONTYPING
ignore g // otherwise g would be unused
#endif
let repr = tycon.TypeReprInfo
match repr with
| TMeasureableRepr ty ->
if isNil tyargs then ty else instType (mkTyconInst tycon tyargs) ty
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedTypeExtensionPoint info when info.IsErased -> info.BaseTypeForErased (range0, g.obj_ty)
#endif
| _ -> invalidArg "tc" "this type definition is not a refinement"
@@ -921,7 +921,7 @@ let measureEquiv g m1 m2 = measureAEquiv g TypeEquivEnv.Empty m1 m2
let isErasedType g ty =
match stripTyEqns g ty with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TType_app (tcref, _) -> tcref.IsProvidedErasedTycon
#endif
| _ -> false
@@ -1516,19 +1516,19 @@ let isILAppTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) ->
let isNativePtrTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tyconRefEq g g.nativeptr_tcr tcref | _ -> false)
let isByrefTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tyconRefEq g g.byref_tcr tcref | _ -> false)
let isByrefLikeTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> isByrefLikeTyconRef g tcref | _ -> false)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let extensionInfoOfTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tcref.TypeReprInfo | _ -> TNoRepr)
#endif
type TypeDefMetadata =
| ILTypeMetadata of TILObjectReprData
| FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata of TProvidedTypeInfo
#endif
let metadataOfTycon (tycon:Tycon) =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match tycon.TypeReprInfo with
| TProvidedTypeExtensionPoint info -> ProvidedTypeMetadata info
| _ ->
@@ -1540,7 +1540,7 @@ let metadataOfTycon (tycon:Tycon) =
let metadataOfTy g ty =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match extensionInfoOfTy g ty with
| TProvidedTypeExtensionPoint info -> ProvidedTypeMetadata info
| _ ->
@@ -1554,7 +1554,7 @@ let metadataOfTy g ty =
let isILReferenceTy g ty =
match metadataOfTy g ty with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info -> not info.IsStructOrEnum
#endif
| ILTypeMetadata (TILObjectReprData(_, _, td)) -> not td.IsStructOrEnum
@@ -1562,7 +1562,7 @@ let isILReferenceTy g ty =
let isILInterfaceTycon (tycon:Tycon) =
match metadataOfTycon tycon with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info -> info.IsInterface
#endif
| ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Interface)
@@ -1594,7 +1594,7 @@ let isFSharpInterfaceTy g ty =
let isDelegateTy g ty =
match metadataOfTy g ty with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info -> info.IsDelegate ()
#endif
| ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Delegate)
@@ -1605,7 +1605,7 @@ let isDelegateTy g ty =
let isInterfaceTy g ty =
match metadataOfTy g ty with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info -> info.IsInterface
#endif
| ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Interface)
@@ -1613,7 +1613,7 @@ let isInterfaceTy g ty =
let isClassTy g ty =
match metadataOfTy g ty with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info -> info.IsClass
#endif
| ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Class)
@@ -2781,7 +2781,7 @@ let TryFindILAttributeOpt attr attrs =
let TryBindTyconRefAttribute g (m:range) (AttribInfo (atref, _) as args) (tcref:TyconRef) f1 f2 f3 =
ignore m; ignore f3
match metadataOfTycon tcref.Deref with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info ->
let provAttribs = info.ProvidedType.PApply((fun a -> (a :> IProvidedCustomAttributeProvider)), m)
match provAttribs.PUntaint((fun a -> a.GetAttributeConstructorArgs(provAttribs.TypeProvider.PUntaintNoFailure(id), atref.FullName)), m) with
@@ -3394,7 +3394,7 @@ module DebugPrint = begin
| _ -> failwith "unreachable"
let reprL =
match tycon.TypeReprInfo with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedTypeExtensionPoint _
| TProvidedNamespaceExtensionPoint _
#endif
@@ -4443,7 +4443,7 @@ let InferArityOfExprBinding g allowTypeDirectedDetupling (v:Val) e =
let underlyingTypeOfEnumTy (g: TcGlobals) typ =
assert(isEnumTy g typ)
match metadataOfTy g typ with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info -> info.UnderlyingTypeOfEnum()
#endif
| ILTypeMetadata (TILObjectReprData(_, _, tdef)) ->
@@ -4885,7 +4885,7 @@ and remapTyconRepr g tmenv repr =
| TRecdRepr x -> TRecdRepr (remapRecdFields g tmenv x)
| TUnionRepr x -> TUnionRepr (remapUnionCases g tmenv x)
| TILObjectRepr _ -> failwith "cannot remap IL type definitions"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedNamespaceExtensionPoint _ -> repr
| TProvidedTypeExtensionPoint info ->
TProvidedTypeExtensionPoint
@@ -6324,7 +6324,7 @@ let mkCompilationMappingAttrForQuotationResource (g:TcGlobals) (nm, tys: ILTypeR
[ ILAttribElem.String (Some nm); ILAttribElem.Array (g.ilg.typ_Type, [ for ty in tys -> ILAttribElem.TypeRef (Some ty) ]) ],
[])
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
//----------------------------------------------------------------------------
// Decode extensible typing attributes
//----------------------------------------------------------------------------
@@ -7319,7 +7319,7 @@ let isSealedTy g ty =
isArrayTy g ty ||
match metadataOfTy g ty with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata st -> st.IsSealed
#endif
| ILTypeMetadata (TILObjectReprData(_, _, td)) -> td.IsSealed
diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi
index 38220852ecc..04410eae1c1 100755
--- a/src/fsharp/TastOps.fsi
+++ b/src/fsharp/TastOps.fsi
@@ -19,7 +19,7 @@ open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Compiler.Layout
open Microsoft.FSharp.Compiler.Lib
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -993,7 +993,7 @@ val mkPrintfFormatTy : TcGlobals -> TType -> TType -> TType -> TType -> TType ->
type TypeDefMetadata =
| ILTypeMetadata of TILObjectReprData
| FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata of TProvidedTypeInfo
#endif
@@ -1286,7 +1286,7 @@ val TyconRefHasAttribute : TcGlobals -> range -> BuiltinAttribInfo -> TyconRef -
/// Try to find the AttributeUsage attribute, looking for the value of the AllowMultiple named parameter
val TryFindAttributeUsageAttribute : TcGlobals -> range -> TyconRef -> bool option
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// returns Some(assemblyName) for success
val TryDecodeTypeProviderAssemblyAttr : ILGlobals -> ILAttribute -> string option
#endif
diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs
index 10e8897d60e..18307ce1559 100755
--- a/src/fsharp/TastPickle.fs
+++ b/src/fsharp/TastPickle.fs
@@ -665,7 +665,7 @@ let u_encoded_nleref = u_tup2 u_int (u_array u_int)
let u_nleref st = lookup_uniq st st.inlerefs (u_int st)
let encode_nleref ccuTab stringTab nlerefTab thisCcu (nleref: NonLocalEntityRef) =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// Remap references to statically-linked Entity nodes in provider-generated entities to point to the current assembly.
// References to these nodes _do_ appear in F# assembly metadata, because they may be public.
let nleref =
@@ -1646,7 +1646,7 @@ and p_tycon_repr x st =
| TFSharpObjectRepr r -> p_byte 1 st; p_byte 3 st; p_tycon_objmodel_data r st; false
| TMeasureableRepr ty -> p_byte 1 st; p_byte 4 st; p_typ ty st; false
| TNoRepr -> p_byte 0 st; false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedTypeExtensionPoint info ->
if info.IsErased then
// Pickle erased type definitions as a NoRepr
diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs
index 9cb244a4669..a0dc645905d 100755
--- a/src/fsharp/TypeChecker.fs
+++ b/src/fsharp/TypeChecker.fs
@@ -40,7 +40,7 @@ open Microsoft.FSharp.Compiler.NameResolution
open Microsoft.FSharp.Compiler.PrettyNaming
open Microsoft.FSharp.Compiler.InfoReader
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -3016,7 +3016,7 @@ let BuildPossiblyConditionalMethodCall cenv env isMutable m isProp minfo valUseF
mkUnit cenv.g m, cenv.g.unit_ty
| _ ->
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match minfo with
| ProvidedMeth(_, mi, _, _) ->
// BuildInvokerExpressionForProvidedMethodCall converts references to F# intrinsics back to values
@@ -3080,7 +3080,7 @@ let BuildILFieldGet g amap m objExpr (finfo:ILFieldInfo) =
let valu = if isValueType then AsValue else AsObject
let tinst = finfo.TypeInst
let fieldType = finfo.FieldType (amap, m)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let ty = tyOfExpr g objExpr
match finfo with
| ProvidedField _ when (isErasedType g ty) ->
@@ -4719,7 +4719,7 @@ and TcTyparConstraints cenv newOk checkCxs occ env tpenv wcs =
let _, tpenv = List.fold (fun (ridx, tpenv) tc -> ridx - 1, TcTyparConstraint ridx cenv newOk checkCxs occ env tpenv tc) (List.length wcs - 1, tpenv) wcs
tpenv
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
and TcStaticConstantParameter cenv (env:TcEnv) tpenv kind (v:SynType) idOpt container =
let fail() = error(Error(FSComp.SR.etInvalidStaticArgument(NicePrint.minimalStringOfType env.DisplayEnv kind), v.Range))
let record ttype =
@@ -4908,7 +4908,7 @@ and TcTypeApp cenv newOk checkCxs occ env tpenv m tcref pathTypeArgs (synArgTys:
CheckTyconAccessible cenv.amap m env.eAccessRights tcref |> ignore
CheckEntityAttributes cenv.g tcref m |> CommitOperationResult
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// Provided types are (currently) always non-generic. Their names may include mangled
// static parameters, which are passed by the provider.
if tcref.Deref.IsProvided then TcProvidedTypeApp cenv env tpenv tcref synArgTys m else
@@ -8623,7 +8623,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del
| (DelayedTypeApp(tys, mTypeArgs, mExprAndTypeArgs) :: otherDelayed) ->
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match TryTcMethodAppToStaticConstantArgs cenv env tpenv (minfos, Some (tys, mTypeArgs), mExprAndTypeArgs, mItem) with
| Some minfoAfterStaticArguments ->
@@ -8654,7 +8654,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del
TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndTypeArgs mItem methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic otherDelayed
| _ ->
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
if not minfos.IsEmpty && minfos.[0].ProvidedStaticParameterInfo.IsSome then
error(Error(FSComp.SR.etMissingStaticArgumentsToMethod(), mItem))
#endif
@@ -8676,7 +8676,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del
let objTyAfterTyArgs, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv mExprAndTypeArgs objTy tyargs
CallExprHasTypeSink cenv.tcSink (mExprAndArg, env.NameEnv, objTyAfterTyArgs, env.DisplayEnv, env.eAccessRights)
let itemAfterTyArgs, minfosAfterTyArgs =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// If the type is provided and took static arguments then the constructor will have changed
// to a provided constructor on the statically instantiated type. Re-resolve that constructor.
match objTyAfterTyArgs with
@@ -9039,7 +9039,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela
// To get better warnings we special case some of the few known mutate-a-struct method names
let mutates = (if methodName = "MoveNext" || methodName = "GetNextArg" then DefinitelyMutates else PossiblyMutates)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match TryTcMethodAppToStaticConstantArgs cenv env tpenv (minfos, tyargsOpt, mExprAndItem, mItem) with
| Some minfoAfterStaticArguments ->
// Replace the resolution including the static parameters, plus the extra information about the original method info
@@ -14703,7 +14703,7 @@ module EstablishTypeDefinitionCores =
tycon.entity_tycon_repr <- repr
attrs, getFinalAttrs
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Get the items on the r.h.s. of a 'type X = ABC<...>' definition
let private TcTyconDefnCore_GetGenerateDeclaration_Rhs rhsType =
match rhsType with
@@ -14926,7 +14926,7 @@ module EstablishTypeDefinitionCores =
| SynTypeDefnSimpleRepr.TypeAbbrev(ParserDetail.Ok, rhsType, m) ->
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// Check we have not already decided that this is a generative provided type definition. If we have already done this (i.e. this is the second pass
// for a generative provided type definition, then there is no more work to do).
if (match tycon.entity_tycon_repr with TNoRepr -> true | _ -> false) then
diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs
index b880d24dfb6..8aea32c097e 100644
--- a/src/fsharp/fsc.fs
+++ b/src/fsharp/fsc.fs
@@ -53,7 +53,7 @@ open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.Tastops
open Microsoft.FSharp.Compiler.TcGlobals
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -1103,7 +1103,7 @@ module StaticLinker =
// Don't save interface, optimization or resource definitions for provider-generated assemblies.
// These are "fake".
let isProvided (ccu: CcuThunk option) =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match ccu with
| Some c -> c.IsProviderGenerated
| None -> false
@@ -1333,7 +1333,7 @@ module StaticLinker =
// prior to this point.
let StaticLink (ctok, tcConfig:TcConfig, tcImports:TcImports, ilGlobals:ILGlobals) =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let providerGeneratedAssemblies =
[ // Add all EST-generated assemblies into the static linking set
@@ -1347,7 +1347,7 @@ module StaticLinker =
(fun ilxMainModule -> LegacyFindAndAddMscorlibTypesForStaticLinkingIntoFSharpCoreLibraryForNet20 (tcConfig, ilGlobals, ilxMainModule))
elif not tcConfig.standalone && tcConfig.extraStaticLinkRoots.IsEmpty
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
&& providerGeneratedAssemblies.IsEmpty
#endif
then
@@ -1360,7 +1360,7 @@ module StaticLinker =
ReportTime tcConfig "Static link"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
Morphs.enableMorphCustomAttributeData()
let providerGeneratedILModules = FindProviderGeneratedILModules (ctok, tcImports, providerGeneratedAssemblies)
diff --git a/src/fsharp/fsi/Fsi.fsproj b/src/fsharp/fsi/Fsi.fsproj
index 66b633519ad..ea99ddf1486 100644
--- a/src/fsharp/fsi/Fsi.fsproj
+++ b/src/fsharp/fsi/Fsi.fsproj
@@ -18,7 +18,6 @@
$(NoWarn);62
fsi
0x0A000000
- EXTENSIONTYPING;$(DefineConstants)
COMPILER;$(DefineConstants)
FSI_SHADOW_COPY_REFERENCES;$(DefineConstants)
FSI_SERVER;$(DefineConstants)
diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs
index c5e3d54509b..7cf093f9bef 100644
--- a/src/fsharp/fsi/fsi.fs
+++ b/src/fsharp/fsi/fsi.fs
@@ -1671,7 +1671,7 @@ module internal MagicAssemblyResolution =
| Some (OkResult (warns,[r])) -> OkResult (warns, Choice1Of2 r.resolvedPath)
| _ ->
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match tcImports.TryFindProviderGeneratedAssemblyByName(ctok, simpleAssemName) with
| Some(assembly) -> OkResult([],Choice2Of2 assembly)
| None ->
@@ -2564,7 +2564,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
// Explanation: This callback is invoked during compilation to resolve assembly references
// We don't yet propagate the ctok through these calls (though it looks plausible to do so).
let ctok = AssumeCompilationThreadWithoutEvidence ()
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match tcImports.TryFindProviderGeneratedAssemblyByName (ctok, aref.Name) with
| Some assembly -> Some (Choice2Of2 assembly)
| None ->
diff --git a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj
index 0e8d910cb99..ff1fe0c1176 100644
--- a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj
+++ b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj
@@ -13,7 +13,6 @@
$(NoWarn);62
fsiAnyCpu
0x0A000000
- EXTENSIONTYPING;$(DefineConstants)
COMPILER;$(DefineConstants)
FSI_SHADOW_COPY_REFERENCES;$(DefineConstants)
FSI_SERVER;$(DefineConstants)
diff --git a/src/fsharp/import.fs b/src/fsharp/import.fs
index f444cca7e52..9d89864908c 100644
--- a/src/fsharp/import.fs
+++ b/src/fsharp/import.fs
@@ -17,7 +17,7 @@ open Microsoft.FSharp.Compiler.AbstractIL.IL
open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Compiler.Ast
open Microsoft.FSharp.Compiler.ErrorLogger
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -27,7 +27,7 @@ type AssemblyLoader =
/// Resolve an Abstract IL assembly reference to a Ccu
abstract FindCcuFromAssemblyRef : CompilationThreadToken * range * ILAssemblyRef -> CcuResolutionResult
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Get a flag indicating if an assembly is a provided assembly, plus the
/// table of information recording remappings from type names in the provided assembly to type
@@ -100,7 +100,7 @@ let ImportTypeRefData (env:ImportMap) m (scoref,path,typeName) =
fakeTyconRef.Deref
with _ ->
error (Error(FSComp.SR.impReferencedTypeCouldNotBeFoundInAssembly(String.concat "." (Array.append path [| typeName |]), ccu.AssemblyName),m))
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
// Validate (once because of caching)
match tycon.TypeReprInfo with
| TProvidedTypeExtensionPoint info ->
@@ -195,7 +195,7 @@ let rec CanImportILType (env:ImportMap) m typ =
| ILType.Modified(_,_,ty) -> CanImportILType env m ty
| ILType.TypeVar _u16 -> true
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Import a provided type reference as an F# type TyconRef
let ImportProvidedNamedType (env:ImportMap) (m:range) (st:Tainted) =
@@ -566,7 +566,7 @@ let ImportILAssembly(amap:(unit -> ImportMap),m,auxModuleLoader,sref,sourceDir,f
let ccuData : CcuData =
{ IsFSharp=false
UsesFSharp20PlusQuotations=false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
InvalidateEvent=invalidateCcu
IsProviderGenerated = false
ImportProvidedType = (fun ty -> ImportProvidedType (amap()) m ty)
diff --git a/src/fsharp/import.fsi b/src/fsharp/import.fsi
index d13328d3360..02415e922f8 100644
--- a/src/fsharp/import.fsi
+++ b/src/fsharp/import.fsi
@@ -8,7 +8,7 @@ open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Compiler.Range
open Microsoft.FSharp.Compiler.AbstractIL.IL
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
#endif
@@ -21,7 +21,7 @@ type AssemblyLoader =
/// Resolve an Abstract IL assembly reference to a Ccu
abstract FindCcuFromAssemblyRef : CompilationThreadToken * range * ILAssemblyRef -> CcuResolutionResult
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Get a flag indicating if an assembly is a provided assembly, plus the
/// table of information recording remappings from type names in the provided assembly to type
/// names in the statically linked, embedded assembly.
@@ -60,7 +60,7 @@ val internal ImportILType : ImportMap -> range -> TType list -> ILType -> TType
/// Pre-check for ability to import an IL type as an F# type.
val internal CanImportILType : ImportMap -> range -> ILType -> bool
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Import a provided type as an F# type.
val internal ImportProvidedType : ImportMap -> range -> (* TType list -> *) Tainted -> TType
diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs
index 96d8ec9aba8..5ac157c8d42 100755
--- a/src/fsharp/infos.fs
+++ b/src/fsharp/infos.fs
@@ -23,7 +23,7 @@ open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Compiler.Lib
open Microsoft.FSharp.Core.Printf
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
open Microsoft.FSharp.Core.CompilerServices
#endif
@@ -55,14 +55,14 @@ let isExnDeclTy g typ =
/// Get the base type of a type, taking into account type instantiations. Return None if the
/// type has no base type.
let GetSuperTypeOfType g amap m typ =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let typ = (if isAppTy g typ && (tcrefOfAppTy g typ).IsProvided then stripTyEqns g typ else stripTyEqnsAndMeasureEqns g typ)
#else
let typ = stripTyEqnsAndMeasureEqns g typ
#endif
match metadataOfTy g typ with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info ->
let st = info.ProvidedType
let superOpt = st.PApplyOption((fun st -> match st.BaseType with null -> None | t -> Some t),m)
@@ -125,7 +125,7 @@ let rec GetImmediateInterfacesOfType skipUnref g amap m typ =
yield mkAppTy g.system_GenericIEquatable_tcref [typ]]
else
match metadataOfTy g typ with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info ->
[ for ity in info.ProvidedType.PApplyArray((fun st -> st.GetInterfaces()), "GetInterfaces", m) do
yield Import.ImportProvidedType amap m ity ]
@@ -398,7 +398,7 @@ type ValRef with
// as backing data for MethInfo, PropInfo etc.
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Get the return type of a provided method, where 'void' is returned as 'None'
let GetCompiledReturnTyOfProvidedMethodInfo amap m (mi:Tainted) =
let returnType =
@@ -583,7 +583,7 @@ type ParamData =
//-------------------------------------------------------------------------
// Helper methods associated with type providers
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
type ILFieldInit with
/// Compute the ILFieldInit for the given provided constant value for a provided enum type.
@@ -862,7 +862,7 @@ type MethInfo =
/// Describes a use of a pseudo-method corresponding to the default constructor for a .NET struct type
| DefaultStructCtor of TcGlobals * TType
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Describes a use of a method backed by provided metadata
| ProvidedMeth of Import.ImportMap * Tainted * ExtensionMethodPriority option * range
#endif
@@ -876,7 +876,7 @@ type MethInfo =
| ILMeth(_g,ilminfo,_) -> ilminfo.ApparentEnclosingType
| FSMeth(_g,typ,_,_) -> typ
| DefaultStructCtor(_g,typ) -> typ
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap,mi,_,m) ->
Import.ImportProvidedType amap m (mi.PApply((fun mi -> mi.DeclaringType),m))
#endif
@@ -895,7 +895,7 @@ type MethInfo =
match x with
| ILMeth _ -> None
| FSMeth _ -> None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth (_, mb, _, m) ->
let staticParams = mb.PApplyWithProvider((fun (mb,provider) -> mb.GetStaticParametersForMethod(provider)), range=m)
let staticParams = staticParams.PApplyArray(id, "GetStaticParametersForMethod", m)
@@ -911,7 +911,7 @@ type MethInfo =
match x with
| ILMeth(_,_,pri) -> pri
| FSMeth(_,_,_,pri) -> pri
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,_,pri,_) -> pri
#endif
| DefaultStructCtor _ -> None
@@ -927,7 +927,7 @@ type MethInfo =
match x with
| ILMeth(_,y,_) -> "ILMeth: " + y.ILName
| FSMeth(_,_,vref,_) -> "FSMeth: " + vref.LogicalName
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> "ProvidedMeth: " + mi.PUntaint((fun mi -> mi.Name),m)
#endif
| DefaultStructCtor _ -> ".ctor"
@@ -938,7 +938,7 @@ type MethInfo =
match x with
| ILMeth(_,y,_) -> y.ILName
| FSMeth(_,_,vref,_) -> vref.LogicalName
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> mi.PUntaint((fun mi -> mi.Name),m)
#endif
| DefaultStructCtor _ -> ".ctor"
@@ -953,7 +953,7 @@ type MethInfo =
member x.HasDirectXmlComment =
match x with
| FSMeth(g,_,vref,_) -> valRefInThisAssembly g.compilingFslib vref
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _ -> true
#endif
| _ -> false
@@ -972,7 +972,7 @@ type MethInfo =
| ILMeth(g,_,_) -> g
| FSMeth(g,_,_,_) -> g
| DefaultStructCtor (g,_) -> g
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap,_,_,_) -> amap.g
#endif
@@ -986,7 +986,7 @@ type MethInfo =
let _,memberMethodTypars,_,_ = AnalyzeTypeOfMemberVal x.IsCSharpStyleExtensionMember g (typ,vref)
memberMethodTypars
| DefaultStructCtor _ -> []
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _ -> [] // There will already have been an error if there are generic parameters here.
#endif
@@ -1001,7 +1001,7 @@ type MethInfo =
| ILMeth(_,_,_) -> XmlDoc.Empty
| FSMeth(_,_,vref,_) -> vref.XmlDoc
| DefaultStructCtor _ -> XmlDoc.Empty
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m)->
XmlDoc (mi.PUntaint((fun mix -> (mix :> IProvidedCustomAttributeProvider).GetXmlDocAttributes(mi.TypeProvider.PUntaintNoFailure(id))),m))
#endif
@@ -1020,7 +1020,7 @@ type MethInfo =
| ILMeth(_,ilminfo,_) -> [ilminfo.NumParams]
| FSMeth(g,_,vref,_) -> GetArgInfosOfMember x.IsCSharpStyleExtensionMember g vref |> List.map List.length
| DefaultStructCtor _ -> [0]
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> [mi.PUntaint((fun mi -> mi.GetParameters().Length),m)] // Why is this a list? Answer: because the method might be curried
#endif
@@ -1032,7 +1032,7 @@ type MethInfo =
| ILMeth(_,ilmeth,_) -> ilmeth.IsInstance
| FSMeth(_,_,vref,_) -> vref.IsInstanceMember || x.IsCSharpStyleExtensionMember
| DefaultStructCtor _ -> false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> mi.PUntaint((fun mi -> not mi.IsConstructor && not mi.IsStatic),m)
#endif
@@ -1046,7 +1046,7 @@ type MethInfo =
| ILMeth(_,ilmeth,_) -> ilmeth.IsProtectedAccessibility
| FSMeth _ -> false
| DefaultStructCtor _ -> false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> mi.PUntaint((fun mi -> mi.IsFamily), m)
#endif
@@ -1055,7 +1055,7 @@ type MethInfo =
| ILMeth(_,ilmeth,_) -> ilmeth.IsVirtual
| FSMeth(_,_,vref,_) -> vref.IsVirtualMember
| DefaultStructCtor _ -> false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> mi.PUntaint((fun mi -> mi.IsVirtual), m)
#endif
@@ -1064,7 +1064,7 @@ type MethInfo =
| ILMeth(_,ilmeth,_) -> ilmeth.IsConstructor
| FSMeth(_g,_,vref,_) -> (vref.MemberInfo.Value.MemberFlags.MemberKind = MemberKind.Constructor)
| DefaultStructCtor _ -> true
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> mi.PUntaint((fun mi -> mi.IsConstructor), m)
#endif
@@ -1076,7 +1076,7 @@ type MethInfo =
| VSome x -> x.IsClassConstructor
| _ -> false
| DefaultStructCtor _ -> false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> mi.PUntaint((fun mi -> mi.IsConstructor && mi.IsStatic), m) // Note: these are never public anyway
#endif
@@ -1087,7 +1087,7 @@ type MethInfo =
isInterfaceTy g x.EnclosingType ||
vref.MemberInfo.Value.MemberFlags.IsDispatchSlot
| DefaultStructCtor _ -> false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _ -> x.IsVirtual // Note: follow same implementation as ILMeth
#endif
@@ -1098,7 +1098,7 @@ type MethInfo =
| ILMeth(_,ilmeth,_) -> ilmeth.IsFinal
| FSMeth(_g,_,_vref,_) -> false
| DefaultStructCtor _ -> true
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> mi.PUntaint((fun mi -> mi.IsFinal), m)
#endif
@@ -1113,7 +1113,7 @@ type MethInfo =
| ILMeth(_,ilmeth,_) -> ilmeth.IsAbstract
| FSMeth(g,_,vref,_) -> isInterfaceTy g minfo.EnclosingType || vref.IsDispatchSlotMember
| DefaultStructCtor _ -> false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> mi.PUntaint((fun mi -> mi.IsAbstract), m)
#endif
@@ -1123,7 +1123,7 @@ type MethInfo =
(match x with
| ILMeth(_,x,_) -> x.IsNewSlot
| FSMeth(_,_,vref,_) -> vref.IsDispatchSlotMember
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,m) -> mi.PUntaint((fun mi -> mi.IsHideBySig), m) // REVIEW: Check this is correct
#endif
| DefaultStructCtor _ -> false))
@@ -1134,7 +1134,7 @@ type MethInfo =
| ILMeth _ -> false
| FSMeth(g,_,vref,_) -> vref.IsFSharpExplicitInterfaceImplementation g
| DefaultStructCtor _ -> false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _ -> false
#endif
@@ -1144,7 +1144,7 @@ type MethInfo =
| ILMeth _ -> false
| FSMeth(_,_,vref,_) -> vref.IsDefiniteFSharpOverrideMember
| DefaultStructCtor _ -> false
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _ -> false
#endif
@@ -1183,7 +1183,7 @@ type MethInfo =
member x.IsFSharpEventPropertyMethod =
match x with
| FSMeth(g,_,vref,_) -> vref.IsFSharpEventProperty(g)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _ -> false
#endif
| _ -> false
@@ -1216,7 +1216,7 @@ type MethInfo =
| ILMeth(_,x1,_), ILMeth(_,x2,_) -> (x1.RawMetadata === x2.RawMetadata)
| FSMeth(g,_,vref1,_), FSMeth(_,_,vref2,_) -> valRefEq g vref1 vref2
| DefaultStructCtor(g,ty1), DefaultStructCtor(_,ty2) -> tyconRefEq g (tcrefOfAppTy g ty1) (tcrefOfAppTy g ty2)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi1,_,_),ProvidedMeth(_,mi2,_,_) -> ProvidedMethodBase.TaintedEquals (mi1, mi2)
#endif
| _ -> false
@@ -1229,7 +1229,7 @@ type MethInfo =
| FSMeth(_,_,vref,_) -> hash vref.LogicalName
| DefaultStructCtor(_,_ty) -> 34892 // "ty" doesn't support hashing. We could use "hash (tcrefOfAppTy g ty).CompiledName" or
// something but we don't have a "g" parameter here yet. But this hash need only be very approximate anyway
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_,mi,_,_) -> ProvidedMethodInfo.TaintedGetHashCode(mi)
#endif
@@ -1242,7 +1242,7 @@ type MethInfo =
| ILMethInfo(_,typ,Some declaringTyconRef,md,_) -> MethInfo.CreateILExtensionMeth(amap, m, instType inst typ, declaringTyconRef, pri, md)
| FSMeth(g,typ,vref,pri) -> FSMeth(g,instType inst typ,vref,pri)
| DefaultStructCtor(g,typ) -> DefaultStructCtor(g,instType inst typ)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _ ->
match inst with
| [] -> x
@@ -1259,7 +1259,7 @@ type MethInfo =
let _,_,retTy,_ = AnalyzeTypeOfMemberVal x.IsCSharpStyleExtensionMember g (typ,vref)
retTy |> Option.map (instType inst)
| DefaultStructCtor _ -> None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap,mi,_,m) ->
GetCompiledReturnTyOfProvidedMethodInfo amap m mi
#endif
@@ -1279,7 +1279,7 @@ type MethInfo =
let inst = GetInstantiationForMemberVal g x.IsCSharpStyleExtensionMember (typ,vref,minst)
paramTypes |> List.mapSquared (fun (ParamNameAndType(_,ty)) -> instType inst ty)
| DefaultStructCtor _ -> []
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap,mi,_,m) ->
// A single group of tupled arguments
[ [ for p in mi.PApplyArray((fun mi -> mi.GetParameters()), "GetParameters",m) do
@@ -1302,7 +1302,7 @@ type MethInfo =
[ typ ]
else []
| DefaultStructCtor _ -> []
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap,mi,_,m) ->
if x.IsInstance then [ Import.ImportProvidedType amap m (mi.PApply((fun mi -> mi.DeclaringType),m)) ] // find the type of the 'this' argument
else []
@@ -1405,7 +1405,7 @@ type MethInfo =
| DefaultStructCtor _ ->
[[]]
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap,mi,_,_) ->
// A single group of tupled arguments
[ [for p in mi.PApplyArray((fun mi -> mi.GetParameters()), "GetParameters", m) do
@@ -1468,7 +1468,7 @@ type MethInfo =
let paramType = ImportILTypeFromMetadata amap m ftinfo.ILScopeRef ftinfo.TypeInst formalMethTyparTys p.Type
yield TSlotParam(p.Name, paramType, p.IsIn, p.IsOut, p.IsOptional, []) ] ]
formalRetTy, formalParams
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth (_,mi,_,_) ->
// GENERIC TYPE PROVIDERS: for generics, formal types should be generated here, not the actual types
// For non-generic type providers there is no difference
@@ -1498,7 +1498,7 @@ type MethInfo =
items |> ParamNameAndType.InstantiateCurried inst
| DefaultStructCtor _ ->
[[]]
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(amap,mi,_,_) ->
// A single set of tupled parameters
[ [for p in mi.PApplyArray((fun mi -> mi.GetParameters()), "GetParameters", m) do
@@ -1538,7 +1538,7 @@ type MethInfo =
memberParentTypars
| DefaultStructCtor(g,typ) ->
(tcrefOfAppTy g typ).Typars(m)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth (amap,_,_,_) ->
(tcrefOfAppTy amap.g x.EnclosingType).Typars(m)
#endif
@@ -1552,7 +1552,7 @@ type MethInfo =
type ILFieldInfo =
/// Represents a single use of a field backed by Abstract IL metadata
| ILFieldInfo of ILTypeInfo * ILFieldDef // .NET IL fields
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Represents a single use of a field backed by provided metadata
| ProvidedField of Import.ImportMap * Tainted * range
#endif
@@ -1561,7 +1561,7 @@ type ILFieldInfo =
member x.EnclosingType =
match x with
| ILFieldInfo(tinfo,_) -> tinfo.ToType
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(amap,fi,m) -> (Import.ImportProvidedType amap m (fi.PApply((fun fi -> fi.DeclaringType),m)))
#endif
@@ -1569,7 +1569,7 @@ type ILFieldInfo =
member x.ILTypeRef =
match x with
| ILFieldInfo(tinfo,_) -> tinfo.ILTypeRef
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(amap,fi,m) -> (Import.ImportProvidedTypeAsILType amap m (fi.PApply((fun fi -> fi.DeclaringType),m))).TypeRef
#endif
@@ -1580,7 +1580,7 @@ type ILFieldInfo =
member x.TypeInst =
match x with
| ILFieldInfo(tinfo,_) -> tinfo.TypeInst
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField _ -> [] /// GENERIC TYPE PROVIDERS
#endif
@@ -1588,7 +1588,7 @@ type ILFieldInfo =
member x.FieldName =
match x with
| ILFieldInfo(_,pd) -> pd.Name
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(_,fi,m) -> fi.PUntaint((fun fi -> fi.Name),m)
#endif
@@ -1596,7 +1596,7 @@ type ILFieldInfo =
member x.IsInitOnly =
match x with
| ILFieldInfo(_,pd) -> pd.IsInitOnly
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(_,fi,m) -> fi.PUntaint((fun fi -> fi.IsInitOnly),m)
#endif
@@ -1604,7 +1604,7 @@ type ILFieldInfo =
member x.IsValueType =
match x with
| ILFieldInfo(tinfo,_) -> tinfo.IsValueType
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(amap,_,_) -> isStructTy amap.g x.EnclosingType
#endif
@@ -1612,7 +1612,7 @@ type ILFieldInfo =
member x.IsStatic =
match x with
| ILFieldInfo(_,pd) -> pd.IsStatic
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(_,fi,m) -> fi.PUntaint((fun fi -> fi.IsStatic),m)
#endif
@@ -1620,7 +1620,7 @@ type ILFieldInfo =
member x.IsSpecialName =
match x with
| ILFieldInfo(_,pd) -> pd.IsSpecialName
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(_,fi,m) -> fi.PUntaint((fun fi -> fi.IsSpecialName),m)
#endif
@@ -1628,7 +1628,7 @@ type ILFieldInfo =
member x.LiteralValue =
match x with
| ILFieldInfo(_,pd) -> if pd.IsLiteral then pd.LiteralValue else None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(_,fi,m) ->
if fi.PUntaint((fun fi -> fi.IsLiteral),m) then
Some (ILFieldInit.FromProvidedObj m (fi.PUntaint((fun fi -> fi.GetRawConstantValue()),m)))
@@ -1640,7 +1640,7 @@ type ILFieldInfo =
member x.ILFieldType =
match x with
| ILFieldInfo (_,fdef) -> fdef.Type
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(amap,fi,m) -> Import.ImportProvidedTypeAsILType amap m (fi.PApply((fun fi -> fi.FieldType),m))
#endif
@@ -1648,14 +1648,14 @@ type ILFieldInfo =
member x.FieldType(amap,m) =
match x with
| ILFieldInfo (tinfo,fdef) -> ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInst [] fdef.Type
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(amap,fi,m) -> Import.ImportProvidedType amap m (fi.PApply((fun fi -> fi.FieldType),m))
#endif
static member ILFieldInfosUseIdenticalDefinitions x1 x2 =
match x1,x2 with
| ILFieldInfo(_, x1), ILFieldInfo(_, x2) -> (x1 === x2)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField(_,fi1,_), ProvidedField(_,fi2,_)-> ProvidedFieldInfo.TaintedEquals (fi1, fi2)
| _ -> false
#endif
@@ -1807,7 +1807,7 @@ type PropInfo =
| FSProp of TcGlobals * TType * ValRef option * ValRef option
/// An F# use of a property backed by Abstract IL metadata
| ILProp of TcGlobals * ILPropInfo
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// An F# use of a property backed by provided metadata
| ProvidedProp of Import.ImportMap * Tainted * range
#endif
@@ -1825,7 +1825,7 @@ type PropInfo =
match x with
| FSProp(g,_,Some vref,_)
| FSProp(g,_,_,Some vref) -> valRefInThisAssembly g.compilingFslib vref
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp _ -> true
#endif
| _ -> false
@@ -1836,7 +1836,7 @@ type PropInfo =
| ILProp(_,x) -> x.PropertyName
| FSProp(_,_,Some vref,_)
| FSProp(_,_,_, Some vref) -> vref.PropertyName
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) -> pi.PUntaint((fun pi -> pi.Name),m)
#endif
| FSProp _ -> failwith "unreachable"
@@ -1846,7 +1846,7 @@ type PropInfo =
match x with
| ILProp(_,x) -> x.HasGetter
| FSProp(_,_,x,_) -> Option.isSome x
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) -> pi.PUntaint((fun pi -> pi.CanRead),m)
#endif
@@ -1855,7 +1855,7 @@ type PropInfo =
match x with
| ILProp(_,x) -> x.HasSetter
| FSProp(_,_,_,x) -> Option.isSome x
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) -> pi.PUntaint((fun pi -> pi.CanWrite),m)
#endif
@@ -1866,7 +1866,7 @@ type PropInfo =
match x with
| ILProp(_,x) -> x.ILTypeInfo.ToType
| FSProp(_,typ,_,_) -> typ
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(amap,pi,m) ->
Import.ImportProvidedType amap m (pi.PApply((fun pi -> pi.DeclaringType),m))
#endif
@@ -1883,7 +1883,7 @@ type PropInfo =
| FSProp(_,_,Some vref,_)
| FSProp(_,_,_, Some vref) -> vref.IsVirtualMember
| FSProp _-> failwith "unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) ->
let mi = ArbitraryMethodInfoOfPropertyInfo pi m
mi.PUntaint((fun mi -> mi.IsVirtual), m)
@@ -1896,7 +1896,7 @@ type PropInfo =
| FSProp(_,_,Some vref,_)
| FSProp(_,_,_, Some vref) -> vref.IsDispatchSlotMember
| FSProp(_,_,None,None) -> failwith "unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) ->
let mi = ArbitraryMethodInfoOfPropertyInfo pi m
mi.PUntaint((fun mi -> mi.IsHideBySig), m)
@@ -1912,7 +1912,7 @@ type PropInfo =
| FSProp(g,typ,_, Some vref) ->
isInterfaceTy g typ || (vref.MemberInfo.Value.MemberFlags.IsDispatchSlot)
| FSProp _ -> failwith "unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) ->
let mi = ArbitraryMethodInfoOfPropertyInfo pi m
mi.PUntaint((fun mi -> mi.IsVirtual), m)
@@ -1925,7 +1925,7 @@ type PropInfo =
| FSProp(_,_,Some vref,_)
| FSProp(_,_,_, Some vref) -> not vref.IsInstanceMember
| FSProp(_,_,None,None) -> failwith "unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) ->
(ArbitraryMethodInfoOfPropertyInfo pi m).PUntaint((fun mi -> mi.IsStatic), m)
#endif
@@ -1961,7 +1961,7 @@ type PropInfo =
arginfos.Length = 1 && arginfos.Head.Length >= 2
| FSProp(_,_,None,None) ->
failwith "unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) ->
pi.PUntaint((fun pi -> pi.GetIndexParameters().Length), m)>0
#endif
@@ -1970,7 +1970,7 @@ type PropInfo =
member x.IsFSharpEventProperty =
match x with
| FSProp(g,_,Some vref,None) -> vref.IsFSharpEventProperty(g)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp _ -> false
#endif
| _ -> false
@@ -1998,7 +1998,7 @@ type PropInfo =
| FSProp(_,_,Some vref,_)
| FSProp(_,_,_, Some vref) -> vref.XmlDoc
| FSProp(_,_,None,None) -> failwith "unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) ->
XmlDoc (pi.PUntaint((fun pix -> (pix :> IProvidedCustomAttributeProvider).GetXmlDocAttributes(pi.TypeProvider.PUntaintNoFailure(id))), m))
#endif
@@ -2008,7 +2008,7 @@ type PropInfo =
match x with
| ILProp(g,_) -> g
| FSProp(g,_,_,_) -> g
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(amap,_,_) -> amap.g
#endif
@@ -2028,7 +2028,7 @@ type PropInfo =
ReturnTypeOfPropertyVal g vref.Deref |> instType inst
| FSProp _ -> failwith "unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,m) ->
Import.ImportProvidedType amap m (pi.PApply((fun pi -> pi.PropertyType),m))
#endif
@@ -2045,7 +2045,7 @@ type PropInfo =
let inst = GetInstantiationForPropertyVal g (typ,vref)
ArgInfosOfPropertyVal g vref.Deref |> List.map (ParamNameAndType.FromArgInfo >> ParamNameAndType.Instantiate inst)
| FSProp _ -> failwith "unreachable"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp (_,pi,m) ->
[ for p in pi.PApplyArray((fun pi -> pi.GetIndexParameters()), "GetIndexParameters", m) do
let paramName = p.PUntaint((fun p -> match p.Name with null -> None | s -> Some (mkSynId m s)), m)
@@ -2067,7 +2067,7 @@ type PropInfo =
match x with
| ILProp(g,x) -> ILMeth(g,x.GetterMethod(g),None)
| FSProp(g,typ,Some vref,_) -> FSMeth(g,typ,vref,None)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(amap,pi,m) ->
let meth = GetAndSanityCheckProviderMethod m pi (fun pi -> pi.GetGetMethod()) FSComp.SR.etPropertyCanReadButHasNoGetter
ProvidedMeth(amap, meth, None, m)
@@ -2080,7 +2080,7 @@ type PropInfo =
match x with
| ILProp(g,x) -> ILMeth(g,x.SetterMethod(g),None)
| FSProp(g,typ,_,Some vref) -> FSMeth(g,typ,vref,None)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(amap,pi,m) ->
let meth = GetAndSanityCheckProviderMethod m pi (fun pi -> pi.GetSetMethod()) FSComp.SR.etPropertyCanWriteButHasNoSetter
ProvidedMeth(amap, meth, None, m)
@@ -2099,7 +2099,7 @@ type PropInfo =
| ILProp(_, x1), ILProp(_, x2) -> (x1.RawMetadata === x2.RawMetadata)
| FSProp(g, _, vrefa1, vrefb1), FSProp(_, _, vrefa2, vrefb2) ->
(optVrefEq g (vrefa1, vrefa2)) && (optVrefEq g (vrefb1, vrefb2))
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi1,_), ProvidedProp(_,pi2,_) -> ProvidedPropertyInfo.TaintedEquals (pi1, pi2)
#endif
| _ -> false
@@ -2112,7 +2112,7 @@ type PropInfo =
// Hash on option*option
let vth = (vrefOpt1 |> Option.map (fun vr -> vr.LogicalName), (vrefOpt2 |> Option.map (fun vr -> vr.LogicalName)))
hash vth
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_,pi,_) -> ProvidedPropertyInfo.TaintedGetHashCode(pi)
#endif
@@ -2191,7 +2191,7 @@ type EventInfo =
| FSEvent of TcGlobals * PropInfo * ValRef * ValRef
/// An F# use of an event backed by .NET metadata
| ILEvent of TcGlobals * ILEventInfo
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// An F# use of an event backed by provided metadata
| ProvidedEvent of Import.ImportMap * Tainted * range
#endif
@@ -2203,7 +2203,7 @@ type EventInfo =
match x with
| ILEvent(_,e) -> e.ILTypeInfo.ToType
| FSEvent (_,p,_,_) -> p.EnclosingType
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (amap,ei,m) -> Import.ImportProvidedType amap m (ei.PApply((fun ei -> ei.DeclaringType),m))
#endif
@@ -2211,7 +2211,7 @@ type EventInfo =
member x.HasDirectXmlComment =
match x with
| FSEvent (_,p,_,_) -> p.HasDirectXmlComment
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent _ -> true
#endif
| _ -> false
@@ -2221,7 +2221,7 @@ type EventInfo =
match x with
| ILEvent _ -> XmlDoc.Empty
| FSEvent (_,p,_,_) -> p.XmlDoc
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (_,ei,m) ->
XmlDoc (ei.PUntaint((fun eix -> (eix :> IProvidedCustomAttributeProvider).GetXmlDocAttributes(ei.TypeProvider.PUntaintNoFailure(id))), m))
#endif
@@ -2231,7 +2231,7 @@ type EventInfo =
match x with
| ILEvent(_,e) -> e.Name
| FSEvent (_,p,_,_) -> p.PropertyName
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (_,ei,m) -> ei.PUntaint((fun ei -> ei.Name), m)
#endif
@@ -2240,7 +2240,7 @@ type EventInfo =
match x with
| ILEvent(g,e) -> e.IsStatic(g)
| FSEvent (_,p,_,_) -> p.IsStatic
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (_,ei,m) ->
let meth = GetAndSanityCheckProviderMethod m ei (fun ei -> ei.GetAddMethod()) FSComp.SR.etEventNoAdd
meth.PUntaint((fun mi -> mi.IsStatic), m)
@@ -2251,7 +2251,7 @@ type EventInfo =
match x with
| ILEvent(g,_) -> g
| FSEvent(g,_,_,_) -> g
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (amap,_,_) -> amap.g
#endif
@@ -2265,7 +2265,7 @@ type EventInfo =
match x with
| ILEvent(g,e) -> ILMeth(g,e.AddMethod(g),None)
| FSEvent(g,p,addValRef,_) -> FSMeth(g,p.EnclosingType,addValRef,None)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (amap,ei,m) ->
let meth = GetAndSanityCheckProviderMethod m ei (fun ei -> ei.GetAddMethod()) FSComp.SR.etEventNoAdd
ProvidedMeth(amap, meth, None, m)
@@ -2276,7 +2276,7 @@ type EventInfo =
match x with
| ILEvent(g,e) -> ILMeth(g,e.RemoveMethod(g),None)
| FSEvent(g,p,_,removeValRef) -> FSMeth(g,p.EnclosingType,removeValRef,None)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (amap,ei,m) ->
let meth = GetAndSanityCheckProviderMethod m ei (fun ei -> ei.GetRemoveMethod()) FSComp.SR.etEventNoRemove
ProvidedMeth(amap, meth, None, m)
@@ -2299,7 +2299,7 @@ type EventInfo =
| FSEvent(g,p,_,_) ->
FindDelegateTypeOfPropertyEvent g amap x.EventName m (p.GetPropertyType(amap,m))
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (_,ei,_) ->
Import.ImportProvidedType amap m (ei.PApply((fun ei -> ei.EventHandlerType), m))
#endif
@@ -2311,7 +2311,7 @@ type EventInfo =
| FSEvent(g, pi1, vrefa1, vrefb1), FSEvent(_, pi2, vrefa2, vrefb2) ->
PropInfo.PropInfosUseIdenticalDefinitions pi1 pi2 && valRefEq g vrefa1 vrefa2 && valRefEq g vrefb1 vrefb2
| ILEvent(_, x1), ILEvent(_, x2) -> (x1.RawMetadata === x2.RawMetadata)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (_,ei1,_), ProvidedEvent (_,ei2,_) -> ProvidedEventInfo.TaintedEquals (ei1, ei2)
#endif
| _ -> false
@@ -2321,7 +2321,7 @@ type EventInfo =
match ei with
| ILEvent(_, x1) -> hash x1.RawMetadata.Name
| FSEvent(_, pi, vref1, vref2) -> hash ( pi.ComputeHashCode(), vref1.LogicalName, vref2.LogicalName)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (_,ei,_) -> ProvidedEventInfo.TaintedGetHashCode(ei)
#endif
diff --git a/src/fsharp/symbols/SymbolHelpers.fs b/src/fsharp/symbols/SymbolHelpers.fs
index ffb3f013be8..7b01319772e 100644
--- a/src/fsharp/symbols/SymbolHelpers.fs
+++ b/src/fsharp/symbols/SymbolHelpers.fs
@@ -341,14 +341,14 @@ module internal SymbolHelpers =
let rangeOfPropInfo preferFlag (pinfo:PropInfo) =
match pinfo with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp(_, pi, _) -> ComputeDefinitionLocationOfProvidedItem pi
#endif
| _ -> pinfo.ArbitraryValRef |> Option.map (rangeOfValRef preferFlag)
let rangeOfMethInfo (g:TcGlobals) preferFlag (minfo:MethInfo) =
match minfo with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth(_, mi, _, _) -> ComputeDefinitionLocationOfProvidedItem mi
#endif
| DefaultStructCtor(_, AppTy g (tcref, _)) -> Some(rangeOfEntityRef preferFlag tcref)
@@ -356,7 +356,7 @@ module internal SymbolHelpers =
let rangeOfEventInfo preferFlag (einfo:EventInfo) =
match einfo with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent (_, ei, _) -> ComputeDefinitionLocationOfProvidedItem ei
#endif
| _ -> einfo.ArbitraryValRef |> Option.map (rangeOfValRef preferFlag)
@@ -402,7 +402,7 @@ module internal SymbolHelpers =
// Provided type definitions do not have a useful F# CCU for the purposes of goto-definition.
let computeCcuOfTyconRef (tcref:TyconRef) =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
if tcref.IsProvided then None else
#endif
ccuOfTyconRef tcref
@@ -561,7 +561,7 @@ module internal SymbolHelpers =
Some (ccuFileName, "M:"+actualTypeName+"."+normalizedName+genArity+XmlDocArgsEnc g (formalTypars, fmtps) args)
| DefaultStructCtor _ -> None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _ -> None
#endif
@@ -577,7 +577,7 @@ module internal SymbolHelpers =
let GetXmlDocSigOfProp infoReader m pinfo =
match pinfo with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp _ -> None // No signature is possible. If an xml comment existed it would have been returned by PropInfo.XmlDoc in infos.fs
#endif
| FSProp (g, typ, _, _) as fspinfo ->
@@ -1230,7 +1230,7 @@ module internal SymbolHelpers =
| _ ->
FSharpStructuredToolTipElement.None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Determine if an item is a provided type
let (|ItemIsProvidedType|_|) g item =
@@ -1306,7 +1306,7 @@ module internal SymbolHelpers =
sprintf "%s.%s%s" typeString minfo.RawMetadata.Name paramString |> Some
| DefaultStructCtor _ -> None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _ -> None
#endif
@@ -1337,7 +1337,7 @@ module internal SymbolHelpers =
match finfo with
| ILFieldInfo(tinfo, fdef) ->
(tinfo.TyconRef |> ticksAndArgCountTextOfTyconRef)+"."+fdef.Name |> Some
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedField _ -> None
#endif
| Item.Types(_, ((AppTy g (tcref, _)) :: _))
@@ -1363,7 +1363,7 @@ module internal SymbolHelpers =
// namespaces from type providers need to be handled separately because they don't have compiled representation
// otherwise we'll fail at tast.fs
match modref.Deref.TypeReprInfo with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedNamespaceExtensionPoint _ ->
modref.CompilationPathOpt
|> Option.bind (fun path ->
@@ -1391,7 +1391,7 @@ module internal SymbolHelpers =
let tcref = tinfo.TyconRef
(tcref |> ticksAndArgCountTextOfTyconRef)+"."+pdef.Name |> Some
| FSProp _ -> None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedProp _ -> None
#endif
| Item.Property(_, []) -> None // Pathological case of the above
@@ -1410,7 +1410,7 @@ module internal SymbolHelpers =
| Parent tcref -> (tcref |> ticksAndArgCountTextOfTyconRef)+"."+vref.PropertyName|> Some
| ParentNone -> None
| None -> None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedEvent _ -> None
#endif
| Item.CtorGroup(_, minfos) ->
@@ -1426,7 +1426,7 @@ module internal SymbolHelpers =
| (DefaultStructCtor (g, typ) :: _) ->
let tcref = tcrefOfAppTy g typ
(ticksAndArgCountTextOfTyconRef tcref) + ".#ctor" |> Some
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedMeth _::_ -> None
#endif
| Item.CustomOperation (_, _, Some minfo) -> getKeywordForMethInfo minfo
@@ -1466,7 +1466,7 @@ module internal SymbolHelpers =
| Item.Property(_, pinfos) ->
let pinfo = List.head pinfos
if pinfo.IsIndexer then [item] else []
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ItemIsWithStaticArguments m g _ -> [item] // we pretend that provided-types-with-static-args are method-like in order to get ParamInfo for them
#endif
| Item.CustomOperation(_name, _helpText, _minfo) -> [item]
diff --git a/src/fsharp/symbols/SymbolHelpers.fsi b/src/fsharp/symbols/SymbolHelpers.fsi
index 216fecacb8e..1d1762a7f4f 100755
--- a/src/fsharp/symbols/SymbolHelpers.fsi
+++ b/src/fsharp/symbols/SymbolHelpers.fsi
@@ -212,7 +212,7 @@ module internal SymbolHelpers =
val IsAttribute : InfoReader -> Item -> bool
val IsExplicitlySuppressed : TcGlobals -> Item -> bool
val FlattenItems : TcGlobals -> range -> Item -> Item list
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
val (|ItemIsProvidedType|_|) : TcGlobals -> Item -> TyconRef option
val (|ItemIsWithStaticArguments|_|): range -> TcGlobals -> Item -> Tainted[] option
val (|ItemIsProvidedTypeWithStaticArguments|_|): range -> TcGlobals -> Item -> Tainted[] option
diff --git a/src/fsharp/symbols/SymbolPatterns.fs b/src/fsharp/symbols/SymbolPatterns.fs
index aa4be5a32f8..8ae4b90bf9d 100644
--- a/src/fsharp/symbols/SymbolPatterns.fs
+++ b/src/fsharp/symbols/SymbolPatterns.fs
@@ -89,7 +89,7 @@ module Symbol =
if e.IsEnum || e.IsValueType || hasAttribute e.Attributes then Some()
else None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let (|Class|_|) (original: FSharpEntity, abbreviated: FSharpEntity, _) =
if abbreviated.IsClass
&& (not abbreviated.IsStaticInstantiation || original.IsFSharpAbbreviation) then Some()
@@ -114,7 +114,7 @@ module Symbol =
|| (e.IsFSharp && e.IsOpaque && not e.IsFSharpModule && not e.IsNamespace) then Some()
else None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let (|ProvidedType|_|) (e: FSharpEntity) =
if (e.IsProvided || e.IsProvidedAndErased || e.IsProvidedAndGenerated) && e.CompiledName = e.DisplayName then
Some()
@@ -126,7 +126,7 @@ module Symbol =
let (|FSharpModule|_|) (entity: FSharpEntity) = if entity.IsFSharpModule then Some() else None
let (|Namespace|_|) (entity: FSharpEntity) = if entity.IsNamespace then Some() else None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let (|ProvidedAndErasedType|_|) (entity: FSharpEntity) = if entity.IsProvidedAndErased then Some() else None
#endif
let (|Enum|_|) (entity: FSharpEntity) = if entity.IsEnum then Some() else None
diff --git a/src/fsharp/symbols/SymbolPatterns.fsi b/src/fsharp/symbols/SymbolPatterns.fsi
index e2c00c80ee7..4499e3098c8 100644
--- a/src/fsharp/symbols/SymbolPatterns.fsi
+++ b/src/fsharp/symbols/SymbolPatterns.fsi
@@ -31,14 +31,14 @@ module internal Symbol =
val (|Interface|_|) : FSharpEntity -> unit option
val (|AbstractClass|_|) : FSharpEntity -> unit option
val (|FSharpType|_|) : FSharpEntity -> unit option
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
val (|ProvidedType|_|) : FSharpEntity -> unit option
#endif
val (|ByRef|_|) : FSharpEntity -> unit option
val (|Array|_|) : FSharpEntity -> unit option
val (|FSharpModule|_|) : FSharpEntity -> unit option
val (|Namespace|_|) : FSharpEntity -> unit option
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
val (|ProvidedAndErasedType|_|) : FSharpEntity -> unit option
#endif
val (|Enum|_|) : FSharpEntity -> unit option
diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs
index dd6c04451b4..20ec8c13b32 100644
--- a/src/fsharp/symbols/Symbols.fs
+++ b/src/fsharp/symbols/Symbols.fs
@@ -128,7 +128,7 @@ module Impl =
/// Convert an IL type definition accessibility into an F# accessibility
let getApproxFSharpAccessibilityOfEntity (entity: EntityRef) =
match metadataOfTycon entity.Deref with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata _info ->
// This is an approximation - for generative type providers some type definitions can be private.
taccessPublic
@@ -288,7 +288,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) =
member x.QualifiedName =
checkIsResolved()
let fail() = invalidOp (sprintf "the type '%s' does not have a qualified name" x.LogicalName)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
if entity.IsTypeAbbrev || entity.IsProvidedErasedTycon || entity.IsNamespace then fail()
#else
if entity.IsTypeAbbrev || entity.IsNamespace then fail()
@@ -305,7 +305,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) =
member x.TryFullName =
if isUnresolved() then None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
elif entity.IsTypeAbbrev || entity.IsProvidedErasedTycon then None
#else
elif entity.IsTypeAbbrev then None
@@ -346,7 +346,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) =
member __.ArrayRank =
checkIsResolved()
rankOfArrayTyconRef cenv.g entity
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member __.IsProvided =
isResolved() &&
entity.IsProvided
@@ -366,7 +366,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) =
member __.IsClass =
isResolved() &&
match metadataOfTycon entity.Deref with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info -> info.IsClass
#endif
| ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Class)
@@ -387,7 +387,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) =
member __.IsDelegate =
isResolved() &&
match metadataOfTycon entity.Deref with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| ProvidedTypeMetadata info -> info.IsDelegate ()
#endif
| ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Delegate)
@@ -530,7 +530,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) =
member x.StaticParameters =
match entity.TypeReprInfo with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedTypeExtensionPoint info ->
let m = x.DeclarationLocation
let typeBeforeArguments = info.ProvidedType
@@ -2055,7 +2055,7 @@ and FSharpAttribute(cenv: cenv, attrib: AttribInfo) =
override __.ToString() =
if entityIsUnresolved attrib.TyconRef then "attribute ???" else "attribute " + attrib.TyconRef.CompiledName + "(...)"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
and FSharpStaticParameter(cenv, sp: Tainted< ExtensionTyping.ProvidedParameterInfo >, m) =
inherit FSharpSymbol(cenv,
(fun () ->
@@ -2178,7 +2178,7 @@ and FSharpAssembly internal (cenv, ccu: CcuThunk) =
member __.CodeLocation = ccu.SourceCodeDirectory
member __.FileName = ccu.FileName
member __.SimpleName = ccu.AssemblyName
- #if EXTENSIONTYPING
+ #if !NO_EXTENSIONTYPING
member __.IsProviderGenerated = ccu.IsProviderGenerated
#endif
member __.Contents = FSharpAssemblySignature(cenv, ccu)
diff --git a/src/fsharp/symbols/Symbols.fsi b/src/fsharp/symbols/Symbols.fsi
index e01c3d99422..2cfd8a2f47e 100644
--- a/src/fsharp/symbols/Symbols.fsi
+++ b/src/fsharp/symbols/Symbols.fsi
@@ -124,7 +124,7 @@ and [] internal FSharpAssembly =
/// The simple name for the assembly
member SimpleName : string
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Indicates if the assembly was generated by a type provider and is due for static linking
member IsProviderGenerated : bool
#endif
@@ -208,7 +208,7 @@ and [] internal FSharpEntity =
/// Get the rank of an array type
member ArrayRank : int
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Indicates if the entity is a 'fake' symbol related to a static instantiation of a type provider
member IsStaticInstantiation : bool
@@ -226,7 +226,7 @@ and [] internal FSharpEntity =
/// Get the generic parameters, possibly including unit-of-measure parameters
member GenericParameters: IList
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Get the static parameters for a provided type
member StaticParameters: IList
#endif
@@ -543,7 +543,7 @@ and [] internal FSharpGenericParameter =
member Constraints: IList
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// A subtype of FSharpSymbol that represents a static parameter to an F# type provider
#if COMPILER_PUBLIC_API
and [] FSharpStaticParameter =
diff --git a/src/fsharp/tainted.fs b/src/fsharp/tainted.fs
index 74ee1836481..5d43f463900 100644
--- a/src/fsharp/tainted.fs
+++ b/src/fsharp/tainted.fs
@@ -2,7 +2,7 @@
namespace Microsoft.FSharp.Compiler
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open System
open Microsoft.FSharp.Compiler.Range
diff --git a/src/fsharp/tainted.fsi b/src/fsharp/tainted.fsi
index aaec679bb0d..228efbf606f 100644
--- a/src/fsharp/tainted.fsi
+++ b/src/fsharp/tainted.fsi
@@ -2,7 +2,7 @@
namespace Microsoft.FSharp.Compiler
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open System
diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs
index 26a4c1178d8..8e5ba69dcd7 100755
--- a/src/fsharp/tast.fs
+++ b/src/fsharp/tast.fs
@@ -26,7 +26,7 @@ open Microsoft.FSharp.Compiler.QuotationPickler
open Microsoft.FSharp.Core.Printf
open Microsoft.FSharp.Compiler.Rational
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
open Microsoft.FSharp.Compiler.ExtensionTyping
open Microsoft.FSharp.Core.CompilerServices
#endif
@@ -472,7 +472,7 @@ let getNameOfScopeRef sref =
| ILScopeRef.Assembly aref -> aref.Name
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
let ComputeDefinitionLocationOfProvidedItem (p : Tainted<#IProvidedCustomAttributeProvider>) =
let attrs = p.PUntaintNoFailure(fun x -> x.GetDefinitionLocationAttribute(p.TypeProvider.PUntaintNoFailure(id)))
match attrs with
@@ -590,7 +590,7 @@ type Entity =
/// The display name of the namespace, module or type, e.g. List instead of List`1, including static parameters if any
member x.DisplayNameWithStaticParameters = x.GetDisplayName(true, false)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member x.IsStaticInstantiationTycon =
x.IsProvidedErasedTycon &&
let _nm,args = PrettyNaming.demangleProvidedTypeName x.LogicalName
@@ -609,7 +609,7 @@ type Entity =
else
nm
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
if x.IsProvidedErasedTycon then
let nm,args = PrettyNaming.demangleProvidedTypeName nm
if withStaticParameters && args.Length > 0 then
@@ -626,7 +626,7 @@ type Entity =
/// The code location where the module, namespace or type is defined.
member x.Range =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match x.TypeReprInfo with
| TProvidedTypeExtensionPoint info ->
match ComputeDefinitionLocationOfProvidedItem info.ProvidedType with
@@ -663,7 +663,7 @@ type Entity =
/// or comes from another F# assembly then it does not (because the documentation will get read from
/// an XML file).
member x.XmlDoc =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match x.TypeReprInfo with
| TProvidedTypeExtensionPoint info -> XmlDoc (info.ProvidedType.PUntaintNoFailure(fun st -> (st :> IProvidedCustomAttributeProvider).GetXmlDocAttributes(info.ProvidedType.TypeProvider.PUntaintNoFailure(id))))
| _ ->
@@ -738,7 +738,7 @@ type Entity =
/// Indicates if the entity is an F# module definition
member x.IsModule = x.IsModuleOrNamespace && (match x.ModuleOrNamespaceType.ModuleOrNamespaceKind with Namespace -> false | _ -> true)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Indicates if the entity is a provided type or namespace definition
member x.IsProvided =
@@ -769,7 +769,7 @@ type Entity =
/// Indicates if the entity is erased, either a measure definition, or an erased provided type definition
member x.IsErased =
x.IsMeasureableReprTycon
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
|| x.IsProvidedErasedTycon
#endif
@@ -957,7 +957,7 @@ type Entity =
/// Indicates if this is an enum type definition
member x.IsEnumTycon =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match x.TypeReprInfo with
| TProvidedTypeExtensionPoint info -> info.IsEnum
| TProvidedNamespaceExtensionPoint _ -> false
@@ -986,7 +986,7 @@ type Entity =
/// Indicates if this is a struct or enum type definition , i.e. a value type definition
member x.IsStructOrEnumTycon =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match x.TypeReprInfo with
| TProvidedTypeExtensionPoint info -> info.IsStructOrEnum
| TProvidedNamespaceExtensionPoint _ -> false
@@ -1044,7 +1044,7 @@ type Entity =
/// Gets the data indicating the compiled representation of a type or module in terms of Abstract IL data structures.
member x.CompiledRepresentation =
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match x.TypeReprInfo with
// We should never be computing this property for erased types
| TProvidedTypeExtensionPoint info when info.IsErased ->
@@ -1220,7 +1220,7 @@ and
/// Indicates the type is parameterized on a measure (e.g. float<_>) but erases to some other type (e.g. float)
| TMeasureableRepr of TType
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// TProvidedTypeExtensionPoint
///
/// Indicates the representation information for a provided type.
@@ -1247,7 +1247,7 @@ and
/// TILObjectReprData(scope, nesting, definition)
TILObjectReprData = TILObjectReprData of ILScopeRef * ILTypeDef list * ILTypeDef
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
and
[]
@@ -1596,7 +1596,7 @@ and
modulesByDemangledNameCache := None
allEntitiesByMangledNameCache := None
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Mutation used in hosting scenarios to hold the hosted types in this module or namespace
member mtyp.AddProvidedTypeEntity(entity:Entity) =
entities <- QueueList.appendOne entities entity
@@ -1734,7 +1734,7 @@ and Construct =
static member NewEmptyModuleOrNamespaceType mkind =
Construct.NewModuleOrNamespaceType mkind [] []
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
static member NewProvidedTyconRepr(resolutionEnvironment,st:Tainted,importProvidedType,isSuppressRelocate,m) =
@@ -2666,13 +2666,13 @@ and NonLocalEntityRef =
let next = entity.ModuleOrNamespaceType.AllEntitiesByCompiledAndLogicalMangledNames.TryFind(path.[i])
match next with
| Some res -> NonLocalEntityRef.TryDerefEntityPath(ccu, path, (i+1), res)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| None -> NonLocalEntityRef.TryDerefEntityPathViaProvidedType(ccu, path, i, entity)
#else
| None -> VNone
#endif
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Try to find the entity corresponding to the given path, using type-providers to link the data
static member TryDerefEntityPathViaProvidedType(ccu: CcuThunk, path:string[], i:int, entity:Entity) =
// Errors during linking are not necessarily given good ranges. This has always been the case in F# 2.0, but also applies to
@@ -2998,7 +2998,7 @@ and
/// Get a blob of data indicating how this type is nested inside other namespaces, modules and types.
member x.CompilationPathOpt = x.Deref.CompilationPathOpt
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Indicates if the entity is a provided namespace fragment
member x.IsProvided = x.Deref.IsProvided
@@ -3596,7 +3596,7 @@ and
/// Indicates that this DLL was compiled using the F# compiler and has F# metadata
IsFSharp: bool
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Is the CCu an assembly injected by a type provider
IsProviderGenerated: bool
@@ -3687,7 +3687,7 @@ and CcuThunk =
/// Holds the filename for the DLL, if any
member ccu.FileName = ccu.Deref.FileName
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Is the CCu an EST injected assembly
member ccu.IsProviderGenerated = ccu.Deref.IsProviderGenerated
@@ -4672,7 +4672,7 @@ let tyconRefUsesLocalXmlDoc compilingFslib (x: TyconRef) =
match x with
| ERefLocal _ -> true
| ERefNonLocal _ ->
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match x.TypeReprInfo with
| TProvidedTypeExtensionPoint _ -> true
| _ ->
diff --git a/src/fsharp/vs/IncrementalBuild.fs b/src/fsharp/vs/IncrementalBuild.fs
index 01bfd8d0188..5b429b2e708 100755
--- a/src/fsharp/vs/IncrementalBuild.fs
+++ b/src/fsharp/vs/IncrementalBuild.fs
@@ -1292,7 +1292,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
disposeCleanupItem()
let! tcImports = TcImports.BuildNonFrameworkTcImports(ctok, tcConfigP, tcGlobals, frameworkTcImports, nonFrameworkResolutions, unresolvedReferences)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
tcImports.GetCcusExcludingBase() |> Seq.iter (fun ccu ->
// When a CCU reports an invalidation, merge them together and just report a
// general "imports invalidated". This triggers a rebuild.
@@ -1555,7 +1555,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
member __.ImportedCcusInvalidated = importsInvalidated.Publish
member __.AllDependenciesDeprecated = allDependencies
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
member __.ThereAreLiveTypeProviders =
let liveTPs =
match cleanupItem with
diff --git a/src/fsharp/vs/IncrementalBuild.fsi b/src/fsharp/vs/IncrementalBuild.fsi
index e29f3408c6b..e664cadc78b 100755
--- a/src/fsharp/vs/IncrementalBuild.fsi
+++ b/src/fsharp/vs/IncrementalBuild.fsi
@@ -100,7 +100,7 @@ type internal IncrementalBuilder =
/// The list of files the build depends on
member AllDependenciesDeprecated : string[]
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Whether there are any 'live' type providers that may need a refresh when a project is Cleaned
member ThereAreLiveTypeProviders : bool
#endif
diff --git a/src/fsharp/vs/ServiceAssemblyContent.fs b/src/fsharp/vs/ServiceAssemblyContent.fs
index 38a29545c5c..56fae895c6b 100644
--- a/src/fsharp/vs/ServiceAssemblyContent.fs
+++ b/src/fsharp/vs/ServiceAssemblyContent.fs
@@ -241,7 +241,7 @@ module AssemblyContentProvider =
let rec private traverseEntity contentType (parent: Parent) (entity: FSharpEntity) =
seq {
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
if not entity.IsProvided then
#endif
match contentType, entity.Accessibility.IsPublic with
@@ -317,7 +317,7 @@ module AssemblyContentProvider =
// on-demand. However a more compete review may be warranted.
use _ignoreAllDiagnostics = new ErrorScope()
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
match assemblies |> List.filter (fun x -> not x.IsProviderGenerated), fileName with
#else
match assemblies, fileName with
diff --git a/src/fsharp/vs/ServiceDeclarationLists.fs b/src/fsharp/vs/ServiceDeclarationLists.fs
index a36dc3ce69a..1a9a90c83c7 100644
--- a/src/fsharp/vs/ServiceDeclarationLists.fs
+++ b/src/fsharp/vs/ServiceDeclarationLists.fs
@@ -176,7 +176,7 @@ module internal DescriptionListsImpl =
prettyTyparInst, parameters, prettyRetTyL, prettyConstraintsL
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
/// Get the set of static parameters associated with an item
let StaticParamsOfItem (infoReader:InfoReader) m denv item =
@@ -382,7 +382,7 @@ module internal DescriptionListsImpl =
| ILTypeDefKind.Delegate -> FSharpGlyph.Delegate
| TAsmRepr _ -> FSharpGlyph.Typedef
| TMeasureableRepr _-> FSharpGlyph.Typedef
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| TProvidedTypeExtensionPoint _-> FSharpGlyph.Typedef
| TProvidedNamespaceExtensionPoint _-> FSharpGlyph.Typedef
#endif
@@ -470,7 +470,7 @@ module internal DescriptionListsImpl =
| Item.Property(_,pinfos) ->
let pinfo = List.head pinfos
if pinfo.IsIndexer then [item] else []
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| SymbolHelpers.ItemIsWithStaticArguments m g _ ->
// we pretend that provided-types-with-static-args are method-like in order to get ParamInfo for them
[item]
@@ -796,7 +796,7 @@ type FSharpMethodGroup( name: string, unsortedMethods: FSharpMethodGroupItem[] )
let hasStaticParameters =
match flatItem with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| SymbolHelpers.ItemIsProvidedTypeWithStaticArguments m g _ -> false
#endif
| _ -> true
@@ -808,7 +808,7 @@ type FSharpMethodGroup( name: string, unsortedMethods: FSharpMethodGroupItem[] )
parameters = (prettyParams |> Array.ofList),
hasParameters = hasStaticParameters,
hasParamArrayArg = hasParamArrayArg,
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
staticParameters = StaticParamsOfItem infoReader m denv flatItem
#else
staticParameters = [| |]
diff --git a/src/fsharp/vs/service.fs b/src/fsharp/vs/service.fs
index a49e0cf0cdb..63df7f33061 100644
--- a/src/fsharp/vs/service.fs
+++ b/src/fsharp/vs/service.fs
@@ -1183,7 +1183,7 @@ type TypeCheckInfo
| None ->
let fail defaultReason =
match item.Item with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| SymbolHelpers.ItemIsProvidedType g (tcref) -> FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.ProvidedType(tcref.DisplayName))
| Item.CtorGroup(name, ProvidedMeth(_)::_)
| Item.MethodGroup(name, ProvidedMeth(_)::_, _)
@@ -1448,7 +1448,7 @@ module internal Parser =
errorCount <- errorCount + 1
match exn with
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
| { Exception = (:? TypeProviderError as tpe) } -> tpe.Iter(fun e -> report { exn with Exception = e })
#endif
| e -> report e
diff --git a/tests/service/Common.fs b/tests/service/Common.fs
index ef3049110e6..8b76fa107c7 100644
--- a/tests/service/Common.fs
+++ b/tests/service/Common.fs
@@ -236,7 +236,7 @@ let attribsOfSymbol (s:FSharpSymbol) =
if v.IsFSharpUnion then yield "union"
if v.IsInterface then yield "interface"
if v.IsMeasure then yield "measure"
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
if v.IsProvided then yield "provided"
if v.IsStaticInstantiation then yield "staticinst"
if v.IsProvidedAndErased then yield "erased"
diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs
index ed366d2d151..bf955c5aa63 100644
--- a/tests/service/ExprTests.fs
+++ b/tests/service/ExprTests.fs
@@ -528,7 +528,7 @@ let bool2 = false
let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args)
//<@ let x = Some(3) in x.IsSome @>
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
[]
let ``Test Declarations project1`` () =
let wholeProjectResults = exprChecker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously
diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs
index 1a345c4a76b..e4dea637cb0 100644
--- a/tests/service/ProjectAnalysisTests.fs
+++ b/tests/service/ProjectAnalysisTests.fs
@@ -109,7 +109,7 @@ let ``Test project1 whole project errors`` () =
let ``Test Project1 should have protected FullName and TryFullName return same results`` () =
let wholeProjectResults = checker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously
let rec getFullNameComparisons (entity: FSharpEntity) =
- #if EXTENSIONTYPING
+ #if !NO_EXTENSIONTYPING
seq { if not entity.IsProvided && entity.Accessibility.IsPublic then
#else
seq { if entity.Accessibility.IsPublic then
@@ -127,7 +127,7 @@ let ``Test Project1 should have protected FullName and TryFullName return same r
let ``Test project1 should not throw exceptions on entities from referenced assemblies`` () =
let wholeProjectResults = checker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously
let rec getAllBaseTypes (entity: FSharpEntity) =
- #if EXTENSIONTYPING
+ #if !NO_EXTENSIONTYPING
seq { if not entity.IsProvided && entity.Accessibility.IsPublic then
#else
seq{
@@ -531,7 +531,7 @@ let ``Test project1 all uses of all symbols`` () =
set expected - set allUsesOfAllSymbols |> shouldEqual Set.empty
(set expected = set allUsesOfAllSymbols) |> shouldEqual true
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
[]
let ``Test file explicit parse symbols`` () =
@@ -3950,7 +3950,7 @@ type Use() =
let fileNames = [fileName1]
let args = mkProjectCommandLineArgs (dllName, fileNames)
let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args)
-#if EXTENSIONTYPING
+#if !NO_EXTENSIONTYPING
[]
let ``Test project28 all symbols in signature`` () =
let wholeProjectResults = checker.ParseAndCheckProject(Project28.options) |> Async.RunSynchronously
@@ -3960,7 +3960,7 @@ let ``Test project28 all symbols in signature`` () =
|> Seq.map (fun s ->
let typeName = s.GetType().Name
match s with
- #if EXTENSIONTYPING
+ #if !NO_EXTENSIONTYPING
| :? FSharpEntity as fse -> typeName, fse.DisplayName, fse.XmlDocSig
#endif
| :? FSharpField as fsf -> typeName, fsf.DisplayName, fsf.XmlDocSig
@@ -3969,7 +3969,7 @@ let ``Test project28 all symbols in signature`` () =
| :? FSharpActivePatternCase as ap -> typeName, ap.DisplayName, ap.XmlDocSig
| :? FSharpGenericParameter as fsg -> typeName, fsg.DisplayName, ""
| :? FSharpParameter as fsp -> typeName, fsp.DisplayName, ""
- #if EXTENSIONTYPING
+ #if !NO_EXTENSIONTYPING
| :? FSharpStaticParameter as fss -> typeName, fss.DisplayName, ""
#endif
| _ -> typeName, s.DisplayName, "unknown")
diff --git a/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj b/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj
index 177beb3bbd2..6875fb61864 100644
--- a/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj
+++ b/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj
@@ -17,7 +17,6 @@
58;75
x86
v4.6
- EXTENSIONTYPING;$(DefineConstants)
NO_PROJECTCRACKER;$(DefineConstants)