From 348e9f8336e0b057f47083b85db81fe95865adfb Mon Sep 17 00:00:00 2001 From: Tuomas Hietanen Date: Wed, 29 Oct 2025 09:41:40 +0000 Subject: [PATCH] Removed TODO: Anon-module check --- .../Rules/Conventions/Naming/NamingHelper.fs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs b/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs index fe8c2fc06..91a685000 100644 --- a/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs +++ b/src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs @@ -306,8 +306,12 @@ let isImplicitModule (SynModuleOrNamespace.SynModuleOrNamespace(longIdent, _, mo // Check the identifiers in the module name have no length. // Not ideal but there's no attribute in the AST indicating the module is implicit from the file name. - // TODO: does SynModuleOrNamespaceKind.AnonModule replace this check? - isModule moduleKind && longIdent |> List.forall (fun ident -> zeroLengthRange ident.idRange) + match moduleKind with + | SynModuleOrNamespaceKind.AnonModule -> true + | _ when isModule moduleKind -> + // Fallback check for older compiler versions + longIdent |> List.forall (fun ident -> zeroLengthRange ident.idRange) + | _ -> false type GetIdents<'Item> = AccessControlLevel -> SynPat -> 'Item []