@@ -2812,7 +2812,7 @@ let TcVal checkAttributes cenv env tpenv (vref:ValRef) optInst optAfterResolutio
28122812 // If we have got an explicit instantiation then use that
28132813 | Some(vrefFlags, checkTys) ->
28142814 let checkInst (tinst:TypeInst) =
2815- if not v.IsMember && not v.PermitsExplicitTypeInstantiation &&tinst.Length > 0 && v.Typars.Length > 0 then
2815+ if not v.IsMember && not v.PermitsExplicitTypeInstantiation &¬ (List.isEmpty tinst) &¬ (List.isEmpty v.Typars) then
28162816 warning(Error(FSComp.SR.tcDoesNotAllowExplicitTypeArguments(v.DisplayName), m))
28172817 match vrec with
28182818 | ValInRecScope false ->
@@ -7495,13 +7495,13 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv
74957495 | StripApps(SingleIdent nm, [StripApps(SingleIdent nm2, args); arg2]) when
74967496 PrettyNaming.IsInfixOperator nm.idText &&
74977497 expectedArgCountForCustomOperator nm2 > 0 &&
7498- args.Length > 0 ->
7498+ not (List.isEmpty args) ->
74997499 let estimatedRangeOfIntendedLeftAndRightArguments = unionRanges (List.last args).Range arg2.Range
75007500 errorR(Error(FSComp.SR.tcUnrecognizedQueryBinaryOperator(), estimatedRangeOfIntendedLeftAndRightArguments))
75017501 true
75027502 | SynExpr.Tuple( (StripApps(SingleIdent nm2, args) :: _), _, m) when
75037503 expectedArgCountForCustomOperator nm2 > 0 &&
7504- args.Length > 0 ->
7504+ not (List.isEmpty args) ->
75057505 let estimatedRangeOfIntendedLeftAndRightArguments = unionRanges (List.last args).Range m.EndRange
75067506 errorR(Error(FSComp.SR.tcUnrecognizedQueryBinaryOperator(), estimatedRangeOfIntendedLeftAndRightArguments))
75077507 true
@@ -11254,7 +11254,7 @@ and AnalyzeAndMakeAndPublishRecursiveValue overridesOK isGeneratedEventVal cenv
1125411254 let prelimTyscheme = TypeScheme(enclosingDeclaredTypars@declaredTypars, ty)
1125511255 let partialValReprInfo = TranslateTopValSynInfo mBinding (TcAttributes cenv envinner) valSynInfo
1125611256 let topValInfo = UseSyntacticArity declKind prelimTyscheme partialValReprInfo
11257- let hasDeclaredTypars =declaredTypars.Length > 0
11257+ let hasDeclaredTypars =not (List.isEmpty declaredTypars)
1125811258 let prelimValScheme = ValScheme(bindingId, prelimTyscheme, topValInfo, memberInfoOpt, false, inlineFlag, NormalVal, vis, false, false, false, hasDeclaredTypars)
1125911259
1126011260 // Check the literal r.h.s., if any
@@ -13576,14 +13576,14 @@ module MutRecBindingChecking =
1357613576 let ad = env.eAccessRights
1357713577 let mvvs = ForceRaise (ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m OpenQualified env.eNameResEnv ad p false)
1357813578 let modrefs = mvvs |> List.map p23
13579- ifmodrefs.Length > 0 && modrefs |> List.forall (fun modref -> modref.IsNamespace) then
13579+ ifnot (List.isEmpty modrefs) && modrefs |> List.forall (fun modref -> modref.IsNamespace) then
1358013580 errorR(Error(FSComp.SR.tcModuleAbbreviationForNamespace(fullDisplayTextOfModRef (List.head modrefs)), m))
1358113581 let modrefs = modrefs |> List.filter (fun mvv -> not mvv.IsNamespace)
13582+ if List.isEmpty modrefs then env else
1358213583 modrefs |> List.iter (fun modref -> CheckEntityAttributes cenv.g modref m |> CommitOperationResult)
13583- let env =(if modrefs.Length > 0 then AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env else env)
13584+ let env = AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env
1358413585 env
1358513586
13586-
1358713587 /// Update the contents accessible via the recursive namespace declaration, if any
1358813588 let TcMutRecDefns_UpdateNSContents mutRecNSInfo =
1358913589 match mutRecNSInfo with
@@ -15130,10 +15130,10 @@ module EstablishTypeDefinitionCores =
1513015130 if allowed then
1513115131 if kind = explicitKind then
1513215132 warning(PossibleUnverifiableCode(m))
15133- elif thisTyconRef.Typars(m).Length > 0 then
15134- errorR (Error(FSComp.SR.tcGenericTypesCannotHaveStructLayout(), m))
15135- else
15133+ elif List.isEmpty (thisTyconRef.Typars m) then
1513615134 errorR (Error(FSComp.SR.tcOnlyStructsCanHaveStructLayout(), m))
15135+ else
15136+ errorR (Error(FSComp.SR.tcGenericTypesCannotHaveStructLayout(), m))
1513715137 | None -> ()
1513815138
1513915139 let hiddenReprChecks(hasRepr) =
@@ -16363,14 +16363,13 @@ let rec TcSignatureElementNonMutRec cenv parent typeNames endm (env: TcEnv) synS
1636316363
1636416364 let modrefs = unfilteredModrefs |> List.filter (fun modref -> not modref.IsNamespace)
1636516365
16366- ifunfilteredModrefs.Length > 0 && List.isEmpty modrefs then
16366+ ifnot (List.isEmpty unfilteredModrefs) && List.isEmpty modrefs then
1636716367 errorR(Error(FSComp.SR.tcModuleAbbreviationForNamespace(fullDisplayTextOfModRef (List.head unfilteredModrefs)), m))
1636816368
16369+ if List.isEmpty modrefs then return env else
1636916370 modrefs |> List.iter (fun modref -> CheckEntityAttributes cenv.g modref m |> CommitOperationResult)
1637016371
16371- let env =
16372- if modrefs.Length > 0 then AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env
16373- else env
16372+ let env = AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env
1637416373 return env
1637516374
1637616375 | SynModuleSigDecl.HashDirective _ ->