From 80b9c9fca6b5581e2547f361b15ae60ead60f7f3 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Fri, 17 Oct 2025 17:54:00 +0100 Subject: [PATCH 1/7] FCS 43.10.100 --- Directory.Packages.props | 4 +-- src/FSharpLint.Core/Framework/Ast.fs | 28 +++++++++++-------- .../Conventions/Binding/BindingHelper.fs | 2 +- .../Binding/FavourIgnoreOverLetWild.fs | 2 +- .../Conventions/Binding/UselessBinding.fs | 2 +- .../FavourNonMutablePropertyInitialization.fs | 4 +-- .../Conventions/FavourStaticEmptyFields.fs | 2 +- .../Conventions/Naming/AvoidTooShortNames.fs | 6 ++-- .../Conventions/RecursiveAsyncFunction.fs | 2 +- .../Formatting/Typography/Indentation.fs | 13 +++++++-- src/FSharpLint.Core/Rules/NamingHelper.fs | 2 +- .../Smells/AsyncExceptionWithoutReturn.fs | 2 +- .../Framework/TestAbstractSyntaxArray.fs | 2 +- 13 files changed, 43 insertions(+), 28 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 04c1d832b..21ed30173 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,9 +8,9 @@ - + - + diff --git a/src/FSharpLint.Core/Framework/Ast.fs b/src/FSharpLint.Core/Framework/Ast.fs index 21f6ef154..4c40a5d77 100644 --- a/src/FSharpLint.Core/Framework/Ast.fs +++ b/src/FSharpLint.Core/Framework/Ast.fs @@ -240,7 +240,7 @@ module Ast = | SynPat.Attrib(pattern, _, _) | SynPat.Paren(pattern, _) -> add <| Pattern pattern | SynPat.Named(_) -> () - | SynPat.Record(patternsAndIdentifier, _) -> List.revIter (fun (_, _, pattern) -> pattern |> Pattern |> add) patternsAndIdentifier + | SynPat.Record(patPairFieldList, _) -> patPairFieldList |> List.revIter(_.Pattern >> Pattern >> add) | SynPat.Const(_) | SynPat.Wild(_) | SynPat.FromParseError(_) @@ -306,13 +306,6 @@ module Ast = | SynExpr.DotNamedIndexedPropertySet(expression, _, expression1, expression2, _) | SynExpr.For(_, _, _, _, expression, _, expression1, expression2, _) -> addMany [Expression expression2; Expression expression1; Expression expression] - | SynExpr.LetOrUseBang(_, _, _, pattern, rightHandSide, andBangs, leftHandSide, _, _) -> - addMany [Expression rightHandSide; Expression leftHandSide] - // TODO: is the the correct way to handle the new `and!` syntax? - List.iter (fun (SynExprAndBang(_, _, _, pattern, body, _, _)) -> - addMany [Expression body; Pattern pattern] - ) andBangs - add <| Pattern pattern | SynExpr.ForEach(_, _, _, _, pattern, expression, expression1, _) -> addMany [Expression expression1; Expression expression; Pattern pattern] | SynExpr.MatchLambda(_, _, matchClauses, _, _) -> @@ -330,9 +323,22 @@ module Ast = | SynExpr.Upcast(expression, synType, _) | SynExpr.Downcast(expression, synType, _) -> addMany [Type synType; Expression expression] - | SynExpr.LetOrUse(_, _, bindings, expression, _, _) -> + // regular let or use + | SynExpr.LetOrUse(_, _, _, false, bindings, expression, _, _) -> add <| Expression expression List.revIter (Binding >> add) bindings + // let! or use! + | SynExpr.LetOrUse(_, _, _, true, bindings, leftHandSide, _, _) -> + match bindings with + | firstBinding :: andBangs -> + match firstBinding with + | SynBinding(headPat = pattern; expr = rightHandSide) -> + addMany [Expression rightHandSide; Expression leftHandSide] + List.iter (fun (SynBinding(headPat = pattern; expr = body)) -> + addMany [Expression body; Pattern pattern] + ) andBangs + add <| Pattern pattern + | [] -> () // error case. @@TODO@@ any other handling needed here? | SynExpr.Ident(ident) -> add <| Identifier([ident.idText], ident.idRange) | SynExpr.LongIdent(_, SynLongIdent(ident, _, _), _, range) -> add <| Identifier(List.map (fun (identifier: Ident) -> identifier.idText) ident, range) @@ -417,7 +423,7 @@ module Ast = | SynArgPats.Pats(patterns) -> patterns |> List.revIter (Pattern >> add) | SynArgPats.NamePatPairs(namePatterns, _, _) -> - namePatterns |> List.revIter (fun (_, _, pattern) -> pattern |> Pattern |> add) + namePatterns |> List.revIter (_.Pattern >> Pattern >> add) let inline private typeRepresentationChildren node add = match node with @@ -474,7 +480,7 @@ module Ast = | Else(expression) | Expression(expression) -> expressionChildren expression add - | File(ParsedInput.ImplFile(ParsedImplFileInput(_, _, _, _, _, moduleOrNamespaces, _, _, _))) -> + | File(ParsedInput.ImplFile(ParsedImplFileInput(contents = moduleOrNamespaces))) -> moduleOrNamespaces |> List.revIter (ModuleOrNamespace >> add) | UnionCase(unionCase) -> unionCaseChildren unionCase add diff --git a/src/FSharpLint.Core/Rules/Conventions/Binding/BindingHelper.fs b/src/FSharpLint.Core/Rules/Conventions/Binding/BindingHelper.fs index dd9ec7ced..a13851689 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Binding/BindingHelper.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Binding/BindingHelper.fs @@ -8,6 +8,6 @@ let isLetBinding index (syntaxArray:AbstractSyntaxArray.Node []) = if index > 0 then match syntaxArray.[syntaxArray.[index].ParentIndex].Actual with | AstNode.ModuleDeclaration(SynModuleDecl.Let(_)) - | AstNode.Expression(SynExpr.LetOrUse(_, false, _, _, _, _)) -> true + | AstNode.Expression(SynExpr.LetOrUse(_, false, _, false, _, _, _, _)) -> true | _ -> false else false diff --git a/src/FSharpLint.Core/Rules/Conventions/Binding/FavourIgnoreOverLetWild.fs b/src/FSharpLint.Core/Rules/Conventions/Binding/FavourIgnoreOverLetWild.fs index 60aed9942..f0b00f777 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Binding/FavourIgnoreOverLetWild.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Binding/FavourIgnoreOverLetWild.fs @@ -33,7 +33,7 @@ let private runner (args:AstNodeRuleParams) = let bindingRange = match args.GetParents(args.NodeIndex) with | AstNode.ModuleDeclaration(SynModuleDecl.Let(_, _, range)) :: _ - | AstNode.Expression(SynExpr.LetOrUse(_, false, _, _, range, _)) :: _ -> + | AstNode.Expression(SynExpr.LetOrUse(_, false, _, false, _, _, range, _)) :: _ -> Some(range) | _ -> None diff --git a/src/FSharpLint.Core/Rules/Conventions/Binding/UselessBinding.fs b/src/FSharpLint.Core/Rules/Conventions/Binding/UselessBinding.fs index b878850f8..d3333e69f 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Binding/UselessBinding.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Binding/UselessBinding.fs @@ -53,7 +53,7 @@ let private runner (args:AstNodeRuleParams) = match args.GetParents(args.NodeIndex) with | AstNode.ModuleDeclaration(SynModuleDecl.Let(_, _, range)) :: _ -> Some({ FromRange = range; FromText = "let"; ToText = String.Empty }) - | AstNode.Expression(SynExpr.LetOrUse(_, false, _, _, range, _)) :: _ -> + | AstNode.Expression(SynExpr.LetOrUse(_, false, _, false, _, _, range, _)) :: _ -> Some({ FromRange = range; FromText = "use"; ToText = String.Empty }) | _ -> None match args.AstNode with diff --git a/src/FSharpLint.Core/Rules/Conventions/FavourNonMutablePropertyInitialization.fs b/src/FSharpLint.Core/Rules/Conventions/FavourNonMutablePropertyInitialization.fs index 47a601cf8..e2962ad31 100644 --- a/src/FSharpLint.Core/Rules/Conventions/FavourNonMutablePropertyInitialization.fs +++ b/src/FSharpLint.Core/Rules/Conventions/FavourNonMutablePropertyInitialization.fs @@ -64,7 +64,7 @@ let rec private processLetBinding (instanceNames: Set) (body: SynExpr) ( and [] processExpression (expression: SynExpr) (continuation: unit -> array) : array = Array.append (match expression with - | SynExpr.LetOrUse(_, _, bindings, body, _, _) -> + | SynExpr.LetOrUse(_, _, _, false, bindings, body, _, _) -> let instanceNames = extraFromBindings bindings List.Empty |> Set.ofList processLetBinding instanceNames body returnEmptyArray | SynExpr.Sequential(_, _, expr1, expr2, _, _) -> @@ -74,7 +74,7 @@ and [] processExpression (expression: SynExpr) (continuation: unit -> let runner args = match args.AstNode with - | Binding(SynBinding(_, _, _, _, _, _, _, _, _, SynExpr.LetOrUse(_, _, bindings, body, _, _), _, _, _)) -> + | Binding(SynBinding(_, _, _, _, _, _, _, _, _, SynExpr.LetOrUse(_, _, _, false, bindings, body, _, _), _, _, _)) -> let instanceNames = extraFromBindings bindings List.Empty |> Set.ofList processLetBinding instanceNames body returnEmptyArray | Match(SynMatchClause(_, _, expr, _, _, _)) -> diff --git a/src/FSharpLint.Core/Rules/Conventions/FavourStaticEmptyFields.fs b/src/FSharpLint.Core/Rules/Conventions/FavourStaticEmptyFields.fs index 0bab96baf..fe119778d 100644 --- a/src/FSharpLint.Core/Rules/Conventions/FavourStaticEmptyFields.fs +++ b/src/FSharpLint.Core/Rules/Conventions/FavourStaticEmptyFields.fs @@ -75,7 +75,7 @@ let rec private processExpressions (errorsSoFar: array) (args: A | SynExpr.Record(_, _, synExprRecordFields, _) :: tail -> let mapping = function - | SynExprRecordField(_, _, expr, _) -> expr + | SynExprRecordField(_, _, expr, _, _) -> expr let fieldExpressions = synExprRecordFields |> List.choose mapping diff --git a/src/FSharpLint.Core/Rules/Conventions/Naming/AvoidTooShortNames.fs b/src/FSharpLint.Core/Rules/Conventions/Naming/AvoidTooShortNames.fs index 11f8574f2..fcfd308da 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Naming/AvoidTooShortNames.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Naming/AvoidTooShortNames.fs @@ -58,8 +58,10 @@ let runner (args:AstNodeRuleParams) = let identifiers = match args.AstNode with - | AstNode.Expression(SynExpr.LetOrUseBang(_, _, _, pat, _, _, _, _, _)) -> - getParameterWithBelowMinimumLength [pat] + | AstNode.Expression(SynExpr.LetOrUse(isBang = true; bindings = binding :: _)) -> + match binding with + | SynBinding(headPat = pat) -> + getParameterWithBelowMinimumLength [pat] | AstNode.Expression(SynExpr.Lambda(_, _, lambdaArgs, _, _, _, _)) -> let lambdaIdent = FunctionReimplementation.getLambdaParamIdent lambdaArgs match lambdaIdent with diff --git a/src/FSharpLint.Core/Rules/Conventions/RecursiveAsyncFunction.fs b/src/FSharpLint.Core/Rules/Conventions/RecursiveAsyncFunction.fs index 834ba4ac0..10c2268a8 100644 --- a/src/FSharpLint.Core/Rules/Conventions/RecursiveAsyncFunction.fs +++ b/src/FSharpLint.Core/Rules/Conventions/RecursiveAsyncFunction.fs @@ -58,7 +58,7 @@ let checkRecursiveAsyncFunction (args:AstNodeRuleParams) (range:Range) (doBangEx match crumb with | AstNode.ModuleDeclaration (SynModuleDecl.Let (true, bindings, _)) -> bindings - | AstNode.Expression (SynExpr.LetOrUse (true, false, bindings, _, _, _)) -> + | AstNode.Expression (SynExpr.LetOrUse (true, false, _, false, bindings, _, _, _)) -> bindings | _ -> List.Empty) |> List.choose getFunctionNameFromAsyncCompExprBinding diff --git a/src/FSharpLint.Core/Rules/Formatting/Typography/Indentation.fs b/src/FSharpLint.Core/Rules/Formatting/Typography/Indentation.fs index c98b50eb5..e110a4492 100644 --- a/src/FSharpLint.Core/Rules/Formatting/Typography/Indentation.fs +++ b/src/FSharpLint.Core/Rules/Formatting/Typography/Indentation.fs @@ -45,7 +45,7 @@ module ContextBuilder = | (SynExpr.Record (_, _, fields, _)) -> let newAcc = fields :: acc fields - |> List.fold (fun currentAcc (SynExprRecordField(_, _, exprOpt, _)) -> + |> List.fold (fun currentAcc (SynExprRecordField(_, _, exprOpt, _, _)) -> match exprOpt with | Some expr -> collectRecordFieldsInner currentAcc expr | None -> currentAcc @@ -84,7 +84,7 @@ module ContextBuilder = collectRecordFields record |> List.collect (fun recordFields -> recordFields - |> List.map (fun (SynExprRecordField((fieldName, _), _, _, _)) -> fieldName.Range) + |> List.map (fun (SynExprRecordField((fieldName, _), _, _, _, _)) -> fieldName.Range) |> firstRangePerLine |> createAbsoluteAndOffsetOverridesBasedOnFirst) | Expression (SynExpr.ArrayOrListComputed(expr=(SynExpr.ComputationExpr(expr=expr)))) -> @@ -131,7 +131,14 @@ module ContextBuilder = |> createAbsoluteAndOffsetOverridesBasedOnFirst | Pattern (SynPat.Record (fieldPats=fieldPats)) -> fieldPats - |> List.map (fun ((_, fieldIdent), _, _) -> fieldIdent.idRange) + |> List.map (fun patPairField -> patPairField.Range) + // @@TODO@@ Do we need to look at the ranges inside FieldName here? + //let fieldIdent = + // match patPairField.FieldName.LongIdent with + // | [id] -> id + // | lid -> List.last lid + // + //fieldIdent.idRange) |> firstRangePerLine |> createAbsoluteAndOffsetOverridesBasedOnFirst | _ -> List.Empty diff --git a/src/FSharpLint.Core/Rules/NamingHelper.fs b/src/FSharpLint.Core/Rules/NamingHelper.fs index baf8f215d..a6c02fdf4 100644 --- a/src/FSharpLint.Core/Rules/NamingHelper.fs +++ b/src/FSharpLint.Core/Rules/NamingHelper.fs @@ -404,7 +404,7 @@ let rec private innerGetPatternIdents<'Item> (accessibility:AccessControlLevel) idents (match args with | SynArgPats.NamePatPairs(pats, _, _) -> - innerGetAllPatternIdents AccessControlLevel.Private getIdents (pats |> List.map (fun(_, _, synPat) -> synPat)) + innerGetAllPatternIdents AccessControlLevel.Private getIdents (pats |> List.map _.Pattern) | SynArgPats.Pats(pats) -> innerGetAllPatternIdents AccessControlLevel.Private getIdents pats) | SynPat.Named(_, _, access, _) -> diff --git a/src/FSharpLint.Core/Rules/Smells/AsyncExceptionWithoutReturn.fs b/src/FSharpLint.Core/Rules/Smells/AsyncExceptionWithoutReturn.fs index 688083df3..ebff1db0e 100644 --- a/src/FSharpLint.Core/Rules/Smells/AsyncExceptionWithoutReturn.fs +++ b/src/FSharpLint.Core/Rules/Smells/AsyncExceptionWithoutReturn.fs @@ -55,7 +55,7 @@ let rec checkExpression (expression: SynExpr) (range: range) (continuation: unit } | SynExpr.App (_, _, funcExpr, _, innerRange) -> checkExpression funcExpr innerRange returnEmptyArray - | SynExpr.LetOrUse (_, _, _, body, innerRange, _) -> + | SynExpr.LetOrUse (_, _, _, false, _, body, innerRange, _) -> checkExpression body innerRange returnEmptyArray | _ -> Array.empty) (continuation ()) diff --git a/tests/FSharpLint.Core.Tests/Framework/TestAbstractSyntaxArray.fs b/tests/FSharpLint.Core.Tests/Framework/TestAbstractSyntaxArray.fs index 4772314f3..09a67417a 100644 --- a/tests/FSharpLint.Core.Tests/Framework/TestAbstractSyntaxArray.fs +++ b/tests/FSharpLint.Core.Tests/Framework/TestAbstractSyntaxArray.fs @@ -26,7 +26,7 @@ type TestAst() = match ast with | ParsedInput.ImplFile(implFile) -> match implFile with - | ParsedImplFileInput(_, _, _, _, _, Module(app)::_, _, _, _) -> + | ParsedImplFileInput(_, _, _, _, Module(app)::_, _, _, _) -> app | _ -> failwith "Expected at least one module or namespace." | _ -> failwith "Expected an implementation file." From 9cf6e598a4c2599564fd4c78a3fad99dc2a6ced8 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Sun, 19 Oct 2025 19:49:54 +0100 Subject: [PATCH 2/7] Temporarily disable lint warning about expressionChildren() being too long --- src/FSharpLint.Core/Framework/Ast.fs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/FSharpLint.Core/Framework/Ast.fs b/src/FSharpLint.Core/Framework/Ast.fs index 4c40a5d77..53354b586 100644 --- a/src/FSharpLint.Core/Framework/Ast.fs +++ b/src/FSharpLint.Core/Framework/Ast.fs @@ -259,6 +259,8 @@ module Ast = add <| Pattern lhs add <| Pattern rhs + + // fsharplint:disable FL0025 let inline private expressionChildren (node: SynExpr) (add: AstNode -> unit) = let addMany = List.iter add @@ -384,6 +386,8 @@ module Ast = expr2 |> Option.iter (Expression >> add) | _ -> () + // fsharplint:enable + let inline private typeSimpleRepresentationChildren node add = match node with | SynTypeDefnSimpleRepr.Union(_, unionCases, _) -> List.revIter (UnionCase >> add) unionCases From 91baf8f3d308ad031ba88f074f942faab18f7efe Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Mon, 5 Jan 2026 19:49:13 +0800 Subject: [PATCH 3/7] Revert "Temporarily disable lint warning about expressionChildren() being too long" This reverts commit de27b1b3bde664fffbdb82589ed9f71b5a22a5ee. --- src/FSharpLint.Core/Framework/Ast.fs | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/FSharpLint.Core/Framework/Ast.fs b/src/FSharpLint.Core/Framework/Ast.fs index 53354b586..a0535e10d 100644 --- a/src/FSharpLint.Core/Framework/Ast.fs +++ b/src/FSharpLint.Core/Framework/Ast.fs @@ -259,8 +259,6 @@ module Ast = add <| Pattern lhs add <| Pattern rhs - - // fsharplint:disable FL0025 let inline private expressionChildren (node: SynExpr) (add: AstNode -> unit) = let addMany = List.iter add @@ -280,6 +278,8 @@ module Ast = | SynExpr.Lazy(expression, _) | SynExpr.TraitCall(_, _, expression, _) | SynExpr.YieldOrReturn(_, expression, _, _) + | SynExpr.AnonRecd(_, Some (expression, _), _, _, _) -> + | SynExpr.IndexFromEnd(expression, _) -> | SynExpr.YieldOrReturnFrom(_, expression, _, _) -> add <| Expression expression | SynExpr.SequentialOrImplicitYield(_, expression1, expression2, ifNotExpression, _) -> addMany [Expression expression1; Expression expression2; Expression ifNotExpression] @@ -291,17 +291,13 @@ module Ast = | SynExpr.While(_, expression, expression1, _) | SynExpr.TryFinally(expression, expression1, _, _, _, _) | SynExpr.Set(expression, expression1, _) - | SynExpr.DotSet(expression, _, expression1, _) -> - addMany [Expression expression1; Expression expression] + | SynExpr.DotSet(expression1, _, expression2, _) -> + addMany [Expression expression1; Expression expression2] | SynExpr.Typed(expression, synType, _) -> addMany [Type synType; Expression expression] | SynExpr.Tuple(_, expressions, _, _) | SynExpr.ArrayOrList(_, expressions, _) -> List.revIter (Expression >> add) expressions | SynExpr.Record(_, Some(expr, _), _, _) -> add <| Expression expr - | SynExpr.Record(_, None, _, _) -> () - | SynExpr.AnonRecd(_, Some (expr,_), _, _, _) -> - add <| Expression expr - | SynExpr.AnonRecd(_, None, _, _, _) -> () | SynExpr.ObjExpr(synType, _, _, bindings, _, _, _, _) -> List.revIter (Binding >> add) bindings add <| Type synType @@ -370,24 +366,22 @@ module Ast = | SynExpr.DotLambda(_) | SynExpr.App(_) | SynExpr.Fixed(_) -> () - *) + | SynExpr.Record(_, None, _, _) -> () + | SynExpr.AnonRecd(_, None, _, _, _) -> () | SynExpr.Typar(_) -> () - | SynExpr.WhileBang(_, expression, expression1, _) -> + *) + | SynExpr.WhileBang(_, expression1, expression2, _) -> add <| Expression expression1 - add <| Expression expression + add <| Expression expression2 | SynExpr.DebugPoint(_debugPoint, _, innerExpr) -> add <| Expression innerExpr | SynExpr.Dynamic(funcExpr, _, argExpr, _) -> addMany [Expression funcExpr; Expression argExpr] - | SynExpr.IndexFromEnd(expr, _) -> - add <| Expression expr | SynExpr.IndexRange(expr1, _, expr2, _, _, _) -> expr1 |> Option.iter (Expression >> add) expr2 |> Option.iter (Expression >> add) | _ -> () - // fsharplint:enable - let inline private typeSimpleRepresentationChildren node add = match node with | SynTypeDefnSimpleRepr.Union(_, unionCases, _) -> List.revIter (UnionCase >> add) unionCases From c393014aa08fbcde4e56d7d23f89e790125dc1a2 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Tue, 6 Jan 2026 19:37:42 +0000 Subject: [PATCH 4/7] Rebase onto current master, and fixz additional build errors --- src/FSharpLint.Core/Framework/Ast.fs | 8 ++++---- .../Rules/Conventions/RedundantNewKeyword.fs | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/FSharpLint.Core/Framework/Ast.fs b/src/FSharpLint.Core/Framework/Ast.fs index a0535e10d..712934a4e 100644 --- a/src/FSharpLint.Core/Framework/Ast.fs +++ b/src/FSharpLint.Core/Framework/Ast.fs @@ -278,8 +278,8 @@ module Ast = | SynExpr.Lazy(expression, _) | SynExpr.TraitCall(_, _, expression, _) | SynExpr.YieldOrReturn(_, expression, _, _) - | SynExpr.AnonRecd(_, Some (expression, _), _, _, _) -> - | SynExpr.IndexFromEnd(expression, _) -> + | SynExpr.AnonRecd(_, Some (expression, _), _, _, _) + | SynExpr.IndexFromEnd(expression, _) | SynExpr.YieldOrReturnFrom(_, expression, _, _) -> add <| Expression expression | SynExpr.SequentialOrImplicitYield(_, expression1, expression2, ifNotExpression, _) -> addMany [Expression expression1; Expression expression2; Expression ifNotExpression] @@ -291,8 +291,8 @@ module Ast = | SynExpr.While(_, expression, expression1, _) | SynExpr.TryFinally(expression, expression1, _, _, _, _) | SynExpr.Set(expression, expression1, _) - | SynExpr.DotSet(expression1, _, expression2, _) -> - addMany [Expression expression1; Expression expression2] + | SynExpr.DotSet(expression, _, expression1, _) -> + addMany [Expression expression1; Expression expression] | SynExpr.Typed(expression, synType, _) -> addMany [Type synType; Expression expression] | SynExpr.Tuple(_, expressions, _, _) diff --git a/src/FSharpLint.Core/Rules/Conventions/RedundantNewKeyword.fs b/src/FSharpLint.Core/Rules/Conventions/RedundantNewKeyword.fs index 880c1891e..bdb1ab8aa 100644 --- a/src/FSharpLint.Core/Rules/Conventions/RedundantNewKeyword.fs +++ b/src/FSharpLint.Core/Rules/Conventions/RedundantNewKeyword.fs @@ -50,8 +50,7 @@ let runner args = args.GetParents args.NodeIndex |> List.tryFind (function - | AstNode.Expression(SynExpr.LetOrUse(_, true, _, _, _, _)) -> true - | AstNode.Expression(SynExpr.LetOrUseBang(_, true, _, _, _, _, _, _, _)) -> true + | AstNode.Expression(SynExpr.LetOrUse(_, true, _, _, _, _, _, _)) -> true | _ -> false) match maybeUseBinding with | Some _binding -> From b2d3606d23f21334bdfc2d0213dfea5add48f2ec Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Wed, 21 Jan 2026 17:12:25 +0000 Subject: [PATCH 5/7] Rebase and fix build issues in new functions --- src/FSharpLint.Core/Rules/Conventions/DisallowShadowing.fs | 4 ++-- .../EnsureTailCallDiagnosticsInRecursiveFunctions.fs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FSharpLint.Core/Rules/Conventions/DisallowShadowing.fs b/src/FSharpLint.Core/Rules/Conventions/DisallowShadowing.fs index c9e86e9e7..5a211274f 100644 --- a/src/FSharpLint.Core/Rules/Conventions/DisallowShadowing.fs +++ b/src/FSharpLint.Core/Rules/Conventions/DisallowShadowing.fs @@ -27,7 +27,7 @@ let rec private processExpressions (processArgs: SynSimplePats -> bool) (expressions: list) = match expressions with - | SynExpr.LetOrUse(_, _, bindings, _, _, _) :: rest -> + | SynExpr.LetOrUse(_, _, _, false, bindings, _, _, _) :: rest -> bindings |> List.exists processBinding || processExpressions processBinding processArgs rest | SynExpr.Sequential(_, _, expr1, expr2, _, _) :: rest -> @@ -60,7 +60,7 @@ let rec private processPatterns (definitionsAndPatterns: list processPatterns ((definitions, pat) :: rest) | (definitions, SynPat.Record(fieldPats, _)) :: rest -> - processPatterns ((fieldPats |> List.map (fun (_, _, pat) -> (definitions, pat))) @ rest) + processPatterns ((fieldPats |> List.map (fun patPairField -> (definitions, patPairField.Pattern))) @ rest) | (definitions, SynPat.Tuple(_, pats, _, _)) :: rest -> processPatterns ((pats |> List.map (fun pat -> (definitions, pat))) @ rest) | (definitions, SynPat.Typed(pat, _, _)) :: rest -> diff --git a/src/FSharpLint.Core/Rules/Conventions/EnsureTailCallDiagnosticsInRecursiveFunctions.fs b/src/FSharpLint.Core/Rules/Conventions/EnsureTailCallDiagnosticsInRecursiveFunctions.fs index 3991aa7da..2a3443bd2 100644 --- a/src/FSharpLint.Core/Rules/Conventions/EnsureTailCallDiagnosticsInRecursiveFunctions.fs +++ b/src/FSharpLint.Core/Rules/Conventions/EnsureTailCallDiagnosticsInRecursiveFunctions.fs @@ -47,7 +47,7 @@ let runner (args: AstNodeRuleParams) = funcs |> List.choose (processFunction false checkInfo funcs) |> List.toArray - | AstNode.Expression(SynExpr.LetOrUse(true, _, bindings, _, _, _)), Some checkInfo -> + | AstNode.Expression(SynExpr.LetOrUse(true, _, _, false, bindings, _, _, _)), Some checkInfo -> match UnneededRecKeyword.getRecursiveFunctionsFromBindings bindings with | [] -> Array.empty | funcs -> From 3a6b1375af300305ea3c7e5bdf0db382b9a91ea6 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Tue, 10 Feb 2026 17:50:02 +0000 Subject: [PATCH 6/7] Fix build failure in SimpleAsyncComplementaryHelpers.fs --- .../Rules/Conventions/Naming/SimpleAsyncComplementaryHelpers.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FSharpLint.Core/Rules/Conventions/Naming/SimpleAsyncComplementaryHelpers.fs b/src/FSharpLint.Core/Rules/Conventions/Naming/SimpleAsyncComplementaryHelpers.fs index ee590aaa7..5cba58ccb 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Naming/SimpleAsyncComplementaryHelpers.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Naming/SimpleAsyncComplementaryHelpers.fs @@ -145,7 +145,7 @@ let runner (config: Config) (args: AstNodeRuleParams) = | SynArgPats.NamePatPairs(pairs, _, _) -> let argsList = pairs - |> List.map (fun (ident, _, _) -> ident.idRange) + |> List.map _.Range |> List.choose (fun range -> ExpressionUtilities.tryFindTextOfRange range args.FileContent) " " + String.Join(" ", argsList) | SynArgPats.Pats([ SynPat.Paren(SynPat.Const(SynConst.Unit, _), _) ]) -> From 39d9dc8a128aa9ec498c405545d2ab5b14cad766 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Tue, 10 Feb 2026 22:19:23 +0000 Subject: [PATCH 7/7] Update FSharp.Compiler.Service to 43.10.103 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 21ed30173..37dd42e9a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,9 +8,9 @@ - + - +