diff --git a/src/Compiler/Checking/AttributeChecking.fs b/src/Compiler/Checking/AttributeChecking.fs index 4b7ad219196..2439cc4f794 100644 --- a/src/Compiler/Checking/AttributeChecking.fs +++ b/src/Compiler/Checking/AttributeChecking.fs @@ -415,7 +415,7 @@ let CheckMethInfoAttributes g m tyargsOpt (minfo: MethInfo) = #if !NO_TYPEPROVIDERS (fun provAttribs -> Some (CheckProvidedAttributes g m provAttribs)) #else - (fun _provAttribs -> None) + (fun _provAttribs -> None) #endif match search with | Some res -> res diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 04f2afbefbc..525a30d09e2 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -8534,8 +8534,10 @@ and TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem after TcMethodApplicationThen cenv env overallTy None tpenv None [] mItem mItem methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic delayed and TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem afterResolution delayed = +#if !NO_TYPEPROVIDERS let g = cenv.g let ad = env.eAccessRights +#endif let objTy = match minfos with | minfo :: _ -> minfo.ApparentEnclosingType diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index c51a75643b5..d2a23e73038 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -650,6 +650,7 @@ type Entity = /// Indicates the type prefers the "tycon" syntax for display etc. member IsPrefixDisplay: bool +#if !NO_TYPEPROVIDERS /// Indicates if the entity is a provided type or namespace definition member IsProvided: bool @@ -661,11 +662,14 @@ type Entity = /// Indicates if the entity is a provided namespace fragment member IsProvidedNamespace: bool +#endif /// Indicates if this is an F# type definition whose r.h.s. is known to be a record type definition. member IsRecordTycon: bool +#if !NO_TYPEPROVIDERS member IsStaticInstantiationTycon: bool +#endif /// Indicates if this is a struct or enum type definition, i.e. a value type definition member IsStructOrEnumTycon: bool @@ -881,6 +885,7 @@ type TyconRepresentation = /// Indicates the type is parameterized on a measure (e.g. float<_>) but erases to some other type (e.g. float) | TMeasureableRepr of TType +#if !NO_TYPEPROVIDERS /// TProvidedTypeRepr /// /// Indicates the representation information for a provided type. @@ -888,6 +893,7 @@ type TyconRepresentation = /// Indicates the representation information for a provided namespace. | TProvidedNamespaceRepr of ResolutionEnvironment * Tainted list +#endif /// The 'NoRepr' value here has four meanings: /// (1) it indicates 'not yet known' during the first 2 phases of establishing type definitions @@ -910,6 +916,8 @@ type TILObjectReprData = [] member DebugText: string +#if !NO_TYPEPROVIDERS + /// The information kept about a provided type [] type TProvidedTypeInfo = @@ -971,6 +979,8 @@ type TProvidedTypeInfo = /// Indicates if the provided type is generated, i.e. not erased member IsGenerated: bool +#endif + type TyconFSharpObjModelKind = /// Indicates the type is an F#-declared class (also used for units-of-measure) @@ -1308,8 +1318,10 @@ type ModuleOrNamespaceType = /// Mutation used during compilation of FSharp.Core.dll member AddModuleOrNamespaceByMutation: modul: ModuleOrNamespace -> unit +#if !NO_TYPEPROVIDERS /// Mutation used in hosting scenarios to hold the hosted types in this module or namespace member AddProvidedTypeEntity: entity: Entity -> unit +#endif /// Return a new module or namespace type with a value added. member AddVal: vspec: Val -> ModuleOrNamespaceType @@ -2192,9 +2204,11 @@ type NonLocalEntityRef = /// Try to find the entity corresponding to the given path in the given CCU static member TryDerefEntityPath: ccu: CcuThunk * path: string[] * i: int * entity: Entity -> Entity voption +#if !NO_TYPEPROVIDERS /// 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 -> Entity voption +#endif override ToString: unit -> string @@ -2446,6 +2460,7 @@ type EntityRef = /// Indicates the type prefers the "tycon" syntax for display etc. member IsPrefixDisplay: bool +#if !NO_TYPEPROVIDERS /// Indicates if the entity is a provided namespace fragment member IsProvided: bool @@ -2457,6 +2472,7 @@ type EntityRef = /// Indicates if the entity is a provided namespace fragment member IsProvidedNamespace: bool +#endif /// Indicates if this is an F# type definition whose r.h.s. is known to be a record type definition. member IsRecordTycon: bool @@ -2464,8 +2480,10 @@ type EntityRef = /// Indicates if the reference has been resolved member IsResolved: bool +#if !NO_TYPEPROVIDERS /// Indicates if the entity is an erased provided type definition that incorporates a static instantiation (type therefore in some sense compiler generated) member IsStaticInstantiationTycon: bool +#endif /// Indicates if this is a struct or enum type definition, i.e. a value type definition member IsStructOrEnumTycon: bool @@ -3867,6 +3885,7 @@ type CcuData = /// Indicates that this DLL was compiled using the F# compiler type has F# metadata IsFSharp: bool +#if !NO_TYPEPROVIDERS /// Is the CCu an assembly injected by a type provider IsProviderGenerated: bool @@ -3876,6 +3895,7 @@ type CcuData = /// A helper function used to link method signatures using type equality. This is effectively a forward call to the type equality /// logic in tastops.fs ImportProvidedType: Tainted -> TType +#endif /// Indicates that this DLL uses pre-F#-4.0 quotation literals somewhere. This is used to implement a restriction on static linking mutable UsesFSharp20PlusQuotations: bool @@ -3944,8 +3964,10 @@ type CcuThunk = /// Fixup a CCU to have the given contents member Fixup: avail: CcuThunk -> unit +#if !NO_TYPEPROVIDERS /// Used to make 'forward' calls into the loader during linking member ImportProvidedType: ty: Tainted -> TType +#endif /// Used to make forward calls into the type/assembly loader when comparing member signatures during linking member MemberSignatureEquality: ty1: TType * ty2: TType -> bool @@ -3980,8 +4002,10 @@ type CcuThunk = /// Indicates that this DLL was compiled using the F# compiler type has F# metadata member IsFSharp: bool +#if !NO_TYPEPROVIDERS /// Is this a provider-injected assembly member IsProviderGenerated: bool +#endif /// Indicates if this assembly reference is unresolved member IsUnresolvedReference: bool @@ -4120,9 +4144,11 @@ type Construct = new: unit -> Construct +#if !NO_TYPEPROVIDERS /// Compute the definition location of a provided item static member ComputeDefinitionLocationOfProvidedItem: p: Tainted<#IProvidedCustomAttributeProvider> -> Text.range option +#endif /// Key a Tycon or TyconRef by both mangled type demangled name. /// Generic types can be accessed either by 'List' or 'List`1'. @@ -4207,6 +4233,7 @@ type Construct = static member NewModuleOrNamespaceType: mkind: ModuleOrNamespaceKind -> tycons: Entity list -> vals: Val list -> ModuleOrNamespaceType +#if !NO_TYPEPROVIDERS /// Create a new entity node for a provided type definition static member NewProvidedTycon: resolutionEnvironment: ResolutionEnvironment * @@ -4226,6 +4253,7 @@ type Construct = isSuppressRelocate: bool * m: Text.range -> TyconRepresentation +#endif /// Create a new TAST RecdField node for an F# class, struct or record field static member NewRecdField: