Skip to content

Commit ac0476c

Browse files
authored
Merge pull request #9352 from dotnet/merges/master-to-feature/witness-passing
Merge master to feature/witness-passing
2 parents 4b0235c + 0ae1389 commit ac0476c

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

src/absil/illib.fs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,6 @@ module List =
273273
| [] -> None
274274
| h :: t -> if f h then Some (h, n) else findi (n+1) f t
275275

276-
let rec drop n l =
277-
match l with
278-
| [] -> []
279-
| _ :: xs -> if n=0 then l else drop (n-1) xs
280-
281276
let splitChoose select l =
282277
let rec ch acc1 acc2 l =
283278
match l with

src/fsharp/ConstraintSolver.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2424,7 +2424,7 @@ and ReportNoCandidatesError (csenv: ConstraintSolverEnv) (nUnnamedCallerArgs, nN
24242424
else
24252425
if nReqd > nActual then
24262426
let diff = nReqd - nActual
2427-
let missingArgs = List.drop nReqd cmeth.AllUnnamedCalledArgs
2427+
let missingArgs = List.skip nReqd cmeth.AllUnnamedCalledArgs
24282428
match NamesOfCalledArgs missingArgs with
24292429
| [] ->
24302430
if nActual = 0 then

src/fsharp/DetupleArgs.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ let mkTransform g (f: Val) m tps x1Ntys rty (callPattern, tyfringes: (TType list
465465
| _ -> Some(ValReprInfo (ValReprInfo.InferTyparInfo tps, List.collect ValReprInfoForTS callPattern, ValReprInfo.unnamedRetVal))
466466
(* type(transformedVal) tyfringes types replace initial arg types of f *)
467467
let tys1r = List.collect fst tyfringes (* types for collapsed initial r args *)
468-
let tysrN = List.drop tyfringes.Length x1Ntys (* types for remaining args *)
468+
let tysrN = List.skip tyfringes.Length x1Ntys (* types for remaining args *)
469469
let argtys = tys1r @ tysrN
470470
let fCty = mkLambdaTy tps argtys rty
471471
let transformedVal =
@@ -784,7 +784,7 @@ let passBind penv (TBind(fOrig, repr, letSeqPtOpt) as bind) =
784784
let transformedFormals = trans.transformedFormals
785785
let p = transformedFormals.Length
786786
if (vss.Length < p) then internalError "passBinds: |vss|<p - detuple pass"
787-
let xqNs = List.drop p vss
787+
let xqNs = List.skip p vss
788788
let x1ps = List.truncate p vss
789789
let y1Ps = List.concat (List.map2 transFormal transformedFormals x1ps)
790790
let formals = y1Ps @ xqNs

src/fsharp/IlxGen.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6233,7 +6233,7 @@ and GenMethodForBinding
62336233
match v.MemberInfo with
62346234
| Some memberInfo when not v.IsExtensionMember ->
62356235

6236-
let ilMethTypars = ilTypars |> List.drop mspec.DeclaringType.GenericArgs.Length
6236+
let ilMethTypars = ilTypars |> List.skip mspec.DeclaringType.GenericArgs.Length
62376237
if memberInfo.MemberFlags.MemberKind = MemberKind.Constructor then
62386238
assert (isNil ilMethTypars)
62396239
let mdef = mkILCtor (access, ilParams, ilMethodBody)

src/fsharp/NameResolution.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ let LookupTypeNameInEntityMaybeHaveArity (amap, m, ad, nm, staticResInfo: TypeNa
13561356
/// Handle the .NET/C# business where nested generic types implicitly accumulate the type parameters
13571357
/// from their enclosing types.
13581358
let MakeNestedType (ncenv: NameResolver) (tinst: TType list) m (tcrefNested: TyconRef) =
1359-
let tps = List.drop tinst.Length (tcrefNested.Typars m)
1359+
let tps = List.skip tinst.Length (tcrefNested.Typars m)
13601360
let tinstNested = ncenv.InstantiationGenerator m tps
13611361
mkAppTy tcrefNested (tinst @ tinstNested)
13621362

src/fsharp/TypeChecker.fs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ let AdjustAndForgetUsesOfRecValue cenv (vrefTgt: ValRef) (valScheme: ValScheme)
16281628
errorR(Error(FSComp.SR.tcUnexpectedExprAtRecInfPoint(), m))
16291629
NormalValUse, []
16301630

1631-
let ityargs = generalizeTypars (List.drop (List.length tyargs0) generalizedTypars)
1631+
let ityargs = generalizeTypars (List.skip (List.length tyargs0) generalizedTypars)
16321632
primMkApp (Expr.Val (vrefTgt, vrefFlags, m), fty) (tyargs0 @ ityargs) [] m
16331633
fixupPoint.Value <- fixedUpExpr)
16341634

@@ -5071,12 +5071,14 @@ and TcTypeApp cenv newOk checkCxs occ env tpenv m tcref pathTypeArgs (synArgTys:
50715071
// If we're not checking constraints, i.e. when we first assert the super/interfaces of a type definition, then just
50725072
// clear the constraint lists of the freshly generated type variables. A little ugly but fairly localized.
50735073
if checkCxs = NoCheckCxs then tps |> List.iter (fun tp -> tp.SetConstraints [])
5074-
if tinst.Length <> pathTypeArgs.Length + synArgTys.Length then
5075-
error (TyconBadArgs(env.DisplayEnv, tcref, pathTypeArgs.Length + synArgTys.Length, m))
5074+
let synArgTysLength = synArgTys.Length
5075+
let pathTypeArgsLength = pathTypeArgs.Length
5076+
if tinst.Length <> pathTypeArgsLength + synArgTysLength then
5077+
error (TyconBadArgs(env.DisplayEnv, tcref, pathTypeArgsLength + synArgTysLength, m))
50765078

50775079
let argTys, tpenv =
50785080
// Get the suffix of typars
5079-
let tpsForArgs = List.drop (tps.Length - synArgTys.Length) tps
5081+
let tpsForArgs = List.skip (tps.Length - synArgTysLength) tps
50805082
let kindsForArgs = tpsForArgs |> List.map (fun tp -> tp.Kind)
50815083
TcTypesOrMeasures (Some kindsForArgs) cenv newOk checkCxs occ env tpenv synArgTys m
50825084

0 commit comments

Comments
 (0)