diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index b4df947561a..d46e19ed005 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -7,7 +7,7 @@ * Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Fix parsing errors using anonymous records and code quotations ([PR #18603](https://github.com/dotnet/fsharp/pull/18603)) * Fixed: Allow `return`, `return!`, `yield`, `yield!` type annotations without parentheses ([PR #18533](https://github.com/dotnet/fsharp/pull/18533)) -* Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) +* Allow `let!`, `use!`, `and!` type annotations without requiring parentheses (([PR #18508](https://github.com/dotnet/fsharp/pull/18508) and [PR #18682](https://github.com/dotnet/fsharp/pull/18682))) * Fix find all references for F# exceptions ([PR #18565](https://github.com/dotnet/fsharp/pull/18565)) * Shorthand lambda: fix completion for chained calls and analysis for unfinished expression ([PR #18560](https://github.com/dotnet/fsharp/pull/18560)) * Completion: fix previous namespace considered opened [PR #18609](https://github.com/dotnet/fsharp/pull/18609) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 687402597c5..0ba66727cd1 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -8,7 +8,7 @@ * Warn when `unit` is passed to an `obj`-typed argument ([PR #18330](https://github.com/dotnet/fsharp/pull/18330)) * Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Scoped Nowarn: added the #warnon compiler directive ([Language suggestion #278](https://github.com/fsharp/fslang-suggestions/issues/278), [RFC FS-1146 PR](https://github.com/fsharp/fslang-design/pull/782), [PR #18049](https://github.com/dotnet/fsharp/pull/18049)) -* Allow `let!` and `use!` type annotations without requiring parentheses. ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) +* Allow `let!`, `use!`, `and!` type annotations without requiring parentheses (([PR #18508](https://github.com/dotnet/fsharp/pull/18508) and [PR #18682](https://github.com/dotnet/fsharp/pull/18682))) ### Fixed diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index 0d2404c5b1a..00b992a6f92 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -1794,7 +1794,7 @@ let rec TryTranslateComputationExpression ceenv.cenv.g.langVersion.SupportsFeature LanguageFeature.UseBangBindingValueDiscard let supportsTypedLetOrUseBang = - ceenv.cenv.g.langVersion.SupportsFeature LanguageFeature.AllowTypedLetOrUseBang + ceenv.cenv.g.langVersion.SupportsFeature LanguageFeature.AllowTypedLetUseAndBang // use! x = ... // use! (x) = ... diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 246ec741d67..33b01d48ce6 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -102,7 +102,7 @@ type LanguageFeature = | UseBangBindingValueDiscard | BetterAnonymousRecordParsing | ScopedNowarn - | AllowTypedLetOrUseBang + | AllowTypedLetUseAndBang /// LanguageVersion management type LanguageVersion(versionText) = @@ -236,7 +236,7 @@ type LanguageVersion(versionText) = LanguageFeature.UseBangBindingValueDiscard, previewVersion LanguageFeature.BetterAnonymousRecordParsing, previewVersion LanguageFeature.ScopedNowarn, previewVersion - LanguageFeature.AllowTypedLetOrUseBang, previewVersion + LanguageFeature.AllowTypedLetUseAndBang, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -402,7 +402,7 @@ type LanguageVersion(versionText) = | LanguageFeature.UseBangBindingValueDiscard -> FSComp.SR.featureUseBangBindingValueDiscard () | LanguageFeature.BetterAnonymousRecordParsing -> FSComp.SR.featureBetterAnonymousRecordParsing () | LanguageFeature.ScopedNowarn -> FSComp.SR.featureScopedNowarn () - | LanguageFeature.AllowTypedLetOrUseBang -> FSComp.SR.featureAllowLetOrUseBangTypeAnnotationWithoutParens () + | LanguageFeature.AllowTypedLetUseAndBang -> FSComp.SR.featureAllowLetOrUseBangTypeAnnotationWithoutParens () /// 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 c9e70ce1567..f034979a6d3 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -93,7 +93,7 @@ type LanguageFeature = | UseBangBindingValueDiscard | BetterAnonymousRecordParsing | ScopedNowarn - | AllowTypedLetOrUseBang + | AllowTypedLetUseAndBang /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index f4c291ce262..ba9d638d887 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -4107,6 +4107,22 @@ moreBinders: let trivia = { AndBangKeyword = rhs parseState 1; EqualsRange = mEquals; InKeyword = Some mIn } SynExprAndBang(spBind, $1, true, $2, $4, m, trivia) :: $6 } + | AND_BANG headBindingPattern opt_topReturnTypeWithTypeConstraints EQUALS typedSequentialExprBlock IN moreBinders %prec expr_let + { // Handle type annotations on patterns in and! bindings + // Example: and! y: string = asyncString() + let spBind = DebugPointAtBinding.Yes(rhs2 parseState 1 6) + let pat = + match $3 with + | None -> $2 + | Some (_, SynReturnInfo((ty, _), _)) -> + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetUseAndBang ty.Range + SynPat.Typed($2, ty, unionRanges $2.Range ty.Range) + let mEquals = rhs parseState 4 + let m = unionRanges (rhs parseState 1) $5.Range + let mIn = rhs parseState 6 + let trivia = { AndBangKeyword = rhs parseState 1; EqualsRange = mEquals; InKeyword = Some mIn } + SynExprAndBang(spBind, false, true, pat, $5, m, trivia) :: $7 } + | OAND_BANG headBindingPattern EQUALS typedSequentialExprBlock hardwhiteDefnBindingsTerminator opt_OBLOCKSEP moreBinders %prec expr_let { let report, mIn, _ = $5 report "and!" (rhs parseState 1) // report unterminated error @@ -4116,6 +4132,22 @@ moreBinders: let trivia = { AndBangKeyword = rhs parseState 1; EqualsRange = mEquals; InKeyword = mIn } SynExprAndBang(spBind, $1, true, $2, $4, m, trivia) :: $7 } + | OAND_BANG headBindingPattern opt_topReturnTypeWithTypeConstraints EQUALS typedSequentialExprBlock hardwhiteDefnBindingsTerminator opt_OBLOCKSEP moreBinders %prec expr_let + { // Handle type annotations on patterns in and! bindings (offside-sensitive version) + let report, mIn, _ = $6 + report "and!" (rhs parseState 1) // report unterminated error + let spBind = DebugPointAtBinding.Yes(unionRanges (rhs parseState 1) $5.Range) + let pat = + match $3 with + | None -> $2 + | Some (_, SynReturnInfo((ty, _), _)) -> + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetUseAndBang ty.Range + SynPat.Typed($2, ty, unionRanges $2.Range ty.Range) + let mEquals = rhs parseState 4 + let m = unionRanges (rhs parseState 1) $5.Range + let trivia = { AndBangKeyword = rhs parseState 1; EqualsRange = mEquals; InKeyword = mIn } + SynExprAndBang(spBind, false, true, pat, $5, m, trivia) :: $8 } + | %prec prec_no_more_attr_bindings { [] } @@ -4429,7 +4461,7 @@ declExpr: | YIELD declExpr COLON typ { let trivia: SynExprYieldOrReturnTrivia = { YieldOrReturnKeyword = rhs parseState 1 } let typedExpr = SynExpr.Typed($2, $4, unionRanges $2.Range $4.Range) - parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang typedExpr.Range + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetUseAndBang typedExpr.Range SynExpr.YieldOrReturn(($1, not $1), typedExpr, (unionRanges (rhs parseState 1) $4.Range), trivia) } | YIELD declExpr opt_topReturnTypeWithTypeConstraints @@ -4439,7 +4471,7 @@ declExpr: | None -> $2 | Some(_, SynReturnInfo((ty, _), m)) -> let m = unionRanges $2.Range m - parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang m + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetUseAndBang m SynExpr.Typed($2, ty, m) SynExpr.YieldOrReturn(($1, not $1), expr, (unionRanges (rhs parseState 1) expr.Range), trivia) } @@ -4456,7 +4488,7 @@ declExpr: | YIELD_BANG declExpr COLON typ { let trivia: SynExprYieldOrReturnFromTrivia = { YieldOrReturnFromKeyword = rhs parseState 1 } let typedExpr = SynExpr.Typed($2, $4, unionRanges $2.Range $4.Range) - parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang typedExpr.Range + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetUseAndBang typedExpr.Range SynExpr.YieldOrReturnFrom(($1, not $1), typedExpr, (unionRanges (rhs parseState 1) $2.Range), trivia) } | YIELD_BANG declExpr opt_topReturnTypeWithTypeConstraints @@ -4466,7 +4498,7 @@ declExpr: | None -> $2 | Some(_, SynReturnInfo((ty, _), m)) -> let m = unionRanges $2.Range m - parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang m + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetUseAndBang m SynExpr.Typed($2, ty, m) SynExpr.YieldOrReturnFrom(($1, not $1), expr, (unionRanges (rhs parseState 1) $2.Range), trivia) } @@ -4502,7 +4534,7 @@ declExpr: | None -> $2 | Some (_, SynReturnInfo((ty, _), _)) -> SynPat.Typed($2, ty, unionRanges $2.Range ty.Range) - parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang pat.Range + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetUseAndBang pat.Range let mEquals = rhs parseState 4 let m = unionRanges (rhs parseState 1) $9.Range let trivia: SynExprLetOrUseBangTrivia = { LetOrUseBangKeyword = rhs parseState 1 ; EqualsRange = Some mEquals } @@ -4519,7 +4551,7 @@ declExpr: | None -> $2 | Some (_, SynReturnInfo((ty, _), _)) -> SynPat.Typed($2, ty, unionRanges $2.Range ty.Range) - parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang pat.Range + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetUseAndBang pat.Range let mEquals = rhs parseState 4 let m = unionRanges (rhs parseState 1) $9.Range let trivia: SynExprLetOrUseBangTrivia = { LetOrUseBangKeyword = rhs parseState 1 ; EqualsRange = Some mEquals } diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs index da918ffc00a..04ef2492fc3 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs @@ -1521,4 +1521,122 @@ let fooTask () : Task = task { is not compatible with type 'TaskCode' ") - ] \ No newline at end of file + ] + + [] + let ``Version 9.0: and! with type annotations requires parentheses`` () = + FSharp """ +module Test + +type ParallelBuilder() = + member _.Return(x) = async { return x } + member _.ReturnFrom(computation: Async<'T>) = computation + member _.Bind(computation: Async<'T>, binder: 'T -> Async<'U>) = + async { + let! x = computation + return! binder x + } + member _.Bind2(comp1: Async<'T1>, comp2: Async<'T2>, binder: 'T1 * 'T2 -> Async<'U>) = + async { + let! task1 = Async.StartChild comp1 + let! task2 = Async.StartChild comp2 + let! result1 = task1 + let! result2 = task2 + return! binder (result1, result2) + } + + member _.Zero() = async.Zero() + member _.Combine(comp1, comp2) = async.Combine(comp1, comp2) + member _.Delay(f) = async.Delay(f) + +let parallelCE = ParallelBuilder() + +let testParallel() = + parallelCE { + let! x = async { return 1 } + and! y = async { return 2 } + return x + y + } + +let testParallel2() = + parallelCE { + let! (x: int) = async { return 1 } + and! (y: int) = async { return 2 } + return x + y + } + +let testParallel3() = + parallelCE { + let! x: int = async { return 1 } + and! y: int = async { return 2 } + return x + y + } + """ + |> withLangVersion90 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 44, Col 17, Line 44, Col 20, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater."); + (Error 3350, Line 43, Col 14, Line 43, Col 20, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview: and! with type annotations works without parentheses`` () = + FSharp """ +module Test + +type ParallelBuilder() = + member _.Return(x) = async { return x } + member _.ReturnFrom(computation: Async<'T>) = computation + member _.Bind(computation: Async<'T>, binder: 'T -> Async<'U>) = + async { + let! x = computation + return! binder x + } + member _.Bind2(comp1: Async<'T1>, comp2: Async<'T2>, binder: 'T1 * 'T2 -> Async<'U>) = + async { + let! task1 = Async.StartChild comp1 + let! task2 = Async.StartChild comp2 + let! result1 = task1 + let! result2 = task2 + return! binder (result1, result2) + } + + member _.Zero() = async.Zero() + member _.Combine(comp1, comp2) = async.Combine(comp1, comp2) + member _.Delay(f) = async.Delay(f) + +let parallelCE = ParallelBuilder() + +let testParallel() = + parallelCE { + let! x = async { return 1 } + and! y = async { return 2 } + return x + y + } + +let testParallel2() = + parallelCE { + let! (x: int) = async { return 1 } + and! (y: int) = async { return 2 } + return x + y + } + +let testParallel3() = + parallelCE { + let! x: int = async { return 1 } + and! y: int = async { return 2 } + return x + y + } + +let result = testParallel() |> Async.RunSynchronously +let result2 = testParallel2() |> Async.RunSynchronously +let result3 = testParallel3() |> Async.RunSynchronously +if result <> 3 then failwithf $"Expected 3, but got {result}" +if result2 <> 3 then failwithf $"Expected 3, but got {result2}" +if result3 <> 3 then failwithf $"Expected 3, but got {result3}" + """ + |> withLangVersionPreview + |> asExe + |> compileAndRun + |> shouldSucceed \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 15.fs b/tests/service/data/SyntaxTree/SynType/Tuple 15.fs new file mode 100644 index 00000000000..eb13b88a326 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Tuple 15.fs @@ -0,0 +1,3 @@ +module Module + +let x: int, y: int = 0, 4 diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 15.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 15.fs.bsl new file mode 100644 index 00000000000..44d8624017b --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Tuple 15.fs.bsl @@ -0,0 +1,31 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Tuple 15.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)), + Some + (SynBindingReturnInfo + (LongIdent (SynLongIdent ([int], [], [None])), + (3,7--3,10), [], { ColonRange = Some (3,5--3,6) })), + Typed + (ArbitraryAfterError ("localBinding2", (3,10--3,10)), + LongIdent (SynLongIdent ([int], [], [None])), (3,10--3,10)), + (3,4--3,5), Yes (3,0--3,10), { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = None })], + (3,0--3,10))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(3,10)-(3,11) parse error Unexpected symbol ',' in binding. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 07.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 07.fs new file mode 100644 index 00000000000..5cbe57f4dbe --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 07.fs @@ -0,0 +1,7 @@ +module Module +async { + let! ({ Name = name }: Person) = asyncPerson() + + return name + +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 07.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 07.fs.bsl new file mode 100644 index 00000000000..9493eb7270f --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 07.fs.bsl @@ -0,0 +1,35 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 07.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (3,4--3,50), false, true, + Paren + (Typed + (Record + ([(([], Name), Some (3,17--3,18), + Named + (SynIdent (name, None), false, None, + (3,19--3,23)))], (3,10--3,25)), + LongIdent (SynLongIdent ([Person], [], [None])), + (3,10--3,33)), (3,9--3,34)), + App + (Atomic, false, Ident asyncPerson, + Const (Unit, (3,48--3,50)), (3,37--3,50)), [], + YieldOrReturn + ((false, true), Ident name, (5,4--5,15), + { YieldOrReturnKeyword = (5,4--5,10) }), (3,4--5,15), + { LetOrUseBangKeyword = (3,4--3,8) + EqualsRange = Some (3,35--3,36) }), (2,6--7,1)), + (2,0--7,1)), (2,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 08.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 08.fs new file mode 100644 index 00000000000..941456b8732 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 08.fs @@ -0,0 +1,6 @@ +module Module +async { + let! { Name = name }: Person = asyncPerson() + return name + +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 08.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 08.fs.bsl new file mode 100644 index 00000000000..62bf5bc63db --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 08.fs.bsl @@ -0,0 +1,34 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 08.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (3,4--3,48), false, true, + Typed + (Record + ([(([], Name), Some (3,16--3,17), + Named + (SynIdent (name, None), false, None, + (3,18--3,22)))], (3,9--3,24)), + LongIdent (SynLongIdent ([Person], [], [None])), + (3,9--3,32)), + App + (Atomic, false, Ident asyncPerson, + Const (Unit, (3,46--3,48)), (3,35--3,48)), [], + YieldOrReturn + ((false, true), Ident name, (4,4--4,15), + { YieldOrReturnKeyword = (4,4--4,10) }), (3,4--4,15), + { LetOrUseBangKeyword = (3,4--3,8) + EqualsRange = Some (3,33--3,34) }), (2,6--6,1)), + (2,0--6,1)), (2,0--6,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 09.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 09.fs new file mode 100644 index 00000000000..ffae5310fb2 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 09.fs @@ -0,0 +1,5 @@ +module Module +async { + let! (Union value) = asyncOption() + return value +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 09.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 09.fs.bsl new file mode 100644 index 00000000000..0516dc630a8 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 09.fs.bsl @@ -0,0 +1,34 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 09.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (3,4--3,38), false, true, + Paren + (LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value, None), false, None, + (3,16--3,21))], None, (3,10--3,21)), + (3,9--3,22)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (3,36--3,38)), (3,25--3,38)), [], + YieldOrReturn + ((false, true), Ident value, (4,4--4,16), + { YieldOrReturnKeyword = (4,4--4,10) }), (3,4--4,16), + { LetOrUseBangKeyword = (3,4--3,8) + EqualsRange = Some (3,23--3,24) }), (2,6--5,1)), + (2,0--5,1)), (2,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/SynType/Typed LetBang 10.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 10.fs new file mode 100644 index 00000000000..f96163293b7 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 10.fs @@ -0,0 +1,5 @@ +module Module +async { + let! Union value = asyncOption() + return value +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 10.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 10.fs.bsl new file mode 100644 index 00000000000..f3758aff371 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 10.fs.bsl @@ -0,0 +1,32 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 10.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (3,4--3,36), false, true, + LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value, None), false, None, + (3,15--3,20))], None, (3,9--3,20)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (3,34--3,36)), (3,23--3,36)), [], + YieldOrReturn + ((false, true), Ident value, (4,4--4,16), + { YieldOrReturnKeyword = (4,4--4,10) }), (3,4--4,16), + { LetOrUseBangKeyword = (3,4--3,8) + EqualsRange = Some (3,21--3,22) }), (2,6--5,1)), + (2,0--5,1)), (2,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/SynType/Typed LetBang 11.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 11.fs new file mode 100644 index 00000000000..48e18bbe04f --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 11.fs @@ -0,0 +1,5 @@ +module Module +async { + let! (Union value): int option = asyncOption() + return value +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 11.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 11.fs.bsl new file mode 100644 index 00000000000..096e0effc20 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 11.fs.bsl @@ -0,0 +1,40 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 11.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (3,4--3,50), false, true, + Typed + (Paren + (LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value, None), false, None, + (3,16--3,21))], None, (3,10--3,21)), + (3,9--3,22)), + App + (LongIdent (SynLongIdent ([option], [], [None])), + None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], + None, true, (3,24--3,34)), (3,9--3,34)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (3,48--3,50)), (3,37--3,50)), [], + YieldOrReturn + ((false, true), Ident value, (4,4--4,16), + { YieldOrReturnKeyword = (4,4--4,10) }), (3,4--4,16), + { LetOrUseBangKeyword = (3,4--3,8) + EqualsRange = Some (3,35--3,36) }), (2,6--5,1)), + (2,0--5,1)), (2,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/SynType/Typed LetBang 12.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 12.fs new file mode 100644 index 00000000000..4fb0e0b1a5e --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 12.fs @@ -0,0 +1,5 @@ +module Module +async { + let! Union value: int option = asyncOption() + return value +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 12.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 12.fs.bsl new file mode 100644 index 00000000000..b274a8880f3 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 12.fs.bsl @@ -0,0 +1,38 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 12.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (3,4--3,48), false, true, + Typed + (LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value, None), false, None, + (3,15--3,20))], None, (3,9--3,20)), + App + (LongIdent (SynLongIdent ([option], [], [None])), + None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], + None, true, (3,22--3,32)), (3,9--3,32)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (3,46--3,48)), (3,35--3,48)), [], + YieldOrReturn + ((false, true), Ident value, (4,4--4,16), + { YieldOrReturnKeyword = (4,4--4,10) }), (3,4--4,16), + { LetOrUseBangKeyword = (3,4--3,8) + EqualsRange = Some (3,33--3,34) }), (2,6--5,1)), + (2,0--5,1)), (2,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/SynType/Typed LetBang 13.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 13.fs new file mode 100644 index 00000000000..19c127c107f --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 13.fs @@ -0,0 +1,5 @@ +module Module +async { + let! x: int, y: int = asyncInt() + return () +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 13.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 13.fs.bsl new file mode 100644 index 00000000000..54d1f846530 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 13.fs.bsl @@ -0,0 +1,21 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 13.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (Tuple + (false, + [App + (NonAtomic, false, Ident async, + Record (None, None, [], (2,6--2,7)), (2,0--2,7)); Ident y], + [(3,15--3,16)], (2,0--3,18)), (2,0--3,18))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,18), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(3,15)-(3,16) parse error Unexpected symbol ',' in expression. Expected '=' or other token. +(2,6)-(2,7) parse error Unmatched '{' +(4,4)-(4,10) parse error Incomplete structured construct at or before this point in implementation file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 01.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 01.fs new file mode 100644 index 00000000000..5ec258108d5 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 01.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! res: int = async { return 1 } + and! res2: int = async { return 2 } + return res +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 01.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 01.fs.bsl new file mode 100644 index 00000000000..0aa056d6da5 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 01.fs.bsl @@ -0,0 +1,56 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 01.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,38), false, true, + Typed + (Named (SynIdent (res, None), false, None, (4,9--4,12)), + LongIdent (SynLongIdent ([int], [], [None])), + (4,9--4,17)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 1, (4,35--4,36)), + (4,28--4,36), + { YieldOrReturnKeyword = (4,28--4,34) }), + (4,26--4,38)), (4,20--4,38)), + [SynExprAndBang + (Yes (5,4--5,39), false, true, + Typed + (Named + (SynIdent (res2, None), false, None, (5,9--5,13)), + LongIdent (SynLongIdent ([int], [], [None])), + (5,9--5,18)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 2, (5,36--5,37)), + (5,29--5,37), + { YieldOrReturnKeyword = (5,29--5,35) }), + (5,27--5,39)), (5,21--5,39)), (5,4--5,39), + { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,19--5,20) + InKeyword = None })], + YieldOrReturn + ((false, true), Ident res, (6,4--6,14), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,14), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,18--4,19) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 02.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 02.fs new file mode 100644 index 00000000000..9e1d620a319 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 02.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! (res: int) = async { return 1 } + and! (res2: int) = async { return 2 } + return res +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 02.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 02.fs.bsl new file mode 100644 index 00000000000..c6ad9a45417 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 02.fs.bsl @@ -0,0 +1,60 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 02.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,40), false, true, + Paren + (Typed + (Named + (SynIdent (res, None), false, None, (4,10--4,13)), + LongIdent (SynLongIdent ([int], [], [None])), + (4,10--4,18)), (4,9--4,19)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 1, (4,37--4,38)), + (4,30--4,38), + { YieldOrReturnKeyword = (4,30--4,36) }), + (4,28--4,40)), (4,22--4,40)), + [SynExprAndBang + (Yes (5,4--6,10), false, true, + Paren + (Typed + (Named + (SynIdent (res2, None), false, None, + (5,10--5,14)), + LongIdent (SynLongIdent ([int], [], [None])), + (5,10--5,19)), (5,9--5,20)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 2, (5,38--5,39)), + (5,31--5,39), + { YieldOrReturnKeyword = (5,31--5,37) }), + (5,29--5,41)), (5,23--5,41)), (5,4--5,41), + { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,21--5,22) + InKeyword = None })], + YieldOrReturn + ((false, true), Ident res, (6,4--6,14), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,14), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,20--4,21) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 03.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 03.fs new file mode 100644 index 00000000000..0e211e05966 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 03.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! ({ Name = name; Age = age }: Person) = asyncPerson() + and! ({ Id = id }: User) = asyncUser() + return name +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 03.fs.bsl new file mode 100644 index 00000000000..77d69da0a0b --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 03.fs.bsl @@ -0,0 +1,57 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 03.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,61), false, true, + Paren + (Typed + (Record + ([(([], Name), Some (4,17--4,18), + Named + (SynIdent (name, None), false, None, + (4,19--4,23))); + (([], Age), Some (4,29--4,30), + Named + (SynIdent (age, None), false, None, + (4,31--4,34)))], (4,10--4,36)), + LongIdent (SynLongIdent ([Person], [], [None])), + (4,10--4,44)), (4,9--4,45)), + App + (Atomic, false, Ident asyncPerson, + Const (Unit, (4,59--4,61)), (4,48--4,61)), + [SynExprAndBang + (Yes (5,4--6,10), false, true, + Paren + (Typed + (Record + ([(([], Id), Some (5,15--5,16), + Named + (SynIdent (id, None), false, None, + (5,17--5,19)))], (5,10--5,21)), + LongIdent (SynLongIdent ([User], [], [None])), + (5,10--5,27)), (5,9--5,28)), + App + (Atomic, false, Ident asyncUser, + Const (Unit, (5,40--5,42)), (5,31--5,42)), + (5,4--5,42), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,29--5,30) + InKeyword = None })], + YieldOrReturn + ((false, true), Ident name, (6,4--6,15), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,15), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,46--4,47) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 04.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 04.fs new file mode 100644 index 00000000000..b7318405b81 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 04.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! { Name = name; Age = age }: Person = asyncPerson() + and! { Id = id }: User = asyncUser() + return name +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 04.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 04.fs.bsl new file mode 100644 index 00000000000..2377382104e --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 04.fs.bsl @@ -0,0 +1,55 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 04.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,59), false, true, + Typed + (Record + ([(([], Name), Some (4,16--4,17), + Named + (SynIdent (name, None), false, None, + (4,18--4,22))); + (([], Age), Some (4,28--4,29), + Named + (SynIdent (age, None), false, None, + (4,30--4,33)))], (4,9--4,35)), + LongIdent (SynLongIdent ([Person], [], [None])), + (4,9--4,43)), + App + (Atomic, false, Ident asyncPerson, + Const (Unit, (4,57--4,59)), (4,46--4,59)), + [SynExprAndBang + (Yes (5,4--5,40), false, true, + Typed + (Record + ([(([], Id), Some (5,14--5,15), + Named + (SynIdent (id, None), false, None, + (5,16--5,18)))], (5,9--5,20)), + LongIdent (SynLongIdent ([User], [], [None])), + (5,9--5,26)), + App + (Atomic, false, Ident asyncUser, + Const (Unit, (5,38--5,40)), (5,29--5,40)), + (5,4--5,40), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,27--5,28) + InKeyword = None })], + YieldOrReturn + ((false, true), Ident name, (6,4--6,15), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,15), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,44--4,45) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 05.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 05.fs new file mode 100644 index 00000000000..3d99e5c9447 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 05.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! ({ Name = name; Age = age }: Person) = asyncPerson() + and! { Id = id }: User = asyncUser() + return name +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 05.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 05.fs.bsl new file mode 100644 index 00000000000..2309e7f9490 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 05.fs.bsl @@ -0,0 +1,56 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 05.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,61), false, true, + Paren + (Typed + (Record + ([(([], Name), Some (4,17--4,18), + Named + (SynIdent (name, None), false, None, + (4,19--4,23))); + (([], Age), Some (4,29--4,30), + Named + (SynIdent (age, None), false, None, + (4,31--4,34)))], (4,10--4,36)), + LongIdent (SynLongIdent ([Person], [], [None])), + (4,10--4,44)), (4,9--4,45)), + App + (Atomic, false, Ident asyncPerson, + Const (Unit, (4,59--4,61)), (4,48--4,61)), + [SynExprAndBang + (Yes (5,4--5,40), false, true, + Typed + (Record + ([(([], Id), Some (5,14--5,15), + Named + (SynIdent (id, None), false, None, + (5,16--5,18)))], (5,9--5,20)), + LongIdent (SynLongIdent ([User], [], [None])), + (5,9--5,26)), + App + (Atomic, false, Ident asyncUser, + Const (Unit, (5,38--5,40)), (5,29--5,40)), + (5,4--5,40), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,27--5,28) + InKeyword = None })], + YieldOrReturn + ((false, true), Ident name, (6,4--6,15), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,15), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,46--4,47) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 06.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 06.fs new file mode 100644 index 00000000000..7fa5f22d509 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 06.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! (Union value) = asyncOption() + and! (Union value2) = asyncOption() + return value + value2 +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 06.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 06.fs.bsl new file mode 100644 index 00000000000..564967a7a33 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 06.fs.bsl @@ -0,0 +1,62 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 06.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,38), false, true, + Paren + (LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value, None), false, None, + (4,16--4,21))], None, (4,10--4,21)), + (4,9--4,22)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (4,36--4,38)), (4,25--4,38)), + [SynExprAndBang + (Yes (5,4--6,10), false, true, + Paren + (LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value2, None), false, None, + (5,16--5,22))], None, (5,10--5,22)), + (5,9--5,23)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (5,37--5,39)), (5,26--5,39)), + (5,4--5,39), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,24--5,25) + InKeyword = None })], + YieldOrReturn + ((false, true), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (6,17--6,18)), Ident value, (6,11--6,18)), + Ident value2, (6,11--6,25)), (6,4--6,25), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,25), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,23--4,24) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 07.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 07.fs new file mode 100644 index 00000000000..4a8cdf52b91 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 07.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! Union value = asyncOption() + and! Union value2 = asyncOption() + return value + value2 +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 07.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 07.fs.bsl new file mode 100644 index 00000000000..8fab57b3ca4 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 07.fs.bsl @@ -0,0 +1,58 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 07.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,36), false, true, + LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value, None), false, None, + (4,15--4,20))], None, (4,9--4,20)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (4,34--4,36)), (4,23--4,36)), + [SynExprAndBang + (Yes (5,4--6,10), false, true, + LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value2, None), false, None, + (5,15--5,21))], None, (5,9--5,21)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (5,35--5,37)), (5,24--5,37)), + (5,4--5,37), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,22--5,23) + InKeyword = None })], + YieldOrReturn + ((false, true), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (6,17--6,18)), Ident value, (6,11--6,18)), + Ident value2, (6,11--6,25)), (6,4--6,25), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,25), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,21--4,22) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 08.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 08.fs new file mode 100644 index 00000000000..730c2d82016 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 08.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! (Union value): int option = asyncOption() + and! (Union value2): int option = asyncOption() + return value + value2 +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 08.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 08.fs.bsl new file mode 100644 index 00000000000..7ca03b4f9e3 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 08.fs.bsl @@ -0,0 +1,75 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 08.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,50), false, true, + Typed + (Paren + (LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value, None), false, None, + (4,16--4,21))], None, (4,10--4,21)), + (4,9--4,22)), + App + (LongIdent (SynLongIdent ([option], [], [None])), + None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], + None, true, (4,24--4,34)), (4,9--4,34)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (4,48--4,50)), (4,37--4,50)), + [SynExprAndBang + (Yes (5,4--5,51), false, true, + Typed + (Paren + (LongIdent + (SynLongIdent ([Union], [], [None]), None, + None, + Pats + [Named + (SynIdent (value2, None), false, None, + (5,16--5,22))], None, (5,10--5,22)), + (5,9--5,23)), + App + (LongIdent (SynLongIdent ([option], [], [None])), + None, + [LongIdent (SynLongIdent ([int], [], [None]))], + [], None, true, (5,25--5,35)), (5,9--5,35)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (5,49--5,51)), (5,38--5,51)), + (5,4--5,51), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,36--5,37) + InKeyword = None })], + YieldOrReturn + ((false, true), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (6,17--6,18)), Ident value, (6,11--6,18)), + Ident value2, (6,11--6,25)), (6,4--6,25), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,25), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,35--4,36) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 09.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 09.fs new file mode 100644 index 00000000000..f5221c58c89 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 09.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! Union value: int option = asyncOption() + and! Union value2: int option = asyncOption() + return value + value2 +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 09.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 09.fs.bsl new file mode 100644 index 00000000000..0233ea37538 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 09.fs.bsl @@ -0,0 +1,70 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 09.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,48), false, true, + Typed + (LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value, None), false, None, + (4,15--4,20))], None, (4,9--4,20)), + App + (LongIdent (SynLongIdent ([option], [], [None])), + None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], + None, true, (4,22--4,32)), (4,9--4,32)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (4,46--4,48)), (4,35--4,48)), + [SynExprAndBang + (Yes (5,4--5,49), false, true, + Typed + (LongIdent + (SynLongIdent ([Union], [], [None]), None, None, + Pats + [Named + (SynIdent (value2, None), false, None, + (5,15--5,21))], None, (5,9--5,21)), + App + (LongIdent (SynLongIdent ([option], [], [None])), + None, + [LongIdent (SynLongIdent ([int], [], [None]))], + [], None, true, (5,23--5,33)), (5,9--5,33)), + App + (Atomic, false, Ident asyncOption, + Const (Unit, (5,47--5,49)), (5,36--5,49)), + (5,4--5,49), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,34--5,35) + InKeyword = None })], + YieldOrReturn + ((false, true), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (6,17--6,18)), Ident value, (6,11--6,18)), + Ident value2, (6,11--6,25)), (6,4--6,25), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,25), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,33--4,34) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 10.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 10.fs new file mode 100644 index 00000000000..820ef060e8f --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 10.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! (x as y): int = asyncInt() + and! (a as b): string = asyncString() + return x + b +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 10.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 10.fs.bsl new file mode 100644 index 00000000000..4c616752ce3 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 10.fs.bsl @@ -0,0 +1,67 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 10.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,35), false, true, + Typed + (Paren + (As + (Named + (SynIdent (x, None), false, None, (4,10--4,11)), + Named + (SynIdent (y, None), false, None, (4,15--4,16)), + (4,10--4,16)), (4,9--4,17)), + LongIdent (SynLongIdent ([int], [], [None])), + (4,9--4,22)), + App + (Atomic, false, Ident asyncInt, + Const (Unit, (4,33--4,35)), (4,25--4,35)), + [SynExprAndBang + (Yes (5,4--5,41), false, true, + Typed + (Paren + (As + (Named + (SynIdent (a, None), false, None, + (5,10--5,11)), + Named + (SynIdent (b, None), false, None, + (5,15--5,16)), (5,10--5,16)), (5,9--5,17)), + LongIdent (SynLongIdent ([string], [], [None])), + (5,9--5,25)), + App + (Atomic, false, Ident asyncString, + Const (Unit, (5,39--5,41)), (5,28--5,41)), + (5,4--5,41), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,26--5,27) + InKeyword = None })], + YieldOrReturn + ((false, true), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (6,13--6,14)), Ident x, (6,11--6,14)), + Ident b, (6,11--6,16)), (6,4--6,16), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,16), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,23--4,24) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 11.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 11.fs new file mode 100644 index 00000000000..08da39cd1d8 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 11.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! x as y: int = asyncInt() + and! a as b: string = asyncString() + return x + b +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 11.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 11.fs.bsl new file mode 100644 index 00000000000..4c4991234a3 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 11.fs.bsl @@ -0,0 +1,64 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 11.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,33), false, true, + Typed + (As + (Named + (SynIdent (x, None), false, None, (4,9--4,10)), + Named + (SynIdent (y, None), false, None, (4,14--4,15)), + (4,9--4,15)), + LongIdent (SynLongIdent ([int], [], [None])), + (4,9--4,20)), + App + (Atomic, false, Ident asyncInt, + Const (Unit, (4,31--4,33)), (4,23--4,33)), + [SynExprAndBang + (Yes (5,4--5,39), false, true, + Typed + (As + (Named + (SynIdent (a, None), false, None, (5,9--5,10)), + Named + (SynIdent (b, None), false, None, + (5,14--5,15)), (5,9--5,15)), + LongIdent (SynLongIdent ([string], [], [None])), + (5,9--5,23)), + App + (Atomic, false, Ident asyncString, + Const (Unit, (5,37--5,39)), (5,26--5,39)), + (5,4--5,39), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,24--5,25) + InKeyword = None })], + YieldOrReturn + ((false, true), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (6,13--6,14)), Ident x, (6,11--6,14)), + Ident b, (6,11--6,16)), (6,4--6,16), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,16), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,21--4,22) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 12.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 12.fs new file mode 100644 index 00000000000..f8d1d7fad52 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 12.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! x as y = asyncInt() + and! a as b = asyncString() + return x + b +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 12.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 12.fs.bsl new file mode 100644 index 00000000000..bb908917f12 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 12.fs.bsl @@ -0,0 +1,56 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 12.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,28), false, true, + As + (Named (SynIdent (x, None), false, None, (4,9--4,10)), + Named (SynIdent (y, None), false, None, (4,14--4,15)), + (4,9--4,15)), + App + (Atomic, false, Ident asyncInt, + Const (Unit, (4,26--4,28)), (4,18--4,28)), + [SynExprAndBang + (Yes (5,4--6,10), false, true, + As + (Named + (SynIdent (a, None), false, None, (5,9--5,10)), + Named + (SynIdent (b, None), false, None, (5,14--5,15)), + (5,9--5,15)), + App + (Atomic, false, Ident asyncString, + Const (Unit, (5,29--5,31)), (5,18--5,31)), + (5,4--5,31), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,16--5,17) + InKeyword = None })], + YieldOrReturn + ((false, true), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (6,13--6,14)), Ident x, (6,11--6,14)), + Ident b, (6,11--6,16)), (6,4--6,16), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,16), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,16--4,17) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 13.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 13.fs new file mode 100644 index 00000000000..2ec04876505 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 13.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! ([| first; second |]: int array) = asyncArray() + and! (head :: tail: string list) = asyncList() + return first +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 13.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 13.fs.bsl new file mode 100644 index 00000000000..c9f68d900fd --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 13.fs.bsl @@ -0,0 +1,70 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 13.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,56), false, true, + Paren + (Typed + (ArrayOrList + (true, + [Named + (SynIdent (first, None), false, None, + (4,13--4,18)); + Named + (SynIdent (second, None), false, None, + (4,20--4,26))], (4,10--4,29)), + App + (LongIdent (SynLongIdent ([array], [], [None])), + None, + [LongIdent (SynLongIdent ([int], [], [None]))], + [], None, true, (4,31--4,40)), (4,10--4,40)), + (4,9--4,41)), + App + (Atomic, false, Ident asyncArray, + Const (Unit, (4,54--4,56)), (4,44--4,56)), + [SynExprAndBang + (Yes (5,4--6,10), false, true, + Paren + (ListCons + (Named + (SynIdent (head, None), false, None, + (5,10--5,14)), + Typed + (Named + (SynIdent (tail, None), false, None, + (5,18--5,22)), + App + (LongIdent + (SynLongIdent ([list], [], [None])), + None, + [LongIdent + (SynLongIdent ([string], [], [None]))], + [], None, true, (5,24--5,35)), + (5,18--5,35)), (5,10--5,35), + { ColonColonRange = (5,15--5,17) }), + (5,9--5,36)), + App + (Atomic, false, Ident asyncList, + Const (Unit, (5,48--5,50)), (5,39--5,50)), + (5,4--5,50), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,37--5,38) + InKeyword = None })], + YieldOrReturn + ((false, true), Ident first, (6,4--6,16), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,16), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,42--4,43) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 14.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 14.fs new file mode 100644 index 00000000000..95522afafc7 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 14.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! [| first; second |]: int array = asyncArray() + and! head :: tail: string list = asyncList() + return first +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 14.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 14.fs.bsl new file mode 100644 index 00000000000..eaefd1aa4ef --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 14.fs.bsl @@ -0,0 +1,64 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 14.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,54), false, true, + Typed + (ArrayOrList + (true, + [Named + (SynIdent (first, None), false, None, + (4,12--4,17)); + Named + (SynIdent (second, None), false, None, + (4,19--4,25))], (4,9--4,28)), + App + (LongIdent (SynLongIdent ([array], [], [None])), + None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], + None, true, (4,30--4,39)), (4,9--4,39)), + App + (Atomic, false, Ident asyncArray, + Const (Unit, (4,52--4,54)), (4,42--4,54)), + [SynExprAndBang + (Yes (5,4--5,48), false, true, + Typed + (ListCons + (Named + (SynIdent (head, None), false, None, + (5,9--5,13)), + Named + (SynIdent (tail, None), false, None, + (5,17--5,21)), (5,9--5,21), + { ColonColonRange = (5,14--5,16) }), + App + (LongIdent (SynLongIdent ([list], [], [None])), + None, + [LongIdent + (SynLongIdent ([string], [], [None]))], [], + None, true, (5,23--5,34)), (5,9--5,34)), + App + (Atomic, false, Ident asyncList, + Const (Unit, (5,46--5,48)), (5,37--5,48)), + (5,4--5,48), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,35--5,36) + InKeyword = None })], + YieldOrReturn + ((false, true), Ident first, (6,4--6,16), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,16), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,40--4,41) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 15.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 15.fs new file mode 100644 index 00000000000..92646da071f --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 15.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! (x, y): int * int = asyncInt() + and! x: int, y: int = asyncInt() + return () +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 15.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 15.fs.bsl new file mode 100644 index 00000000000..b66ac37e92f --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 15.fs.bsl @@ -0,0 +1,64 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 15.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Equality], [], [Some (OriginalNotation "=")]), + None, (5,24--5,25)), + LetOrUseBang + (Yes (4,4--4,39), false, true, + Typed + (Paren + (Tuple + (false, + [Named + (SynIdent (x, None), false, None, + (4,10--4,11)); + Named + (SynIdent (y, None), false, None, + (4,13--4,14))], [(4,11--4,12)], + (4,10--4,14)), (4,9--4,15)), + Tuple + (false, + [Type + (LongIdent + (SynLongIdent ([int], [], [None]))); + Star (4,21--4,22); + Type + (LongIdent + (SynLongIdent ([int], [], [None])))], + (4,17--4,26)), (4,9--4,26)), + App + (Atomic, false, Ident asyncInt, + Const (Unit, (4,37--4,39)), (4,29--4,39)), [], + Typed + (Ident y, + LongIdent (SynLongIdent ([int], [], [None])), + (5,17--5,23)), (4,4--5,23), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,27--4,28) }), (4,4--5,25)), + ArbitraryAfterError ("declExprInfixEquals", (5,25--5,25)), + (4,4--5,25)), (3,6--7,1)), (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(5,15)-(5,16) parse error Unexpected symbol ',' in expression. Expected '=' or other token. +(4,4)-(4,8) parse error Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let!' keyword. +(5,26)-(5,34) parse error Unexpected start of structured construct in expression +(5,24)-(5,25) parse error Unexpected token '=' or incomplete expression diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 16.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 16.fs new file mode 100644 index 00000000000..b01631488a2 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 16.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! (x, y): int * int = asyncInt() + and! (x: int, y: int) = asyncInt() + return () +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 16.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 16.fs.bsl new file mode 100644 index 00000000000..c6344f68319 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 16.fs.bsl @@ -0,0 +1,72 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 16.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,39), false, true, + Typed + (Paren + (Tuple + (false, + [Named + (SynIdent (x, None), false, None, + (4,10--4,11)); + Named + (SynIdent (y, None), false, None, + (4,13--4,14))], [(4,11--4,12)], (4,10--4,14)), + (4,9--4,15)), + Tuple + (false, + [Type + (LongIdent (SynLongIdent ([int], [], [None]))); + Star (4,21--4,22); + Type + (LongIdent (SynLongIdent ([int], [], [None])))], + (4,17--4,26)), (4,9--4,26)), + App + (Atomic, false, Ident asyncInt, + Const (Unit, (4,37--4,39)), (4,29--4,39)), + [SynExprAndBang + (Yes (5,4--6,10), false, true, + Paren + (Tuple + (false, + [Typed + (Named + (SynIdent (x, None), false, None, + (5,10--5,11)), + LongIdent + (SynLongIdent ([int], [], [None])), + (5,10--5,16)); + Typed + (Named + (SynIdent (y, None), false, None, + (5,18--5,19)), + LongIdent + (SynLongIdent ([int], [], [None])), + (5,18--5,24))], [(5,16--5,17)], + (5,10--5,24)), (5,9--5,25)), + App + (Atomic, false, Ident asyncInt, + Const (Unit, (5,36--5,38)), (5,28--5,38)), + (5,4--5,38), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,26--5,27) + InKeyword = None })], + YieldOrReturn + ((false, true), Const (Unit, (6,11--6,13)), (6,4--6,13), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,13), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,27--4,28) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 17.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 17.fs new file mode 100644 index 00000000000..3918e729716 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 17.fs @@ -0,0 +1,7 @@ +module Module + +async { + let! (x, y): int * int = asyncInt() + and! (x, y): int * int = asyncInt() + return () +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 17.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 17.fs.bsl new file mode 100644 index 00000000000..f801b2d1319 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang AndBang 17.fs.bsl @@ -0,0 +1,75 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang AndBang 17.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,39), false, true, + Typed + (Paren + (Tuple + (false, + [Named + (SynIdent (x, None), false, None, + (4,10--4,11)); + Named + (SynIdent (y, None), false, None, + (4,13--4,14))], [(4,11--4,12)], (4,10--4,14)), + (4,9--4,15)), + Tuple + (false, + [Type + (LongIdent (SynLongIdent ([int], [], [None]))); + Star (4,21--4,22); + Type + (LongIdent (SynLongIdent ([int], [], [None])))], + (4,17--4,26)), (4,9--4,26)), + App + (Atomic, false, Ident asyncInt, + Const (Unit, (4,37--4,39)), (4,29--4,39)), + [SynExprAndBang + (Yes (5,4--5,39), false, true, + Typed + (Paren + (Tuple + (false, + [Named + (SynIdent (x, None), false, None, + (5,10--5,11)); + Named + (SynIdent (y, None), false, None, + (5,13--5,14))], [(5,11--5,12)], + (5,10--5,14)), (5,9--5,15)), + Tuple + (false, + [Type + (LongIdent + (SynLongIdent ([int], [], [None]))); + Star (5,21--5,22); + Type + (LongIdent + (SynLongIdent ([int], [], [None])))], + (5,17--5,26)), (5,9--5,26)), + App + (Atomic, false, Ident asyncInt, + Const (Unit, (5,37--5,39)), (5,29--5,39)), + (5,4--5,39), { AndBangKeyword = (5,4--5,8) + EqualsRange = (5,27--5,28) + InKeyword = None })], + YieldOrReturn + ((false, true), Const (Unit, (6,11--6,13)), (6,4--6,13), + { YieldOrReturnKeyword = (6,4--6,10) }), (4,4--6,13), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,27--4,28) }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set []))