From 9a4b55b75f6551b559cf88c0c6682c2185a87818 Mon Sep 17 00:00:00 2001 From: Patrick Stevens <3138005+Smaug123@users.noreply.github.com> Date: Tue, 17 Jun 2025 23:40:35 +0100 Subject: [PATCH 1/2] Expand docstring on SynModuleDecl.Types --- src/Compiler/SyntaxTree/SyntaxTree.fsi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 15c8cf4a02e..d405eacbc66 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1731,7 +1731,13 @@ type SynModuleDecl = /// An 'expr' within a module. | Expr of expr: SynExpr * range: range - /// One or more 'type' definitions within a module + /// One or more 'type' definitions within a module. + /// + /// If there is more than one SynTypeDefn in the list, this indicates a "recursive knot" of types: + /// 'type Foo ... and Bar ...', for example. + /// (By contrast, consecutively defined types which are each defined with the 'type' keyword, such as + /// 'type Foo ... type Bar ...', will appear in the syntax tree as multiple distinct Types nodes, + /// not as a single Types node with multiple definitions within.) | Types of typeDefns: SynTypeDefn list * range: range /// An 'exception' definition within a module From 0af9421903a73d09f815c682338da5f166781367 Mon Sep 17 00:00:00 2001 From: Smaug123 <3138005+Smaug123@users.noreply.github.com> Date: Wed, 18 Jun 2025 16:48:06 +0100 Subject: [PATCH 2/2] Terser comment --- src/Compiler/SyntaxTree/SyntaxTree.fsi | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index d405eacbc66..aa6f394d6c4 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1731,13 +1731,15 @@ type SynModuleDecl = /// An 'expr' within a module. | Expr of expr: SynExpr * range: range - /// One or more 'type' definitions within a module. + /// + /// A type definition group ('type T1 ... and T2 ...') or a single 'type' definition within a module. + /// /// - /// If there is more than one SynTypeDefn in the list, this indicates a "recursive knot" of types: - /// 'type Foo ... and Bar ...', for example. - /// (By contrast, consecutively defined types which are each defined with the 'type' keyword, such as - /// 'type Foo ... type Bar ...', will appear in the syntax tree as multiple distinct Types nodes, - /// not as a single Types node with multiple definitions within.) + /// + /// Consecutive 'type' keywords (e.g. type T1 ... type T2 ...) are represented individually, with + /// separate Types syntax tree nodes for each. + /// Only the 'and' keyword causes multiple types to be aggregated into a single Types node. + /// | Types of typeDefns: SynTypeDefn list * range: range /// An 'exception' definition within a module