Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Probably dangerous?] Fixes printing argument tuple name in a tooltip #10461

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/fsharp/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1659,8 +1659,8 @@ let CombineSyntacticAndInferredArities g declKind rhsExpr prelimScheme =
| [], _ -> []
// Dont infer eliminated unit args from the expression if they don't occur syntactically.
| ai, [] -> ai
// If we infer a tupled argument from the expression and/or type then use that
| _ when ai1.Length < ai2.Length -> ai2
// If we infer a tupled argument from the expression and/or type and at least one arg has a name then use that
| _ when ai1.Length < ai2.Length && ai2 |> List.exists (fun (valInfo: ArgReprInfo) -> valInfo.Name.IsSome) -> ai2
| _ -> ai1
let rec loop ais1 ais2 =
match ais1, ais2 with
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/ConstraintSolver.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ val SimplifyMeasuresInTypeScheme: TcGlobals -> bool -> Typars -> TType -> TyparC

val ResolveOverloadingForCall: DisplayEnv -> ConstraintSolverState -> range -> methodName: string -> ndeep: int -> cx: TraitConstraintInfo option -> callerArgs: CallerArgs<Expr> -> AccessorDomain -> calledMethGroup: CalledMeth<Expr> list -> permitOptArgs: bool -> reqdRetTyOpt: TType option -> CalledMeth<Expr> option * OperationResult<unit>

val UnifyUniqueOverloading: DisplayEnv -> ConstraintSolverState -> range -> int * int -> string -> AccessorDomain -> CalledMeth<SynExpr> list -> TType -> OperationResult<bool>
val UnifyUniqueOverloading: DisplayEnv -> ConstraintSolverState -> range -> callerArgCounts: (int * int) -> string -> AccessorDomain -> CalledMeth<SynExpr> list -> TType -> OperationResult<bool>

/// Remove the global constraints where these type variables appear in the support of the constraint
val EliminateConstraintsForGeneralizedTypars: DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> Typars -> unit
Expand Down
16 changes: 8 additions & 8 deletions src/fsharp/TypedTreeOps.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -930,9 +930,9 @@ module PrettyTypes =

val PrettifyType : TcGlobals -> TType -> TType * TyparConstraintsWithTypars

val PrettifyInstAndTyparsAndType : TcGlobals -> TyparInst * Typars * TType -> (TyparInst * Typars * TType) * TyparConstraintsWithTypars
val PrettifyInstAndTyparsAndType : g: TcGlobals -> x: (TyparInst * Typars * TType) -> (TyparInst * Typars * TType) * TyparConstraintsWithTypars

val PrettifyTypePair : TcGlobals -> TType * TType -> (TType * TType) * TyparConstraintsWithTypars
val PrettifyTypePair : g: TcGlobals -> x: (TType * TType) -> (TType * TType) * TyparConstraintsWithTypars

val PrettifyTypes : TcGlobals -> TTypes -> TTypes * TyparConstraintsWithTypars

Expand All @@ -943,19 +943,19 @@ module PrettyTypes =

val PrettifyInst : TcGlobals -> TyparInst -> TyparInst * TyparConstraintsWithTypars

val PrettifyInstAndType : TcGlobals -> TyparInst * TType -> (TyparInst * TType) * TyparConstraintsWithTypars
val PrettifyInstAndType : g: TcGlobals -> x: (TyparInst * TType) -> (TyparInst * TType) * TyparConstraintsWithTypars

val PrettifyInstAndTypes : TcGlobals -> TyparInst * TTypes -> (TyparInst * TTypes) * TyparConstraintsWithTypars
val PrettifyInstAndTypes : g: TcGlobals -> x: (TyparInst * TTypes) -> (TyparInst * TTypes) * TyparConstraintsWithTypars

val PrettifyInstAndSig : TcGlobals -> TyparInst * TTypes * TType -> (TyparInst * TTypes * TType) * TyparConstraintsWithTypars
val PrettifyInstAndSig : g: TcGlobals -> x: (TyparInst * TTypes * TType) -> (TyparInst * TTypes * TType) * TyparConstraintsWithTypars

val PrettifyCurriedTypes : TcGlobals -> TType list list -> TType list list * TyparConstraintsWithTypars

