Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Add vsnd
  • Loading branch information
cartermp committed May 18, 2020
commit 3af8fac4bad269ecf33096cf03cccd5882d966ed
2 changes: 1 addition & 1 deletion src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ let OutputPhasedErrorR (os: StringBuilder) (err: PhasedDiagnostic) (canSuggestNa
let nameOrOneBasedIndexMessage =
x.calledArg.NameOpt
|> Option.map (fun n -> FSComp.SR.csOverloadCandidateNamedArgumentTypeMismatch n.idText)
|> Option.defaultValue (FSComp.SR.csOverloadCandidateIndexedArgumentTypeMismatch ((snd x.calledArg.Position) + 1))
|> Option.defaultValue (FSComp.SR.csOverloadCandidateIndexedArgumentTypeMismatch ((Lib.vsnd x.calledArg.Position) + 1)) //snd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we always be qualified with Lib? Is that how other functions from Lib are called elsewhere?

sprintf " // %s" nameOrOneBasedIndexMessage
| _ -> ""

Expand Down
1 change: 1 addition & 0 deletions src/fsharp/lib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -564,3 +564,4 @@ type MaybeLazy<'T> =
| Strict x -> x
| Lazy x -> x.Force()

let inline vsnd ((_, y): struct('T * 'T)) = y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the ('T*'T) here and not ('a*'b) ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this should be ('a * 'b) or ('T * 'U).