Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit 183f27d

Browse files
cartermpnosami
authored andcommitted
MakeCalledArgs allocates a struct tuple (dotnet#9223)
* MakeCalledArgs allocates a struct tuple * Add vsnd
1 parent b6bde62 commit 183f27d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/fsharp/CompileOps.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ let OutputPhasedErrorR (os: StringBuilder) (err: PhasedDiagnostic) (canSuggestNa
821821
let nameOrOneBasedIndexMessage =
822822
x.calledArg.NameOpt
823823
|> Option.map (fun n -> FSComp.SR.csOverloadCandidateNamedArgumentTypeMismatch n.idText)
824-
|> Option.defaultValue (FSComp.SR.csOverloadCandidateIndexedArgumentTypeMismatch ((snd x.calledArg.Position) + 1))
824+
|> Option.defaultValue (FSComp.SR.csOverloadCandidateIndexedArgumentTypeMismatch ((Lib.vsnd x.calledArg.Position) + 1)) //snd
825825
sprintf " // %s" nameOrOneBasedIndexMessage
826826
| _ -> ""
827827

src/fsharp/MethodCalls.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type CallerArg<'T> =
6161

6262
/// Represents the information about an argument in the method being called
6363
type CalledArg =
64-
{ Position: (int * int)
64+
{ Position: struct (int * int)
6565
IsParamArray : bool
6666
OptArgInfo : OptionalArgInfo
6767
CallerInfo : CallerInfo
@@ -303,7 +303,7 @@ let MakeCalledArgs amap m (minfo: MethInfo) minst =
303303
// Mark up the arguments with their position, so we can sort them back into order later
304304
let paramDatas = minfo.GetParamDatas(amap, m, minst)
305305
paramDatas |> List.mapiSquared (fun i j (ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoFlags, nmOpt, reflArgInfo, typeOfCalledArg)) ->
306-
{ Position=(i,j)
306+
{ Position=struct(i,j)
307307
IsParamArray=isParamArrayArg
308308
OptArgInfo=optArgInfo
309309
CallerInfo = callerInfoFlags

src/fsharp/lib.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,3 +564,4 @@ type MaybeLazy<'T> =
564564
| Strict x -> x
565565
| Lazy x -> x.Force()
566566

567+
let inline vsnd ((_, y): struct('T * 'T)) = y

0 commit comments

Comments
 (0)