val PrettifyCurriedSigTypes : TcGlobals -> TType list list * TType -> (TType list list * TType) * TyparConstraintsWithTypars
val PrettifyCurriedSigTypes : g: TcGlobals -> x: (TType list list * TType) -> (TType list list * TType) * TyparConstraintsWithTypars

val PrettifyInstAndUncurriedSig : TcGlobals -> TyparInst * UncurriedArgInfos * TType -> (TyparInst * UncurriedArgInfos * TType) * TyparConstraintsWithTypars
val PrettifyInstAndUncurriedSig : g: TcGlobals -> x: (TyparInst * UncurriedArgInfos * TType) -> (TyparInst * UncurriedArgInfos * TType) * TyparConstraintsWithTypars

val PrettifyInstAndCurriedSig : TcGlobals -> TyparInst * TTypes * CurriedArgInfos * TType -> (TyparInst * TTypes * CurriedArgInfos * TType) * TyparConstraintsWithTypars
val PrettifyInstAndCurriedSig : g: TcGlobals -> x: (TyparInst * TTypes * CurriedArgInfos * TType) -> (TyparInst * TTypes * CurriedArgInfos * TType) * TyparConstraintsWithTypars

[<NoEquality; NoComparison>]
type DisplayEnv =
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/utils/sformat.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ module Display =

let output_any writer x = output_any_ex FormatOptions.Default writer x

let layout_as_string options x = x |> any_to_layout options |> layout_to_string options
let layout_as_string options (value, typValue) = (value, typValue) |> any_to_layout options |> layout_to_string options

let any_to_string x = layout_as_string FormatOptions.Default x

Expand Down
2 changes: 1 addition & 1 deletion tests/fsharp/core/hiding/lib2.mli
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


val f1: Lib.abstractType -> unit (* looks OK, but optimization data may refer to hidden type *)
val f2: Lib.abstractType * Lib.abstractType -> unit (* looks OK, but optimization data may refer to hidden type *)
val f2: x: Lib.abstractType * Lib.abstractType -> unit (* looks OK, but optimization data may refer to hidden type *)


val e2: exn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2661,7 +2661,7 @@ end
> > val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on match val"

> val ( |A|B| ) : p:bool -> 'a * 'b -> Choice<'a,'b>
> val ( |A|B| ) : p:bool -> x:('a * 'b) -> Choice<'a,'b>

> val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on parameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,7 @@ end
> > val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on match val"

> val ( |A|B| ) : p:bool -> 'a * 'b -> Choice<'a,'b>
> val ( |A|B| ) : p:bool -> x:('a * 'b) -> Choice<'a,'b>

> val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on parameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,7 @@ end
> > val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on match val"

> val ( |A|B| ) : p:bool -> 'a * 'b -> Choice<'a,'b>
> val ( |A|B| ) : p:bool -> x:('a * 'b) -> Choice<'a,'b>

> val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on parameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ end
> > val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on match val"

> val ( |A|B| ) : p:bool -> 'a * 'b -> Choice<'a,'b>
> val ( |A|B| ) : p:bool -> x:('a * 'b) -> Choice<'a,'b>

> val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on parameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6208,7 +6208,7 @@ end
> > val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on match val"

> val ( |A|B| ) : p:bool -> 'a * 'b -> Choice<'a,'b>
> val ( |A|B| ) : p:bool -> x:('a * 'b) -> Choice<'a,'b>

> val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on parameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6210,7 +6210,7 @@ end
> > val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on match val"

> val ( |A|B| ) : p:bool -> 'a * 'b -> Choice<'a,'b>
> val ( |A|B| ) : p:bool -> x:('a * 'b) -> Choice<'a,'b>

> val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on parameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ end
> > val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on match val"

> val ( |A|B| ) : p:bool -> 'a * 'b -> Choice<'a,'b>
> val ( |A|B| ) : p:bool -> x:('a * 'b) -> Choice<'a,'b>

> val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on parameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@ end
> > val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on match val"

> val ( |A|B| ) : p:bool -> 'a * 'b -> Choice<'a,'b>
> val ( |A|B| ) : p:bool -> x:('a * 'b) -> Choice<'a,'b>

> val it : string =
"** Expect OK since active pattern result is not too generic, typars depend on parameters"
Expand Down