diff --git a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md index 6cc50c2822e..9501a77ed27 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md @@ -34,6 +34,7 @@ * Fix signature generation: backtick escaping for identifiers containing backticks. ([Issue #15389](https://github.com/dotnet/fsharp/issues/15389), [PR #19586](https://github.com/dotnet/fsharp/pull/19586)) * Fix signature generation: `private` keyword placement for prefix-style type abbreviations. ([Issue #15560](https://github.com/dotnet/fsharp/issues/15560), [PR #19586](https://github.com/dotnet/fsharp/pull/19586)) * Fix signature generation: missing `[]` attribute for types without visible constructors. ([Issue #16531](https://github.com/dotnet/fsharp/issues/16531), [PR #19586](https://github.com/dotnet/fsharp/pull/19586)) +* Fix `let ... in` with explicit `in` keyword in light syntax: body is now scoped to the same line, preventing the parser from greedily capturing subsequent lines as part of the `let` body. ([Issue #7741](https://github.com/dotnet/fsharp/issues/7741), [PR #19501](https://github.com/dotnet/fsharp/pull/19501)) ### Added @@ -45,3 +46,4 @@ * Improvements in error and warning messages: new error FS3885 when `let!`/`use!` is the final expression in a computation expression; new warning FS3886 when a list literal contains a single tuple element (likely missing `;` separator); improved wording for FS0003, FS0025, FS0039, FS0072, FS0247, FS0597, FS0670, FS3082, and SRTP operator-not-in-scope hints. ([PR #19398](https://github.com/dotnet/fsharp/pull/19398)) ### Breaking Changes +* `let ... in` with explicit `in` keyword in light syntax now scopes the body to the same line, preventing the parser from greedily capturing subsequent lines. Code that relied on the old multi-line scoping behavior may need adjustment. ([Issue #7741](https://github.com/dotnet/fsharp/issues/7741), [PR #19501](https://github.com/dotnet/fsharp/pull/19501)) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index d97ef294125..161ae37eaf8 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -5,4 +5,6 @@ ### Fixed +* Fix `let ... in` with explicit `in` keyword in light syntax: body is now scoped to the same line, preventing the parser from greedily capturing subsequent lines. ([Issue #7741](https://github.com/dotnet/fsharp/issues/7741), [PR #19501](https://github.com/dotnet/fsharp/pull/19501)) + ### Changed \ No newline at end of file diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index a42dee0d4e4..0d2742ae0b0 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1810,6 +1810,7 @@ featureWarnWhenFunctionValueUsedAsInterpolatedStringArg,"Warn when a function va featureMethodOverloadsCache,"Support for caching method overload resolution results for improved compilation performance." featureImplicitDIMCoverage,"Implicit dispatch slot coverage for default interface member implementations" featurePreprocessorElif,"#elif preprocessor directive" +featureLetInBodyScoping,"Scope 'let ... in' body to the same line in sequence expressions" 3880,optsLangVersionOutOfSupport,"Language version '%s' is out of support. The last .NET SDK supporting it is available at https://dotnet.microsoft.com/en-us/download/dotnet/%s" 3881,optsUnrecognizedLanguageFeature,"Unrecognized language feature name: '%s'. Use a valid feature name such as 'NameOf' or 'StringInterpolation'." 3882,lexHashElifMustBeFirst,"#elif directive must appear as the first non-whitespace character on a line" diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 1bc31837052..9cb3a0491fd 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -108,6 +108,7 @@ type LanguageFeature = | MethodOverloadsCache | ImplicitDIMCoverage | PreprocessorElif + | LetInBodyScoping /// LanguageVersion management type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) = @@ -251,6 +252,7 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) // Put stabilized features here for F# 11.0 previews via .NET SDK preview channels LanguageFeature.WarnWhenFunctionValueUsedAsInterpolatedStringArg, languageVersion110 LanguageFeature.PreprocessorElif, languageVersion110 + LanguageFeature.LetInBodyScoping, languageVersion110 // Difference between languageVersion110 and preview - 11.0 gets turned on automatically by picking a preview .NET 11 SDK // previewVersion is only when "preview" is specified explicitly in project files and users also need a preview SDK @@ -453,6 +455,7 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) | LanguageFeature.MethodOverloadsCache -> FSComp.SR.featureMethodOverloadsCache () | LanguageFeature.ImplicitDIMCoverage -> FSComp.SR.featureImplicitDIMCoverage () | LanguageFeature.PreprocessorElif -> FSComp.SR.featurePreprocessorElif () + | LanguageFeature.LetInBodyScoping -> FSComp.SR.featureLetInBodyScoping () /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index fd6182c9d3e..9ff9268c25b 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -99,6 +99,7 @@ type LanguageFeature = | MethodOverloadsCache | ImplicitDIMCoverage | PreprocessorElif + | LetInBodyScoping /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 1ff957e77a8..d1d78a19f65 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1532,7 +1532,7 @@ type internal FsiConsoleInput /// Try to get the first line, if we snarfed it while probing. member _.TryGetFirstLine() = - let r = firstLine in + let r = firstLine firstLine <- None r diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index ed5da9fd043..dc3cb380d7d 100644 --- a/src/Compiler/SyntaxTree/LexFilter.fs +++ b/src/Compiler/SyntaxTree/LexFilter.fs @@ -1680,8 +1680,25 @@ type LexFilterImpl ( if debug then dprintf "IN at %a (becomes %s)\n" outputPos tokenStartPos (if blockLet then "ODECLEND" else "IN") if tokenStartCol < offsidePos.Column then warn tokenTup (FSComp.SR.lexfltIncorrentIndentationOfIn()) popCtxt() - // Make sure we queue a dummy token at this position to check if any other pop rules apply - delayToken(pool.UseLocation(tokenTup, ODUMMY token)) + + if blockLet && lexbuf.SupportsFeature LanguageFeature.LetInBodyScoping then + let nextTokenTup = peekNextTokenTup() + let nextTokenStartPos = startPosOfTokenTup nextTokenTup + + if nextTokenStartPos.Line = tokenStartPos.Line then + // When the body expression starts on the same line as the 'in' keyword in light syntax, + // push a new seq block anchored at the body's start column. Offside rules then limit + // the body to the indented block starting on this line, preventing the parser from + // greedily capturing subsequent lines at lower indentation as part of the let body. + pushCtxtSeqBlock tokenTup AddBlockEnd + else + // Body starts on a new line after 'in' — the user intentionally placed the body + // on the next line, so use standard behavior. + delayToken(pool.UseLocation(tokenTup, ODUMMY token)) + else + // Make sure we queue a dummy token at this position to check if any other pop rules apply + delayToken(pool.UseLocation(tokenTup, ODUMMY token)) + returnToken tokenLexbufState (if blockLet then ODECLEND(mkSynRange tokenTup.StartPos tokenTup.EndPos, true) else token) // Balancing rule. Encountering a 'done' balances with a 'do'. i.e. even a non-offside 'done' closes a 'do' diff --git a/src/Compiler/Utilities/HashMultiMap.fs b/src/Compiler/Utilities/HashMultiMap.fs index 2688869136e..e2e0832e2fa 100644 --- a/src/Compiler/Utilities/HashMultiMap.fs +++ b/src/Compiler/Utilities/HashMultiMap.fs @@ -169,7 +169,7 @@ type internal HashMultiMap<'Key, 'Value when 'Key: not null>(size: int, comparer | _ -> false member s.Remove(k: 'Key) = - let res = s.ContainsKey(k) in + let res = s.ContainsKey(k) s.Remove(k) res diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 3db81910019..b6c2cffa0d7 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index ea40290bdab..aabe855452d 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 4ee65c31f10..986eb83a5a6 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index e32025d28c6..6a58c6f4b1e 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 6191c2ecd1a..731da9ff499 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index f388600a196..821543febed 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 399d17705f2..49444c3f10d 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 6a18542ccb3..68c57aa9274 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 7d4db3566e5..5c21cb60109 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 9739a35bb1c..4803d71b910 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 911944a991d..126f44f33f9 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index b745cb2aaef..4e3aa96cac0 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 69e43194e81..97881cfe7a8 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -1,4 +1,4 @@ - + @@ -8977,6 +8977,10 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + Scope 'let ... in' body to the same line in sequence expressions + Scope 'let ... in' body to the same line in sequence expressions + + \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WarnExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WarnExpressionTests.fs index bc68eb4d7d9..26cd56ff9fa 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WarnExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WarnExpressionTests.fs @@ -293,3 +293,85 @@ extern bool Beep(int frequency, int duration) |> asLibrary |> typecheck |> shouldSucceed + + // https://github.com/dotnet/fsharp/issues/7091 + [] + let ``Warn when let-in has multi-line sequential body in do block``() = + FSharp """ +module Test +let x = 42 +do + let x = 1 in x + 1 + x + """ + |> withLangVersionPreview + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 20, Line 5, Col 5, Line 5, Col 23, + "The result of this expression has type 'int' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.") + (Warning 20, Line 6, Col 5, Line 6, Col 6, + "The result of this expression has type 'int' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.") + ] + + // https://github.com/dotnet/fsharp/issues/7091 + [] + let ``No warning for single-line let-in``() = + FSharp """ +module Test +let result = let x = 1 in x + 1 + """ + |> withLangVersionPreview + |> typecheck + |> shouldSucceed + + // https://github.com/dotnet/fsharp/issues/7091 + [] + let ``No warning for let without in keyword``() = + FSharp """ +module Test +let x = 42 +do + let x = 1 + printfn "%d" x + """ + |> withLangVersionPreview + |> typecheck + |> shouldSucceed + + // https://github.com/dotnet/fsharp/issues/7091 + [] + let ``No warning for let-in without langversion preview``() = + FSharp """ +module Test +let x = 42 +do + let x = 1 in x + 1 + x + """ + |> withLangVersion "9.0" + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 20, Line 5, Col 18, Line 5, Col 23, + "The result of this expression has type 'int' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.") + (Warning 20, Line 5, Col 5, Line 6, Col 6, + "The result of this expression has type 'int' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.") + ] + + // https://github.com/dotnet/fsharp/issues/7091 + [] + let ``Warn when let-in extends scope in function body``() = + FSharp """ +module Test +let f () = + let x = 1 in x + 1 + printfn "hello" + """ + |> withLangVersionPreview + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 20, Line 4, Col 5, Line 4, Col 23, + "The result of this expression has type 'int' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.") + ] diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 01.fs b/tests/service/data/SyntaxTree/Expression/LetIn 01.fs new file mode 100644 index 00000000000..5437a88b512 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 01.fs @@ -0,0 +1,4 @@ +module Module + +let a = 1 in b +c diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/LetIn 01.fs.bsl new file mode 100644 index 00000000000..ab833fadfb4 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 01.fs.bsl @@ -0,0 +1,30 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/LetIn 01.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named (SynIdent (a, None), false, None, (3,4--3,5)), None, + Const (Int32 1, (3,8--3,9)), (3,4--3,5), Yes (3,0--3,9), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })] + Body = Ident b + Range = (3,0--3,14) + Trivia = { InKeyword = Some (3,10--3,12) } + IsFromSource = true }, (3,0--3,14)); + Expr (Ident c, (4,0--4,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--4,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 02.fs b/tests/service/data/SyntaxTree/Expression/LetIn 02.fs new file mode 100644 index 00000000000..b71d35687b9 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 02.fs @@ -0,0 +1,4 @@ +module Module + +let a = 1 in b; c +d diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/LetIn 02.fs.bsl new file mode 100644 index 00000000000..af081c7f0e1 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 02.fs.bsl @@ -0,0 +1,33 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/LetIn 02.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named (SynIdent (a, None), false, None, (3,4--3,5)), None, + Const (Int32 1, (3,8--3,9)), (3,4--3,5), Yes (3,0--3,9), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })] + Body = + Sequential + (SuppressNeither, true, Ident b, Ident c, (3,13--3,17), + { SeparatorRange = Some (3,14--3,15) }) + Range = (3,0--3,17) + Trivia = { InKeyword = Some (3,10--3,12) } + IsFromSource = true }, (3,0--3,17)); + Expr (Ident d, (4,0--4,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--4,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 03.fs b/tests/service/data/SyntaxTree/Expression/LetIn 03.fs new file mode 100644 index 00000000000..72a1fde1b87 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 03.fs @@ -0,0 +1,5 @@ +module Module + +do + let a = 1 in let b = 2 in c + d diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/LetIn 03.fs.bsl new file mode 100644 index 00000000000..904a483263b --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 03.fs.bsl @@ -0,0 +1,57 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/LetIn 03.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (Do + (Sequential + (SuppressNeither, true, + LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named (SynIdent (a, None), false, None, (4,8--4,9)), + None, Const (Int32 1, (4,12--4,13)), (4,8--4,9), + Yes (4,4--4,13), + { LeadingKeyword = Let (4,4--4,7) + InlineKeyword = None + EqualsRange = Some (4,10--4,11) })] + Body = + LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,17), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo + ([], SynArgInfo ([], false, None)), None), + Named + (SynIdent (b, None), false, None, + (4,21--4,22)), None, + Const (Int32 2, (4,25--4,26)), (4,21--4,22), + Yes (4,17--4,26), + { LeadingKeyword = Let (4,17--4,20) + InlineKeyword = None + EqualsRange = Some (4,23--4,24) })] + Body = Ident c + Range = (4,17--4,31) + Trivia = { InKeyword = Some (4,27--4,29) } + IsFromSource = true } + Range = (4,4--4,31) + Trivia = { InKeyword = Some (4,14--4,16) } + IsFromSource = true }, Ident d, (4,4--5,5), + { SeparatorRange = None }), (3,0--5,5)), (3,0--5,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 04.fs b/tests/service/data/SyntaxTree/Expression/LetIn 04.fs new file mode 100644 index 00000000000..8f1e1f2134d --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 04.fs @@ -0,0 +1,5 @@ +module Module + +do + let a = 1 in let b = 2 in let c = 3 in () + d diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/LetIn 04.fs.bsl new file mode 100644 index 00000000000..7604cc1b347 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 04.fs.bsl @@ -0,0 +1,80 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/LetIn 04.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (Do + (Sequential + (SuppressNeither, true, + LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named (SynIdent (a, None), false, None, (4,8--4,9)), + None, Const (Int32 1, (4,12--4,13)), (4,8--4,9), + Yes (4,4--4,13), + { LeadingKeyword = Let (4,4--4,7) + InlineKeyword = None + EqualsRange = Some (4,10--4,11) })] + Body = + LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,17), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo + ([], SynArgInfo ([], false, None)), None), + Named + (SynIdent (b, None), false, None, + (4,21--4,22)), None, + Const (Int32 2, (4,25--4,26)), (4,21--4,22), + Yes (4,17--4,26), + { LeadingKeyword = Let (4,17--4,20) + InlineKeyword = None + EqualsRange = Some (4,23--4,24) })] + Body = + LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,30), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo + ([], SynArgInfo ([], false, None)), + None), + Named + (SynIdent (c, None), false, None, + (4,34--4,35)), None, + Const (Int32 3, (4,38--4,39)), + (4,34--4,35), Yes (4,30--4,39), + { LeadingKeyword = Let (4,30--4,33) + InlineKeyword = None + EqualsRange = Some (4,36--4,37) })] + Body = Const (Unit, (4,43--4,45)) + Range = (4,30--4,45) + Trivia = { InKeyword = Some (4,40--4,42) } + IsFromSource = true } + Range = (4,17--4,45) + Trivia = { InKeyword = Some (4,27--4,29) } + IsFromSource = true } + Range = (4,4--4,45) + Trivia = { InKeyword = Some (4,14--4,16) } + IsFromSource = true }, Ident d, (4,4--5,5), + { SeparatorRange = None }), (3,0--5,5)), (3,0--5,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 05.fs b/tests/service/data/SyntaxTree/Expression/LetIn 05.fs new file mode 100644 index 00000000000..e2d60e84964 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 05.fs @@ -0,0 +1,5 @@ +module Module + +do + let a = 1 in if true then b else c + d diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/LetIn 05.fs.bsl new file mode 100644 index 00000000000..c5bb654a783 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 05.fs.bsl @@ -0,0 +1,43 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/LetIn 05.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (Do + (Sequential + (SuppressNeither, true, + LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named (SynIdent (a, None), false, None, (4,8--4,9)), + None, Const (Int32 1, (4,12--4,13)), (4,8--4,9), + Yes (4,4--4,13), + { LeadingKeyword = Let (4,4--4,7) + InlineKeyword = None + EqualsRange = Some (4,10--4,11) })] + Body = + IfThenElse + (Const (Bool true, (4,20--4,24)), Ident b, + Some (Ident c), Yes (4,17--4,29), false, + (4,17--4,38), { IfKeyword = (4,17--4,19) + IsElif = false + ThenKeyword = (4,25--4,29) + ElseKeyword = Some (4,32--4,36) + IfToThenRange = (4,17--4,29) }) + Range = (4,4--4,38) + Trivia = { InKeyword = Some (4,14--4,16) } + IsFromSource = true }, Ident d, (4,4--5,5), + { SeparatorRange = None }), (3,0--5,5)), (3,0--5,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 06.fs b/tests/service/data/SyntaxTree/Expression/LetIn 06.fs new file mode 100644 index 00000000000..5314a7c1640 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 06.fs @@ -0,0 +1,5 @@ +module Module + +do + let a = 1 in if true then b else let c = 2 in 3 + d diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/LetIn 06.fs.bsl new file mode 100644 index 00000000000..89437072c4b --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 06.fs.bsl @@ -0,0 +1,67 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/LetIn 06.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (Do + (Sequential + (SuppressNeither, true, + LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named (SynIdent (a, None), false, None, (4,8--4,9)), + None, Const (Int32 1, (4,12--4,13)), (4,8--4,9), + Yes (4,4--4,13), + { LeadingKeyword = Let (4,4--4,7) + InlineKeyword = None + EqualsRange = Some (4,10--4,11) })] + Body = + IfThenElse + (Const (Bool true, (4,20--4,24)), Ident b, + Some + (LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,37), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo + ([], SynArgInfo ([], false, None)), + None), + Named + (SynIdent (c, None), false, None, + (4,41--4,42)), None, + Const (Int32 2, (4,45--4,46)), + (4,41--4,42), Yes (4,37--4,46), + { LeadingKeyword = Let (4,37--4,40) + InlineKeyword = None + EqualsRange = Some (4,43--4,44) })] + Body = Const (Int32 3, (4,50--4,51)) + Range = (4,37--4,51) + Trivia = { InKeyword = Some (4,47--4,49) } + IsFromSource = true }), Yes (4,17--4,29), + false, (4,17--4,51), + { IfKeyword = (4,17--4,19) + IsElif = false + ThenKeyword = (4,25--4,29) + ElseKeyword = Some (4,32--4,36) + IfToThenRange = (4,17--4,29) }) + Range = (4,4--4,51) + Trivia = { InKeyword = Some (4,14--4,16) } + IsFromSource = true }, Ident d, (4,4--5,5), + { SeparatorRange = None }), (3,0--5,5)), (3,0--5,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 07.fs b/tests/service/data/SyntaxTree/Expression/LetIn 07.fs new file mode 100644 index 00000000000..8b63d0e3adf --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 07.fs @@ -0,0 +1,3 @@ +module Module + +let x = 1 in () diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/LetIn 07.fs.bsl new file mode 100644 index 00000000000..f3738aa319c --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 07.fs.bsl @@ -0,0 +1,29 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/LetIn 07.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named (SynIdent (x, None), false, None, (3,4--3,5)), None, + Const (Int32 1, (3,8--3,9)), (3,4--3,5), Yes (3,0--3,9), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })] + Body = Const (Unit, (3,13--3,15)) + Range = (3,0--3,15) + Trivia = { InKeyword = Some (3,10--3,12) } + IsFromSource = true }, (3,0--3,15))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 08.fs b/tests/service/data/SyntaxTree/Expression/LetIn 08.fs new file mode 100644 index 00000000000..7c9a018cba3 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 08.fs @@ -0,0 +1,6 @@ +module Module + +let x = 42 +do + let x = 1 in x + 1 + x diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 08.fs.bsl b/tests/service/data/SyntaxTree/Expression/LetIn 08.fs.bsl new file mode 100644 index 00000000000..f064242d20f --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 08.fs.bsl @@ -0,0 +1,59 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/LetIn 08.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Named (SynIdent (x, None), false, None, (3,4--3,5)), None, + Const (Int32 42, (3,8--3,10)), (3,4--3,5), Yes (3,0--3,10), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--3,10), + { InKeyword = None }); + Expr + (Do + (Sequential + (SuppressNeither, true, + LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named (SynIdent (x, None), false, None, (5,8--5,9)), + None, Const (Int32 1, (5,12--5,13)), (5,8--5,9), + Yes (5,4--5,13), + { LeadingKeyword = Let (5,4--5,7) + InlineKeyword = None + EqualsRange = Some (5,10--5,11) })] + Body = + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,19--5,20)), Ident x, (5,17--5,20)), + Const (Int32 1, (5,21--5,22)), (5,17--5,22)) + Range = (5,4--5,22) + Trivia = { InKeyword = Some (5,14--5,16) } + IsFromSource = true }, Ident x, (5,4--6,5), + { SeparatorRange = None }), (4,0--6,5)), (4,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 09.fs b/tests/service/data/SyntaxTree/Expression/LetIn 09.fs new file mode 100644 index 00000000000..94b4bdcaa78 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 09.fs @@ -0,0 +1,5 @@ +module Module + +let f () = + let x = 1 in x + 1 + printfn "hello" diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 09.fs.bsl b/tests/service/data/SyntaxTree/Expression/LetIn 09.fs.bsl new file mode 100644 index 00000000000..4760f1bf4de --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 09.fs.bsl @@ -0,0 +1,64 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/LetIn 09.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([[]], SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent ([f], [], [None]), None, None, + Pats [Paren (Const (Unit, (3,6--3,8)), (3,6--3,8))], None, + (3,4--3,8)), None, + Sequential + (SuppressNeither, true, + LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named + (SynIdent (x, None), false, None, (4,8--4,9)), + None, Const (Int32 1, (4,12--4,13)), (4,8--4,9), + Yes (4,4--4,13), + { LeadingKeyword = Let (4,4--4,7) + InlineKeyword = None + EqualsRange = Some (4,10--4,11) })] + Body = + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (4,19--4,20)), Ident x, (4,17--4,20)), + Const (Int32 1, (4,21--4,22)), (4,17--4,22)) + Range = (4,4--4,22) + Trivia = { InKeyword = Some (4,14--4,16) } + IsFromSource = true }, + App + (NonAtomic, false, Ident printfn, + Const + (String ("hello", Regular, (5,12--5,19)), (5,12--5,19)), + (5,4--5,19)), (4,4--5,19), { SeparatorRange = None }), + (3,4--3,8), NoneAtLet, { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,9--3,10) })], + (3,0--5,19), { InKeyword = None })], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 10.fs b/tests/service/data/SyntaxTree/Expression/LetIn 10.fs new file mode 100644 index 00000000000..0e6895f4b6a --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 10.fs @@ -0,0 +1,5 @@ +module Module + +let a = 1 in b + c +d diff --git a/tests/service/data/SyntaxTree/Expression/LetIn 10.fs.bsl b/tests/service/data/SyntaxTree/Expression/LetIn 10.fs.bsl new file mode 100644 index 00000000000..3e2bff89305 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/LetIn 10.fs.bsl @@ -0,0 +1,33 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/LetIn 10.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (LetOrUse + { IsRecursive = false + Bindings = + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named (SynIdent (a, None), false, None, (3,4--3,5)), None, + Const (Int32 1, (3,8--3,9)), (3,4--3,5), Yes (3,0--3,9), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })] + Body = + Sequential + (SuppressNeither, true, Ident b, Ident c, (3,13--4,14), + { SeparatorRange = None }) + Range = (3,0--4,14) + Trivia = { InKeyword = Some (3,10--3,12) } + IsFromSource = true }, (3,0--4,14)); + Expr (Ident d, (5,0--5,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl index 4fb6595cbd2..b65ca5c4e11 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl @@ -23,7 +23,7 @@ ImplFile Range = (2,0--2,15) Trivia = { InKeyword = Some (2,10--2,12) } IsFromSource = true }, (2,0--2,15))], PreXmlDocEmpty, [], None, - (2,0--2,15), { LeadingKeyword = None })], (true, true), + (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs index 7901df88801..eb5a2de9f5b 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs @@ -2724,10 +2724,10 @@ module Patterns = let sb = StringBuilder() for original, expected in pairs -> - (let original = string (SynPat.fmt sb original) in + (let original = string (SynPat.fmt sb original) ignore <| sb.Clear() original), - (let expected = string (SynPat.fmt sb expected) in + (let expected = string (SynPat.fmt sb expected) ignore <| sb.Clear() expected) }