@@ -2782,7 +2782,7 @@ type DisplayEnv =
2782
2782
showHiddenMembers = false
2783
2783
showTyparBinding = false
2784
2784
showImperativeTyparAnnotations = false
2785
- suppressInlineKeyword = false
2785
+ suppressInlineKeyword = true
2786
2786
suppressMutableKeyword = false
2787
2787
showMemberContainers = false
2788
2788
showAttributes = false
@@ -2813,6 +2813,24 @@ type DisplayEnv =
2813
2813
member denv.UseGenericParameterStyle style =
2814
2814
{ denv with genericParameterStyle = style }
2815
2815
2816
+ static member InitialForSigFileGeneration g =
2817
+ let denv =
2818
+ { DisplayEnv.Empty g with
2819
+ showImperativeTyparAnnotations = true
2820
+ showHiddenMembers = true
2821
+ showObsoleteMembers = true
2822
+ showAttributes = true
2823
+ suppressInlineKeyword = false
2824
+ showDocumentation = true
2825
+ shrinkOverloads = false
2826
+ }
2827
+ denv.SetOpenPaths
2828
+ [ FSharpLib.RootPath
2829
+ FSharpLib.CorePath
2830
+ FSharpLib.CollectionsPath
2831
+ FSharpLib.ControlPath
2832
+ ( IL.splitNamespace FSharpLib.ExtraTopLevelOperatorsName) ]
2833
+
2816
2834
let (+.+) s1 s2 = if s1 = " " then s2 else s1+ " ." + s2
2817
2835
2818
2836
let layoutOfPath p =
@@ -8794,21 +8812,23 @@ and remapValToNonLocal g tmenv inp =
8794
8812
let ApplyExportRemappingToEntity g tmenv x = remapTyconToNonLocal g tmenv x
8795
8813
8796
8814
(* Which constraints actually get compiled to .NET constraints? *)
8797
- let isCompiledConstraint cx =
8815
+ let isCompiledOrWitnessPassingConstraint ( g : TcGlobals ) cx =
8798
8816
match cx with
8799
8817
| TyparConstraint.SupportsNull _ // this implies the 'class' constraint
8800
8818
| TyparConstraint.IsReferenceType _ // this is the 'class' constraint
8801
8819
| TyparConstraint.IsNonNullableStruct _
8802
8820
| TyparConstraint.IsReferenceType _
8803
8821
| TyparConstraint.RequiresDefaultConstructor _
8804
8822
| TyparConstraint.CoercesTo _ -> true
8823
+ | TyparConstraint.MayResolveMember _ when g.langVersion.SupportsFeature LanguageFeature.WitnessPassing -> true
8805
8824
| _ -> false
8806
8825
8807
- // Is a value a first-class polymorphic value with .NET constraints?
8808
- // Used to turn off TLR and method splitting
8826
+ // Is a value a first-class polymorphic value with .NET constraints, or witness-passing constraints?
8827
+ // Used to turn off TLR and method splitting and do not compile to
8828
+ // FSharpTypeFunc, but rather bake a "local type function" for each TyLambda abstraction.
8809
8829
let IsGenericValWithGenericConstraints g ( v : Val ) =
8810
8830
isForallTy g v.Type &&
8811
- v.Type |> destForallTy g |> fst |> List.exists ( fun tp -> List.exists isCompiledConstraint tp.Constraints)
8831
+ v.Type |> destForallTy g |> fst |> List.exists ( fun tp -> List.exists ( isCompiledOrWitnessPassingConstraint g ) tp.Constraints)
8812
8832
8813
8833
// Does a type support a given interface?
8814
8834
type Entity with
0 commit comments