Skip to content

Commit 60d2ad6

Browse files
committed
fix tests
1 parent 89dc823 commit 60d2ad6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/fsharp/NicePrint.fs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,12 +1061,14 @@ module private PrintTypes =
10611061
nameL ^^ wordL ":" ^^ tauL
10621062

10631063

1064-
let layoutPrettyType denv typ =
1064+
let layoutPrettyTypeWithPrec prec denv typ =
10651065
let _,typ,cxs = PrettyTypes.PrettifyTypes1 denv.g typ
10661066
let env = SimplifyTypes.CollectInfo true [typ] cxs
10671067
let cxsL = layoutConstraintsWithInfo denv env env.postfixConstraints
1068-
layoutTypeWithInfoAndPrec denv env 2 typ --- cxsL
1068+
layoutTypeWithInfoAndPrec denv env prec typ --- cxsL
10691069

1070+
let layoutPrettyType denv typ = layoutPrettyTypeWithPrec 2 denv typ
1071+
let layoutPrettyTypeHighPrec denv typ = layoutPrettyTypeWithPrec 5 denv typ
10701072

10711073
/// Printing TAST objects
10721074
module private PrintTastMemberOrVals =
@@ -1879,6 +1881,7 @@ let isGeneratedExceptionField pos f = TastDefinitionPrinting.isGeneratedExce
18791881
let stringOfTyparConstraint denv tpc = stringOfTyparConstraints denv [tpc]
18801882
let stringOfTy denv x = x |> PrintTypes.layoutType denv |> showL
18811883
let prettyStringOfTy denv x = x |> PrintTypes.layoutPrettyType denv |> showL
1884+
let prettyStringOfTyHighPrec denv x = x |> PrintTypes.layoutPrettyTypeHighPrec denv |> showL
18821885
let stringOfRecdField denv x = x |> TastDefinitionPrinting.layoutRecdField false denv |> showL
18831886
let stringOfUnionCase denv x = x |> TastDefinitionPrinting.layoutUnionCase denv (wordL "|") |> showL
18841887
let stringOfExnDef denv x = x |> TastDefinitionPrinting.layoutExnDefn denv |> showL

src/fsharp/vs/Symbols.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,11 +1848,11 @@ and FSharpType(cenv, typ:TType) =
18481848

18491849
member x.Format(denv: FSharpDisplayContext) =
18501850
protect <| fun () ->
1851-
NicePrint.prettyStringOfTy (denv.Contents cenv.g) typ
1851+
NicePrint.prettyStringOfTyHighPrec (denv.Contents cenv.g) typ
18521852

18531853
override x.ToString() =
18541854
protect <| fun () ->
1855-
"type " + NicePrint.prettyStringOfTy (DisplayEnv.Empty(cenv.g)) typ
1855+
"type " + NicePrint.prettyStringOfTyHighPrec (DisplayEnv.Empty(cenv.g)) typ
18561856

18571857
static member Prettify(typ: FSharpType) =
18581858
let t = PrettyTypes.PrettifyTypes1 typ.cenv.g typ.V |> p23

0 commit comments

Comments
 (0)