From 5f52cc26bc594dc69ae7d21ab4a126bb225c8611 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Tue, 16 Sep 2025 22:18:36 +0100 Subject: [PATCH 1/5] Unify anonymous record fields --- .../Checking/CheckRecordSyntaxHelpers.fs | 14 +- .../Checking/Expressions/CheckExpressions.fs | 69 ++++-- .../GraphChecking/FileContentMapping.fs | 11 +- .../Service/FSharpParseFileResults.fs | 2 +- src/Compiler/Service/ServiceParseTreeWalk.fs | 215 ++++++++---------- src/Compiler/Service/SynExpr.fs | 4 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 2 +- src/Compiler/SyntaxTree/SyntaxTree.fsi | 2 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 5 +- src/Compiler/pars.fsy | 10 - ...iler.Service.SurfaceArea.netstandard20.bsl | 8 +- .../Expression/AnonRecd - Quotation 01.fs.bsl | 105 +++++---- .../Expression/AnonRecd - Quotation 02.fs.bsl | 105 +++++---- .../Expression/AnonRecd - Quotation 03.fs.bsl | 150 ++++++------ .../Expression/AnonRecd - Quotation 04.fs.bsl | 125 ++++++---- .../Expression/AnonymousRecords-01.fs.bsl | 14 +- .../Expression/AnonymousRecords-02.fs.bsl | 7 +- .../Expression/AnonymousRecords-03.fs.bsl | 7 +- .../Expression/AnonymousRecords-06.fs.bsl | 17 +- .../Expression/AnonymousRecords-07.fs.bsl | 76 ++++--- .../Expression/AnonymousRecords-08.fs.bsl | 144 +++++++----- .../Expression/AnonymousRecords-09.fs.bsl | 60 +++-- .../Expression/AnonymousRecords-10.fs.bsl | 68 +++--- .../Expression/AnonymousRecords-11.fs.bsl | 92 ++++---- .../Expression/AnonymousRecords-12.fs.bsl | 60 +++-- .../Expression/AnonymousRecords-13.fs.bsl | 22 +- .../Expression/Record - Anon 01.fs.bsl | 7 +- .../Expression/Record - Anon 02.fs.bsl | 5 +- .../Expression/Record - Anon 07.fs.bsl | 11 +- .../Expression/Record - Anon 08.fs.bsl | 11 +- .../Expression/Record - Anon 09.fs.bsl | 34 +-- .../Expression/Record - Anon 10.fs.bsl | 18 +- .../Expression/Record - Anon 11.fs.bsl | 28 ++- .../SynExprAnonRecdWithStructKeyword.fs.bsl | 5 +- ...sTheRangeOfTheEqualsSignInTheFields.fs.bsl | 19 +- 35 files changed, 869 insertions(+), 663 deletions(-) diff --git a/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs b/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs index c4836865f79..9c4fc52611d 100644 --- a/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs +++ b/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs @@ -100,7 +100,7 @@ let TransformAstForNestedUpdates (cenv: TcFileState) (env: TcEnv) overallTy (lid ) | _ -> None - let rec synExprRecd copyInfo (outerFieldId: Ident) innerFields exprBeingAssigned = + let rec synExprRecd copyInfo (outerFieldId: Ident) innerFields (exprBeingAssigned: SynExpr) = match innerFields with | [] -> failwith "unreachable" | (fieldId: Ident, item) :: rest -> @@ -115,11 +115,13 @@ let TransformAstForNestedUpdates (cenv: TcFileState) (env: TcEnv) overallTy (lid synExprRecd copyInfo fieldId rest exprBeingAssigned match item with - | Item.AnonRecdField( - anonInfo = { - AnonRecdTypeInfo.TupInfo = TupInfo.Const isStruct - }) -> - let fields = [ LongIdentWithDots([ fieldId ], []), None, nestedField ] + | Item.AnonRecdField(anonInfo = { TupInfo = TupInfo.Const isStruct }) -> + let fieldName = (SynLongIdent([ fieldId ], [], [ None ]), true) + let fieldRange = unionRanges fieldId.idRange nestedField.Range + + let fields = + [ SynExprRecordField(fieldName, None, Some nestedField, fieldRange, None) ] + SynExpr.AnonRecd(isStruct, copyInfo outerFieldId, fields, outerFieldId.idRange, { OpeningBraceRange = range0 }) | _ -> let fields = diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 9aaf8d472a8..87567e9eb8e 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -7855,42 +7855,69 @@ and CheckAnonRecdExprDuplicateFields (elems: Ident array) = errorR(Error (FSComp.SR.tcAnonRecdDuplicateFieldId(uc1.idText), uc1.idRange)))) // Check '{| .... |}' -and TcAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, optOrigSynExpr, unsortedFieldIdsAndSynExprsGiven, mWholeExpr) = +and TcAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, optOrigSynExpr, recordFields: SynExprRecordField list, mWholeExpr) = match optOrigSynExpr with | None -> - TcNewAnonRecdExpr cenv overallTy env tpenv (isStruct, unsortedFieldIdsAndSynExprsGiven, mWholeExpr) + TcNewAnonRecdExpr cenv overallTy env tpenv (isStruct, recordFields, mWholeExpr) | Some orig -> // Ideally we should also check for duplicate field IDs in the TcCopyAndUpdateAnonRecdExpr case, but currently the logic is too complex to guarantee a proper error reporting // So here we error instead errorR to avoid cascading internal errors - unsortedFieldIdsAndSynExprsGiven - |> List.countBy (fun (fId, _, _) -> textOfLid fId.LongIdent) + recordFields + |> List.countBy (fun (SynExprRecordField(fieldName = (fId, _))) -> textOfLid fId.LongIdent) |> List.iter (fun (label, count) -> if count > 1 then error (Error (FSComp.SR.tcAnonRecdDuplicateFieldId(label), mWholeExpr))) - TcCopyAndUpdateAnonRecdExpr cenv overallTy env tpenv (isStruct, orig, unsortedFieldIdsAndSynExprsGiven, mWholeExpr) + TcCopyAndUpdateAnonRecdExpr cenv overallTy env tpenv (isStruct, orig, recordFields, mWholeExpr) -and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, unsortedFieldIdsAndSynExprsGiven, mWholeExpr) = +and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, recordFields: SynExprRecordField list, mWholeExpr) = let g = cenv.g - let unsortedFieldSynExprsGiven = unsortedFieldIdsAndSynExprsGiven |> List.map (fun (_, _, fieldExpr) -> fieldExpr) - let unsortedFieldIds = unsortedFieldIdsAndSynExprsGiven |> List.map (fun (synLongIdent, _, _) -> synLongIdent.LongIdent[0]) |> List.toArray - let anonInfo, sortedFieldTys = UnifyAnonRecdTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv mWholeExpr overallTy isStruct unsortedFieldIds + + // For new anonymous records, each field label must be a single identifier. + // If a long identifier is given, report an error and skip that entry for typechecking purposes. + // Also normalize missing expressions to an error expression to keep traversal stable. + let validFields : (Ident * SynExpr * SynLongIdent) list = + recordFields + |> List.choose (fun (SynExprRecordField(fieldName = (synLongIdent, _); expr = expr)) -> + match synLongIdent.LongIdent with + | [ id ] -> + let exprGiven = + match expr with + | Some expr -> expr + | None -> arbExpr ("anonField", synLongIdent.Range) + Some(id, exprGiven, synLongIdent) + | [] -> + // Should not occur for anonymous record expressions; silently skip with a diagnostic. + errorR (Error(FSComp.SR.parsInvalidAnonRecdType(), synLongIdent.Range)) + None + | _ -> + // Nested labels are only valid in copy-and-update; not allowed for new anonymous records + errorR (Error(FSComp.SR.parsInvalidAnonRecdType(), synLongIdent.Range)) + None) + + let unsortedFieldSynExprsGiven = validFields |> List.map (fun (_, e, _) -> e) + + let unsortedFieldIds = validFields |> List.map (fun (id, _, _) -> id) |> List.toArray + + let anonInfo, sortedFieldTys = + UnifyAnonRecdTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv mWholeExpr overallTy isStruct unsortedFieldIds if unsortedFieldIds.Length > 1 then CheckAnonRecdExprDuplicateFields unsortedFieldIds // Sort into canonical order let sortedIndexedArgs = - unsortedFieldIdsAndSynExprsGiven + validFields |> List.indexed |> List.sortBy (fun (i,_) -> unsortedFieldIds[i].idText) // Map from sorted indexes to unsorted indexes let sigma = sortedIndexedArgs |> List.map fst |> List.toArray - let sortedFieldExprs = sortedIndexedArgs |> List.map snd + let sortedFieldTriples = sortedIndexedArgs |> List.map snd - sortedFieldExprs |> List.iteri (fun j (synLongIdent, _, _) -> + sortedFieldTriples + |> List.iteri (fun j (_, _, synLongIdent) -> let m = rangeOfLid synLongIdent.LongIdent let item = Item.AnonRecdField(anonInfo, sortedFieldTys, j, m) CallNameResolutionSink cenv.tcSink (m, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Use, env.eAccessRights)) @@ -7903,11 +7930,12 @@ and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, unsortedField let flexes = unsortedFieldTys |> List.map (fun _ -> true) - let unsortedCheckedArgs, tpenv = TcExprsWithFlexes cenv env mWholeExpr tpenv flexes unsortedFieldTys unsortedFieldSynExprsGiven + let unsortedCheckedArgs, tpenv = + TcExprsWithFlexes cenv env mWholeExpr tpenv flexes unsortedFieldTys unsortedFieldSynExprsGiven mkAnonRecd g mWholeExpr anonInfo unsortedFieldIds unsortedCheckedArgs unsortedFieldTys, tpenv -and TcCopyAndUpdateAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, (origExpr, blockSeparator), unsortedFieldIdsAndSynExprsGiven, mWholeExpr) = +and TcCopyAndUpdateAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, (origExpr, blockSeparator), recordFields: SynExprRecordField list, mWholeExpr) = // The fairly complex case '{| origExpr with X = 1; Y = 2 |}' // The origExpr may be either a record or anonymous record. // The origExpr may be either a struct or not. @@ -7926,14 +7954,17 @@ and TcCopyAndUpdateAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, (or if not (isAppTy g origExprTy || isAnonRecdTy g origExprTy) then error (Error (FSComp.SR.tcCopyAndUpdateNeedsRecordType(), mOrigExpr)) - // Expand expressions with respect to potential nesting + // Expand expressions with respect to potentially nesting let unsortedFieldIdsAndSynExprsGiven = - unsortedFieldIdsAndSynExprsGiven - |> List.map (fun (synLongIdent, _, exprBeingAssigned) -> + recordFields + |> List.map (fun (SynExprRecordField(fieldName = (synLongIdent, _); expr = e)) -> match synLongIdent.LongIdent with | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(), mWholeExpr)) - | [ id ] -> ([], id), Some exprBeingAssigned - | lid -> TransformAstForNestedUpdates cenv env origExprTy lid exprBeingAssigned (origExpr, blockSeparator)) + | [ id ] -> ([], id), e + | lid -> + match e with + | Some exprBeingAssigned -> TransformAstForNestedUpdates cenv env origExprTy lid exprBeingAssigned (origExpr, blockSeparator) + | None -> List.frontAndBack lid, None) |> GroupUpdatesToNestedFields let unsortedFieldSynExprsGiven = unsortedFieldIdsAndSynExprsGiven |> List.choose snd diff --git a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs index efa1b935fc8..725b9580cda 100644 --- a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs +++ b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs @@ -378,8 +378,15 @@ let visitSynExpr (e: SynExpr) : FileContentEntry list = | SynExpr.AnonRecd(copyInfo = copyInfo; recordFields = recordFields) -> let continuations = match copyInfo with - | None -> List.map (fun (_, _, e) -> visit e) recordFields - | Some(cp, _) -> visit cp :: List.map (fun (_, _, e) -> visit e) recordFields + | None -> + recordFields + |> List.choose (fun (SynExprRecordField(expr = e)) -> e) + |> List.map visit + | Some(cp, _) -> + visit cp + :: (recordFields + |> List.choose (fun (SynExprRecordField(expr = e)) -> e) + |> List.map visit) Continuation.concatenate continuations continuation | SynExpr.ArrayOrList(exprs = exprs) -> diff --git a/src/Compiler/Service/FSharpParseFileResults.fs b/src/Compiler/Service/FSharpParseFileResults.fs index f5c1d978447..dffff03b287 100644 --- a/src/Compiler/Service/FSharpParseFileResults.fs +++ b/src/Compiler/Service/FSharpParseFileResults.fs @@ -641,7 +641,7 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, | Some(e, _) -> yield! walkExpr true e | None -> () - yield! walkExprs (fs |> List.map (fun (_, _, e) -> e)) + yield! walkExprs (fs |> List.choose (fun (SynExprRecordField(expr = e)) -> e)) | SynExpr.ObjExpr(argOptions = args; bindings = bs; members = ms; extraImpls = is) -> let bs = unionBindingAndMembers bs ms diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 3c0e6bff76a..a17370db804 100644 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -400,135 +400,57 @@ module SyntaxTraversal = let traverseSynType = traverseSynType path let traversePat = traversePat path - match e with - | SynExpr.LongIdentSet(expr = synExpr) - | SynExpr.DotGet(expr = synExpr) - | SynExpr.Do(expr = synExpr) - | SynExpr.DoBang(expr = synExpr) - | SynExpr.Assert(expr = synExpr) - | SynExpr.Fixed(expr = synExpr) - | SynExpr.DebugPoint(innerExpr = synExpr) - | SynExpr.AddressOf(expr = synExpr) - | SynExpr.TraitCall(argExpr = synExpr) - | SynExpr.Lazy(expr = synExpr) - | SynExpr.InferredUpcast(expr = synExpr) - | SynExpr.InferredDowncast(expr = synExpr) - | SynExpr.YieldOrReturn(expr = synExpr) - | SynExpr.YieldOrReturnFrom(expr = synExpr) - | SynExpr.FromParseError(expr = synExpr) - | SynExpr.DiscardAfterMissingQualificationAfterDot(expr = synExpr) - | SynExpr.IndexFromEnd(expr = synExpr) - | SynExpr.New(expr = synExpr) - | SynExpr.ArrayOrListComputed(expr = synExpr) - | SynExpr.TypeApp(expr = synExpr) - | SynExpr.DotLambda(expr = synExpr) - | SynExpr.Quote(quotedExpr = synExpr) - | SynExpr.Paren(expr = synExpr) -> traverseSynExpr synExpr - - | SynExpr.InterpolatedString(contents = parts) -> - [ - for part in parts do - match part with - | SynInterpolatedStringPart.String _ -> () - | SynInterpolatedStringPart.FillExpr(fillExpr, _) -> yield dive fillExpr fillExpr.Range traverseSynExpr - ] - |> pick expr - - | SynExpr.Typed(expr = synExpr; targetType = synType) -> - match traverseSynExpr synExpr with - | None -> traverseSynType synType - | x -> x - - | SynExpr.Tuple(exprs = synExprList) - | SynExpr.ArrayOrList(exprs = synExprList) -> synExprList |> List.map (fun x -> dive x x.Range traverseSynExpr) |> pick expr - - | SynExpr.AnonRecd(copyInfo = copyOpt; recordFields = fields) -> + let visitRecordLike + (inheritOpt: (SynType * SynExpr * range * BlockSeparator option * range) option) + (copyOpt: (SynExpr * BlockSeparator) option) + (fields: SynExprRecordField list) + (expr: SynExpr) + = [ - match copyOpt with - | Some(expr, blockSep) -> - yield dive expr expr.Range traverseSynExpr - - yield - dive () blockSep.Range (fun () -> - if posGeq pos blockSep.Range.End then - // special case: caret is after WITH - // { x with $ } - visitor.VisitRecordField(path, Some expr, None) - else - None) - | _ -> () - - for field, _, x in fields do - yield dive () field.Range (fun () -> visitor.VisitRecordField(path, copyOpt |> Option.map fst, Some field)) - yield dive x x.Range traverseSynExpr - ] - |> pick expr - - | SynExpr.Record(baseInfo = inheritOpt; copyInfo = copyOpt; recordFields = fields) -> - [ - let diveIntoSeparator offsideColumn scPosOpt copyOpt = - match scPosOpt with - | Some scPos -> - if posGeq pos scPos then - visitor.VisitRecordField(path, copyOpt, None) // empty field after the inherits - else - None - | None -> - //semicolon position is not available - use offside rule - if pos.Column = offsideColumn then - visitor.VisitRecordField(path, copyOpt, None) // empty field after the inherits - else - None - match inheritOpt with - | Some(_ty, expr, _range, sepOpt, inheritRange) -> - // dive into argument + | Some(_ty, inheritArgExpr, _inheritEqRange, inheritSepOpt, inheritRange) -> yield - dive expr expr.Range (fun expr -> - // special-case:caret is located in the offside position below inherit - // inherit A() - // $ + dive inheritArgExpr inheritArgExpr.Range (fun inner -> if - not (rangeContainsPos expr.Range pos) - && sepOpt.IsNone + not (rangeContainsPos inheritArgExpr.Range pos) + && inheritSepOpt.IsNone && pos.Column = inheritRange.StartColumn then visitor.VisitRecordField(path, None, None) else - traverseSynExpr expr) + traverseSynExpr inner) - match sepOpt with + match inheritSepOpt with | Some blockSep -> yield dive () blockSep.Range (fun () -> - // special case: caret is below 'inherit' + one or more fields are already defined - // inherit A() - // $ - // field1 = 5 - diveIntoSeparator inheritRange.StartColumn blockSep.Position None) + let scPosOpt = blockSep.Position + + if scPosOpt |> Option.exists (fun scPos -> posGeq pos scPos) then + visitor.VisitRecordField(path, None, None) + else + None) | None -> () - | _ -> () + | None -> () match copyOpt with - | Some(expr, blockSep) -> - yield dive expr expr.Range traverseSynExpr + | Some(orig, blockSep) -> + yield dive orig orig.Range traverseSynExpr yield dive () blockSep.Range (fun () -> if posGeq pos blockSep.Range.End then - // special case: caret is after WITH - // { x with $ } - visitor.VisitRecordField(path, Some expr, None) + visitor.VisitRecordField(path, Some orig, None) else None) - | _ -> () + | None -> () - let copyOpt = Option.map fst copyOpt + let copyExprOnly = Option.map fst copyOpt - for SynExprRecordField(fieldName = (field, _); expr = e; blockSeparator = sepOpt) in fields do + for SynExprRecordField(fieldName = (fieldLid, _); expr = e; blockSeparator = sepOpt) in fields do yield - dive (path, copyOpt, Some field) field.Range (fun r -> - if rangeContainsPos field.Range pos then + dive (path, copyExprOnly, Some fieldLid) fieldLid.Range (fun r -> + if rangeContainsPos fieldLid.Range pos then visitor.VisitRecordField r else None) @@ -536,39 +458,92 @@ module SyntaxTraversal = let offsideColumn = match inheritOpt with | Some(_, _, _, _, inheritRange) -> inheritRange.StartColumn - | None -> field.Range.StartColumn + | None -> fieldLid.Range.StartColumn match e with - | Some e -> + | Some fe -> yield - dive e e.Range (fun expr -> - // special case: caret is below field binding - // field x = 5 - // $ + dive fe fe.Range (fun inner -> if - not (rangeContainsPos e.Range pos) + not (rangeContainsPos fe.Range pos) && sepOpt.IsNone && pos.Column = offsideColumn then - visitor.VisitRecordField(path, copyOpt, None) + visitor.VisitRecordField(path, copyExprOnly, None) else - traverseSynExpr expr) + traverseSynExpr inner) | None -> () match sepOpt with | Some blockSep -> yield dive () blockSep.Range (fun () -> - // special case: caret is between field bindings - // field1 = 5 - // $ - // field2 = 5 - diveIntoSeparator offsideColumn blockSep.Position copyOpt) - | _ -> () + match inheritOpt with + | Some _ -> + let scPosOpt = blockSep.Position + + if scPosOpt |> Option.exists (fun scPos -> posGeq pos scPos) then + visitor.VisitRecordField(path, copyExprOnly, None) + elif scPosOpt.IsNone && pos.Column = offsideColumn then + visitor.VisitRecordField(path, copyExprOnly, None) + else + None + | None -> + if posGeq pos blockSep.Range.End then + visitor.VisitRecordField(path, copyExprOnly, None) + else + None) + | None -> () + ] + |> pick expr + match e with + | SynExpr.LongIdentSet(expr = synExpr) + | SynExpr.DotGet(expr = synExpr) + | SynExpr.Do(expr = synExpr) + | SynExpr.DoBang(expr = synExpr) + | SynExpr.Assert(expr = synExpr) + | SynExpr.Fixed(expr = synExpr) + | SynExpr.DebugPoint(innerExpr = synExpr) + | SynExpr.AddressOf(expr = synExpr) + | SynExpr.TraitCall(argExpr = synExpr) + | SynExpr.Lazy(expr = synExpr) + | SynExpr.InferredUpcast(expr = synExpr) + | SynExpr.InferredDowncast(expr = synExpr) + | SynExpr.YieldOrReturn(expr = synExpr) + | SynExpr.YieldOrReturnFrom(expr = synExpr) + | SynExpr.FromParseError(expr = synExpr) + | SynExpr.DiscardAfterMissingQualificationAfterDot(expr = synExpr) + | SynExpr.IndexFromEnd(expr = synExpr) + | SynExpr.New(expr = synExpr) + | SynExpr.ArrayOrListComputed(expr = synExpr) + | SynExpr.TypeApp(expr = synExpr) + | SynExpr.DotLambda(expr = synExpr) + | SynExpr.Quote(quotedExpr = synExpr) + | SynExpr.Paren(expr = synExpr) -> traverseSynExpr synExpr + + | SynExpr.InterpolatedString(contents = parts) -> + [ + for part in parts do + match part with + | SynInterpolatedStringPart.String _ -> () + | SynInterpolatedStringPart.FillExpr(fillExpr, _) -> yield dive fillExpr fillExpr.Range traverseSynExpr ] |> pick expr + | SynExpr.Typed(expr = synExpr; targetType = synType) -> + match traverseSynExpr synExpr with + | None -> traverseSynType synType + | x -> x + + | SynExpr.Tuple(exprs = synExprList) + | SynExpr.ArrayOrList(exprs = synExprList) -> synExprList |> List.map (fun x -> dive x x.Range traverseSynExpr) |> pick expr + + | SynExpr.AnonRecd(copyInfo = copyOpt; recordFields = fields) -> visitRecordLike None copyOpt fields expr + + | SynExpr.Record(baseInfo = inheritOpt; copyInfo = copyOpt; recordFields = fields) -> + visitRecordLike inheritOpt copyOpt fields expr + | SynExpr.ObjExpr(objType = ty; argOptions = baseCallOpt; bindings = binds; members = ms; extraImpls = ifaces) -> let binds = unionBindingAndMembers binds ms diff --git a/src/Compiler/Service/SynExpr.fs b/src/Compiler/Service/SynExpr.fs index 9fd1b3a888a..7309973a904 100644 --- a/src/Compiler/Service/SynExpr.fs +++ b/src/Compiler/Service/SynExpr.fs @@ -1121,8 +1121,8 @@ module SynExpr = let rec loop recordFields = match recordFields with | [] -> false - | (_, Some _blockSeparator, SynExpr.Paren(expr = Is inner)) :: (SynLongIdent(id = id :: _), _, _) :: _ -> - problematic inner.Range id.idRange + | SynExprRecordField(expr = Some(SynExpr.Paren(expr = Is inner)); blockSeparator = Some _) :: SynExprRecordField( + fieldName = SynLongIdent(id = id :: _), _) :: _ -> problematic inner.Range id.idRange | _ :: recordFields -> loop recordFields loop recordFields diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 8db7131d65e..2be03974a71 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -550,7 +550,7 @@ type SynExpr = | AnonRecd of isStruct: bool * copyInfo: (SynExpr * BlockSeparator) option * - recordFields: (SynLongIdent * range option * SynExpr) list * + recordFields: SynExprRecordField list * range: range * trivia: SynExprAnonRecdTrivia diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 873e8201d1f..aee8d46e7e3 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -608,7 +608,7 @@ type SynExpr = | AnonRecd of isStruct: bool * copyInfo: (SynExpr * BlockSeparator) option * - recordFields: (SynLongIdent * range option * SynExpr) list * + recordFields: SynExprRecordField list * range: range * trivia: SynExprAnonRecdTrivia diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 020dc50bebf..beb0a563d07 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -915,11 +915,12 @@ let rec synExprContainsError inpExpr = | SynExpr.ArrayOrList(_, es, _) | SynExpr.Tuple(_, es, _, _) -> walkExprs es - | SynExpr.AnonRecd(copyInfo = origExpr; recordFields = flds) -> + | SynExpr.AnonRecd(copyInfo = origExpr; recordFields = fs) -> (match origExpr with | Some(e, _) -> walkExpr e | None -> false) - || walkExprs (List.map (fun (_, _, e) -> e) flds) + || (let flds = fs |> List.choose (fun (SynExprRecordField(expr = v)) -> v) + walkExprs flds) | SynExpr.Record(_, origExpr, fs, _) -> (match origExpr with diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index b773f1ea1ac..e648a4ca186 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -5912,12 +5912,6 @@ braceBarExpr: braceBarExprCore: | LBRACE_BAR recdExprCore bar_rbrace { let orig, flds = $2 - let flds = - flds |> List.choose (function - | SynExprRecordField((synLongIdent, _), mEquals, Some e, _, _) when orig.IsSome -> Some(synLongIdent, mEquals, e) // copy-and-update, long identifier signifies nesting - | SynExprRecordField((SynLongIdent([ _id ], _, _) as synLongIdent, _), mEquals, Some e, _, _) -> Some(synLongIdent, mEquals, e) // record construction, long identifier not valid - | SynExprRecordField((synLongIdent, _), mEquals, None, _, _) -> Some(synLongIdent, mEquals, arbExpr ("anonField", synLongIdent.Range)) - | _ -> reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsInvalidAnonRecdType()); None) let mLeftBrace = rhs parseState 1 let mRightBrace = rhs parseState 3 (fun (mStruct: range option) -> @@ -5927,10 +5921,6 @@ braceBarExprCore: | LBRACE_BAR recdExprCore recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBraceBar()) let orig, flds = $2 - let flds = - flds |> List.map (function - | SynExprRecordField((synLongIdent, _), mEquals, Some e, _, _) -> (synLongIdent, mEquals, e) - | SynExprRecordField((synLongIdent, _), mEquals, None, _, _) -> (synLongIdent, mEquals, arbExpr ("anonField", synLongIdent.Range))) let mLeftBrace = rhs parseState 1 let mExpr = rhs parseState 2 (fun (mStruct: range option) -> diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl index dd72f416ac0..9c2e498bb82 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl @@ -2081,8 +2081,8 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Text.Range[ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetSymbolUsesAtLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse]] GetDeclarationListSymbols(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetSymbolUseAtLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpDisplayContext] TryGetCapturedDisplayContext(FSharp.Compiler.Text.Range) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpDisplayContext] GetDisplayContextForPos(FSharp.Compiler.Text.Position) +FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpDisplayContext] TryGetCapturedDisplayContext(FSharp.Compiler.Text.Range) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpImplementationFileContents] ImplementationFile FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpImplementationFileContents] get_ImplementationFile() FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpType] TryGetCapturedType(FSharp.Compiler.Text.Range) @@ -7021,8 +7021,8 @@ FSharp.Compiler.Syntax.SynExpr+AnonRecd: FSharp.Compiler.SyntaxTrivia.SynExprAno FSharp.Compiler.Syntax.SynExpr+AnonRecd: FSharp.Compiler.SyntaxTrivia.SynExprAnonRecdTrivia trivia FSharp.Compiler.Syntax.SynExpr+AnonRecd: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynExpr+AnonRecd: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Syntax.SynLongIdent,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range],FSharp.Compiler.Syntax.SynExpr]] get_recordFields() -FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Syntax.SynLongIdent,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range],FSharp.Compiler.Syntax.SynExpr]] recordFields +FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExprRecordField] get_recordFields() +FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExprRecordField] recordFields FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Syntax.SynExpr,FSharp.Compiler.Syntax.BlockSeparator]] copyInfo FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Syntax.SynExpr,FSharp.Compiler.Syntax.BlockSeparator]] get_copyInfo() FSharp.Compiler.Syntax.SynExpr+App: Boolean get_isInfix() @@ -7771,7 +7771,7 @@ FSharp.Compiler.Syntax.SynExpr: Boolean get_IsWhileBang() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsYieldOrReturn() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsYieldOrReturnFrom() FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewAddressOf(Boolean, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewAnonRecd(Boolean, Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Syntax.SynExpr,FSharp.Compiler.Syntax.BlockSeparator]], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Syntax.SynLongIdent,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range],FSharp.Compiler.Syntax.SynExpr]], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynExprAnonRecdTrivia) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewAnonRecd(Boolean, Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Syntax.SynExpr,FSharp.Compiler.Syntax.BlockSeparator]], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExprRecordField], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynExprAnonRecdTrivia) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewApp(FSharp.Compiler.Syntax.ExprAtomicFlag, Boolean, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewArbitraryAfterError(System.String, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewArrayOrList(Boolean, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExpr], FSharp.Compiler.Text.Range) diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl index 7f3dd8badf2..59df46169e9 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl @@ -7,60 +7,69 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (3,5--3,6), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (3,12--3,13)), Const (Int32 1, (3,10--3,11)), - (3,10--3,13)), Const (Int32 1, (3,14--3,15)), - (3,10--3,15)), false, (3,7--3,18)))], (3,0--3,20), - { OpeningBraceRange = (3,0--3,2) }), (3,0--3,20)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (3,5--3,6), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (3,12--3,13)), Const (Int32 1, (3,10--3,11)), + (3,10--3,13)), Const (Int32 1, (3,14--3,15)), + (3,10--3,15)), false, (3,7--3,18))), (3,3--3,18), + None)], (3,0--3,20), { OpeningBraceRange = (3,0--3,2) }), + (3,0--3,20)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (5,4--5,5), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (5,11--5,12)), Const (Int32 1, (5,9--5,10)), - (5,9--5,12)), Const (Int32 1, (5,13--5,14)), - (5,9--5,14)), false, (5,6--5,17)))], (5,0--5,20), - { OpeningBraceRange = (5,0--5,2) }), (5,0--5,20)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (5,4--5,5), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,11--5,12)), Const (Int32 1, (5,9--5,10)), + (5,9--5,12)), Const (Int32 1, (5,13--5,14)), + (5,9--5,14)), false, (5,6--5,17))), (5,2--5,17), + None)], (5,0--5,20), { OpeningBraceRange = (5,0--5,2) }), + (5,0--5,20)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (7,5--7,6), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (7,12--7,13)), Const (Int32 1, (7,10--7,11)), - (7,10--7,13)), Const (Int32 1, (7,14--7,15)), - (7,10--7,15)), false, (7,7--7,18)))], (7,0--7,21), - { OpeningBraceRange = (7,0--7,2) }), (7,0--7,21))], + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (7,5--7,6), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (7,12--7,13)), Const (Int32 1, (7,10--7,11)), + (7,10--7,13)), Const (Int32 1, (7,14--7,15)), + (7,10--7,15)), false, (7,7--7,18))), (7,3--7,18), + None)], (7,0--7,21), { OpeningBraceRange = (7,0--7,2) }), + (7,0--7,21))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl index a17975ba1da..e624117f84b 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl @@ -7,60 +7,69 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (3,5--3,6), - Quote - (Ident op_QuotationUntyped, true, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (3,13--3,14)), Const (Int32 1, (3,11--3,12)), - (3,11--3,14)), Const (Int32 1, (3,15--3,16)), - (3,11--3,16)), false, (3,7--3,20)))], (3,0--3,22), - { OpeningBraceRange = (3,0--3,2) }), (3,0--3,22)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (3,5--3,6), + Some + (Quote + (Ident op_QuotationUntyped, true, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (3,13--3,14)), Const (Int32 1, (3,11--3,12)), + (3,11--3,14)), Const (Int32 1, (3,15--3,16)), + (3,11--3,16)), false, (3,7--3,20))), (3,3--3,20), + None)], (3,0--3,22), { OpeningBraceRange = (3,0--3,2) }), + (3,0--3,22)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (5,4--5,5), - Quote - (Ident op_QuotationUntyped, true, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (5,12--5,13)), Const (Int32 1, (5,10--5,11)), - (5,10--5,13)), Const (Int32 1, (5,14--5,15)), - (5,10--5,15)), false, (5,6--5,19)))], (5,0--5,22), - { OpeningBraceRange = (5,0--5,2) }), (5,0--5,22)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (5,4--5,5), + Some + (Quote + (Ident op_QuotationUntyped, true, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,12--5,13)), Const (Int32 1, (5,10--5,11)), + (5,10--5,13)), Const (Int32 1, (5,14--5,15)), + (5,10--5,15)), false, (5,6--5,19))), (5,2--5,19), + None)], (5,0--5,22), { OpeningBraceRange = (5,0--5,2) }), + (5,0--5,22)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (7,5--7,6), - Quote - (Ident op_QuotationUntyped, true, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (7,13--7,14)), Const (Int32 1, (7,11--7,12)), - (7,11--7,14)), Const (Int32 1, (7,15--7,16)), - (7,11--7,16)), false, (7,7--7,20)))], (7,0--7,23), - { OpeningBraceRange = (7,0--7,2) }), (7,0--7,23))], + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (7,5--7,6), + Some + (Quote + (Ident op_QuotationUntyped, true, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (7,13--7,14)), Const (Int32 1, (7,11--7,12)), + (7,11--7,14)), Const (Int32 1, (7,15--7,16)), + (7,11--7,16)), false, (7,7--7,20))), (7,3--7,20), + None)], (7,0--7,23), { OpeningBraceRange = (7,0--7,2) }), + (7,0--7,23))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl index 91f4963b53c..e9be0b0eb16 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl @@ -7,78 +7,96 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (3,5--3,6), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (3,12--3,13)), Const (Int32 1, (3,10--3,11)), - (3,10--3,13)), Const (Int32 1, (3,14--3,15)), - (3,10--3,15)), false, (3,7--3,18))); - (SynLongIdent ([B], [], [None]), Some (3,22--3,23), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (3,28--3,34)), (3,28--3,34)), - false, (3,24--3,38)))], (3,0--3,40), - { OpeningBraceRange = (3,0--3,2) }), (3,0--3,40)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (3,5--3,6), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (3,12--3,13)), Const (Int32 1, (3,10--3,11)), + (3,10--3,13)), Const (Int32 1, (3,14--3,15)), + (3,10--3,15)), false, (3,7--3,18))), (3,3--3,18), + Some (Semicolon ((3,18--3,19), Some (3,19)))); + SynExprRecordField + ((SynLongIdent ([B], [], [None]), true), Some (3,22--3,23), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (3,28--3,34)), + (3,28--3,34)), false, (3,24--3,38))), (3,20--3,38), + None)], (3,0--3,40), { OpeningBraceRange = (3,0--3,2) }), + (3,0--3,40)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (5,4--5,5), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (5,11--5,12)), Const (Int32 1, (5,9--5,10)), - (5,9--5,12)), Const (Int32 1, (5,13--5,14)), - (5,9--5,14)), false, (5,6--5,17))); - (SynLongIdent ([B], [], [None]), Some (5,21--5,22), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (5,27--5,33)), (5,27--5,33)), - false, (5,23--5,37)))], (5,0--5,40), - { OpeningBraceRange = (5,0--5,2) }), (5,0--5,40)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (5,4--5,5), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,11--5,12)), Const (Int32 1, (5,9--5,10)), + (5,9--5,12)), Const (Int32 1, (5,13--5,14)), + (5,9--5,14)), false, (5,6--5,17))), (5,2--5,17), + Some (Semicolon ((5,17--5,18), Some (5,18)))); + SynExprRecordField + ((SynLongIdent ([B], [], [None]), true), Some (5,21--5,22), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (5,27--5,33)), + (5,27--5,33)), false, (5,23--5,37))), (5,19--5,37), + None)], (5,0--5,40), { OpeningBraceRange = (5,0--5,2) }), + (5,0--5,40)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (7,5--7,6), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (7,12--7,13)), Const (Int32 1, (7,10--7,11)), - (7,10--7,13)), Const (Int32 1, (7,14--7,15)), - (7,10--7,15)), false, (7,7--7,18))); - (SynLongIdent ([B], [], [None]), Some (7,22--7,23), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (7,28--7,34)), (7,28--7,34)), - false, (7,24--7,38)))], (7,0--7,41), - { OpeningBraceRange = (7,0--7,2) }), (7,0--7,41))], + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (7,5--7,6), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (7,12--7,13)), Const (Int32 1, (7,10--7,11)), + (7,10--7,13)), Const (Int32 1, (7,14--7,15)), + (7,10--7,15)), false, (7,7--7,18))), (7,3--7,18), + Some (Semicolon ((7,18--7,19), Some (7,19)))); + SynExprRecordField + ((SynLongIdent ([B], [], [None]), true), Some (7,22--7,23), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (7,28--7,34)), + (7,28--7,34)), false, (7,24--7,38))), (7,20--7,38), + None)], (7,0--7,41), { OpeningBraceRange = (7,0--7,2) }), + (7,0--7,41))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,41), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl index 5577001a81e..1d39f8ab6e9 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl @@ -7,57 +7,92 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([Outer], [], [None]), Some (3,9--3,10), - AnonRecd - (false, None, - [(SynLongIdent ([Inner], [], [None]), Some (3,20--3,21), - Quote - (Ident op_Quotation, false, - Const (Int32 1, (3,25--3,26)), false, (3,22--3,29)))], - (3,11--3,31), { OpeningBraceRange = (3,11--3,13) })); - (SynLongIdent ([Other], [], [None]), Some (3,39--3,40), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (3,45--3,51)), (3,45--3,51)), - false, (3,41--3,55)))], (3,0--3,57), - { OpeningBraceRange = (3,0--3,2) }), (3,0--3,57)); + [SynExprRecordField + ((SynLongIdent ([Outer], [], [None]), true), + Some (3,9--3,10), + Some + (AnonRecd + (false, None, + [SynExprRecordField + ((SynLongIdent ([Inner], [], [None]), true), + Some (3,20--3,21), + Some + (Quote + (Ident op_Quotation, false, + Const (Int32 1, (3,25--3,26)), false, + (3,22--3,29))), (3,14--3,29), None)], + (3,11--3,31), { OpeningBraceRange = (3,11--3,13) })), + (3,3--3,31), Some (Semicolon ((3,31--3,32), Some (3,32)))); + SynExprRecordField + ((SynLongIdent ([Other], [], [None]), true), + Some (3,39--3,40), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (3,45--3,51)), + (3,45--3,51)), false, (3,41--3,55))), (3,33--3,55), + None)], (3,0--3,57), { OpeningBraceRange = (3,0--3,2) }), + (3,0--3,57)); Expr (AnonRecd (false, None, - [(SynLongIdent ([Outer], [], [None]), Some (5,8--5,9), - AnonRecd - (false, None, - [(SynLongIdent ([Inner], [], [None]), Some (5,19--5,20), - Quote - (Ident op_Quotation, false, - Const (Int32 1, (5,24--5,25)), false, (5,21--5,28)))], - (5,10--5,30), { OpeningBraceRange = (5,10--5,12) })); - (SynLongIdent ([Other], [], [None]), Some (5,38--5,39), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (5,44--5,50)), (5,44--5,50)), - false, (5,40--5,54)))], (5,0--5,57), - { OpeningBraceRange = (5,0--5,2) }), (5,0--5,57)); + [SynExprRecordField + ((SynLongIdent ([Outer], [], [None]), true), Some (5,8--5,9), + Some + (AnonRecd + (false, None, + [SynExprRecordField + ((SynLongIdent ([Inner], [], [None]), true), + Some (5,19--5,20), + Some + (Quote + (Ident op_Quotation, false, + Const (Int32 1, (5,24--5,25)), false, + (5,21--5,28))), (5,13--5,28), None)], + (5,10--5,30), { OpeningBraceRange = (5,10--5,12) })), + (5,2--5,30), Some (Semicolon ((5,30--5,31), Some (5,31)))); + SynExprRecordField + ((SynLongIdent ([Other], [], [None]), true), + Some (5,38--5,39), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (5,44--5,50)), + (5,44--5,50)), false, (5,40--5,54))), (5,32--5,54), + None)], (5,0--5,57), { OpeningBraceRange = (5,0--5,2) }), + (5,0--5,57)); Expr (AnonRecd (false, None, - [(SynLongIdent ([Outer], [], [None]), Some (7,9--7,10), - AnonRecd - (false, None, - [(SynLongIdent ([Inner], [], [None]), Some (7,20--7,21), - Quote - (Ident op_Quotation, false, - Const (Int32 1, (7,25--7,26)), false, (7,22--7,29)))], - (7,11--7,31), { OpeningBraceRange = (7,11--7,13) })); - (SynLongIdent ([Other], [], [None]), Some (7,39--7,40), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (7,45--7,51)), (7,45--7,51)), - false, (7,41--7,55)))], (7,0--7,58), - { OpeningBraceRange = (7,0--7,2) }), (7,0--7,58))], + [SynExprRecordField + ((SynLongIdent ([Outer], [], [None]), true), + Some (7,9--7,10), + Some + (AnonRecd + (false, None, + [SynExprRecordField + ((SynLongIdent ([Inner], [], [None]), true), + Some (7,20--7,21), + Some + (Quote + (Ident op_Quotation, false, + Const (Int32 1, (7,25--7,26)), false, + (7,22--7,29))), (7,14--7,29), None)], + (7,11--7,31), { OpeningBraceRange = (7,11--7,13) })), + (7,3--7,31), Some (Semicolon ((7,31--7,32), Some (7,32)))); + SynExprRecordField + ((SynLongIdent ([Other], [], [None]), true), + Some (7,39--7,40), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (7,45--7,51)), + (7,45--7,51)), false, (7,41--7,55))), (7,33--7,55), + None)], (7,0--7,58), { OpeningBraceRange = (7,0--7,2) }), + (7,0--7,58))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,58), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl index 292574469cd..de20a97e5f8 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl @@ -7,15 +7,17 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([X], [], [None]), Some (1,5--1,6), - Const (Int32 1, (1,7--1,8)))], (1,0--1,11), - { OpeningBraceRange = (1,0--1,2) }), (1,0--1,11)); + [SynExprRecordField + ((SynLongIdent ([X], [], [None]), true), Some (1,5--1,6), + Some (Const (Int32 1, (1,7--1,8))), (1,3--1,8), None)], + (1,0--1,11), { OpeningBraceRange = (1,0--1,2) }), (1,0--1,11)); Expr (AnonRecd (true, None, - [(SynLongIdent ([Y], [], [None]), Some (2,12--2,13), - Const (Int32 2, (2,14--2,15)))], (2,0--2,18), - { OpeningBraceRange = (2,7--2,9) }), (2,0--2,18)); + [SynExprRecordField + ((SynLongIdent ([Y], [], [None]), true), Some (2,12--2,13), + Some (Const (Int32 2, (2,14--2,15))), (2,10--2,15), None)], + (2,0--2,18), { OpeningBraceRange = (2,7--2,9) }), (2,0--2,18)); Expr (AnonRecd (false, None, [], (3,0--3,5), { OpeningBraceRange = (3,0--3,2) }), diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl index fc0a410b79e..d478b60f69a 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl @@ -7,9 +7,10 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([X], [], [None]), Some (1,5--1,6), - Const (Int32 0, (1,7--1,8)))], (1,0--2,0), - { OpeningBraceRange = (1,0--1,2) }), (1,0--2,0))], + [SynExprRecordField + ((SynLongIdent ([X], [], [None]), true), Some (1,5--1,6), + Some (Const (Int32 0, (1,7--1,8))), (1,3--1,8), None)], + (1,0--2,0), { OpeningBraceRange = (1,0--1,2) }), (1,0--2,0))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl index 4582e5eca53..4b2cf1a6e4a 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl @@ -7,9 +7,10 @@ ImplFile [Expr (AnonRecd (true, None, - [(SynLongIdent ([X], [], [None]), Some (1,12--1,13), - Const (Int32 0, (1,14--1,15)))], (1,0--2,0), - { OpeningBraceRange = (1,7--1,9) }), (1,0--2,0))], + [SynExprRecordField + ((SynLongIdent ([X], [], [None]), true), Some (1,12--1,13), + Some (Const (Int32 0, (1,14--1,15))), (1,10--1,15), None)], + (1,0--2,0), { OpeningBraceRange = (1,7--1,9) }), (1,0--2,0))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl index 28d315f97af..239c2fa8e63 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl @@ -20,11 +20,18 @@ ImplFile None, (1,4--1,7)), None, AnonRecd (false, Some (Ident x, Offside ((1,15--1,19), None)), - [(SynLongIdent ([R; D], [(1,21--1,22)], [None; None]), - Some (1,24--1,25), - Const (String ("s", Regular, (1,26--1,29)), (1,26--1,29))); - (SynLongIdent ([A], [], [None]), Some (1,33--1,34), - Const (Int32 3, (1,35--1,36)))], (1,10--1,39), + [SynExprRecordField + ((SynLongIdent ([R; D], [(1,21--1,22)], [None; None]), + true), Some (1,24--1,25), + Some + (Const + (String ("s", Regular, (1,26--1,29)), (1,26--1,29))), + (1,20--1,29), + Some (Semicolon ((1,29--1,30), Some (1,30)))); + SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), + Some (1,33--1,34), Some (Const (Int32 3, (1,35--1,36))), + (1,31--1,36), None)], (1,10--1,39), { OpeningBraceRange = (1,10--1,12) }), (1,4--1,7), NoneAtLet, { LeadingKeyword = Let (1,0--1,3) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl index a8ff99d1b82..0df556269ff 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl @@ -7,47 +7,59 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), - Const - (Measure - (Int32 1, (3,4--3,5), - Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), - { LessRange = (3,5--3,6) - GreaterRange = (3,7--3,8) }), (3,4--3,8)))], - (3,0--3,11), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,11)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,3--3,4), + Some + (Const + (Measure + (Int32 1, (3,4--3,5), + Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), + { LessRange = (3,5--3,6) + GreaterRange = (3,7--3,8) }), (3,4--3,8))), + (3,2--3,8), None)], (3,0--3,11), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,11)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), - Const - (Measure - (Int32 1, (5,4--5,5), - Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), - { LessRange = (5,5--5,6) - GreaterRange = (5,7--5,8) }), (5,4--5,8)))], - (5,0--5,10), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,10)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,3--5,4), + Some + (Const + (Measure + (Int32 1, (5,4--5,5), + Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), + { LessRange = (5,5--5,6) + GreaterRange = (5,7--5,8) }), (5,4--5,8))), + (5,2--5,8), None)], (5,0--5,10), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,10)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), - Const - (Measure - (Int32 1, (7,5--7,6), - Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), - { LessRange = (7,6--7,7) - GreaterRange = (7,8--7,9) }), (7,5--7,9)))], - (7,0--7,11), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,11)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (7,4--7,5), + Some + (Const + (Measure + (Int32 1, (7,5--7,6), + Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), + { LessRange = (7,6--7,7) + GreaterRange = (7,8--7,9) }), (7,5--7,9))), + (7,3--7,9), None)], (7,0--7,11), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,11)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), - Const - (Measure - (Int32 1, (9,5--9,6), - Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), - { LessRange = (9,6--9,7) - GreaterRange = (9,8--9,9) }), (9,5--9,9)))], - (9,0--9,12), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,12))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (9,4--9,5), + Some + (Const + (Measure + (Int32 1, (9,5--9,6), + Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), + { LessRange = (9,6--9,7) + GreaterRange = (9,8--9,9) }), (9,5--9,9))), + (9,3--9,9), None)], (9,0--9,12), + { OpeningBraceRange = (9,0--9,2) }), (9,0--9,12))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl index ed640191c59..8cb723c2d7d 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl @@ -7,75 +7,99 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), - Const - (Measure - (Int32 1, (3,4--3,5), - Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), - { LessRange = (3,5--3,6) - GreaterRange = (3,7--3,8) }), (3,4--3,8))); - (SynLongIdent ([b], [], [None]), Some (3,11--3,12), - Const - (Measure - (Int32 2, (3,12--3,13), - Seq ([Named ([m], (3,14--3,15))], (3,14--3,15)), - { LessRange = (3,13--3,14) - GreaterRange = (3,15--3,16) }), (3,12--3,16)))], - (3,0--3,19), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,19)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,3--3,4), + Some + (Const + (Measure + (Int32 1, (3,4--3,5), + Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), + { LessRange = (3,5--3,6) + GreaterRange = (3,7--3,8) }), (3,4--3,8))), + (3,2--3,8), Some (Semicolon ((3,8--3,9), Some (3,9)))); + SynExprRecordField + ((SynLongIdent ([b], [], [None]), true), Some (3,11--3,12), + Some + (Const + (Measure + (Int32 2, (3,12--3,13), + Seq ([Named ([m], (3,14--3,15))], (3,14--3,15)), + { LessRange = (3,13--3,14) + GreaterRange = (3,15--3,16) }), (3,12--3,16))), + (3,10--3,16), None)], (3,0--3,19), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,19)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), - Const - (Measure - (Int32 1, (5,4--5,5), - Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), - { LessRange = (5,5--5,6) - GreaterRange = (5,7--5,8) }), (5,4--5,8))); - (SynLongIdent ([b], [], [None]), Some (5,11--5,12), - Const - (Measure - (Int32 2, (5,12--5,13), - Seq ([Named ([m], (5,14--5,15))], (5,14--5,15)), - { LessRange = (5,13--5,14) - GreaterRange = (5,15--5,16) }), (5,12--5,16)))], - (5,0--5,18), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,3--5,4), + Some + (Const + (Measure + (Int32 1, (5,4--5,5), + Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), + { LessRange = (5,5--5,6) + GreaterRange = (5,7--5,8) }), (5,4--5,8))), + (5,2--5,8), Some (Semicolon ((5,8--5,9), Some (5,9)))); + SynExprRecordField + ((SynLongIdent ([b], [], [None]), true), Some (5,11--5,12), + Some + (Const + (Measure + (Int32 2, (5,12--5,13), + Seq ([Named ([m], (5,14--5,15))], (5,14--5,15)), + { LessRange = (5,13--5,14) + GreaterRange = (5,15--5,16) }), (5,12--5,16))), + (5,10--5,16), None)], (5,0--5,18), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), - Const - (Measure - (Int32 1, (7,5--7,6), - Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), - { LessRange = (7,6--7,7) - GreaterRange = (7,8--7,9) }), (7,5--7,9))); - (SynLongIdent ([b], [], [None]), Some (7,12--7,13), - Const - (Measure - (Int32 2, (7,13--7,14), - Seq ([Named ([m], (7,15--7,16))], (7,15--7,16)), - { LessRange = (7,14--7,15) - GreaterRange = (7,16--7,17) }), (7,13--7,17)))], - (7,0--7,19), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,19)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (7,4--7,5), + Some + (Const + (Measure + (Int32 1, (7,5--7,6), + Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), + { LessRange = (7,6--7,7) + GreaterRange = (7,8--7,9) }), (7,5--7,9))), + (7,3--7,9), Some (Semicolon ((7,9--7,10), Some (7,10)))); + SynExprRecordField + ((SynLongIdent ([b], [], [None]), true), Some (7,12--7,13), + Some + (Const + (Measure + (Int32 2, (7,13--7,14), + Seq ([Named ([m], (7,15--7,16))], (7,15--7,16)), + { LessRange = (7,14--7,15) + GreaterRange = (7,16--7,17) }), (7,13--7,17))), + (7,11--7,17), None)], (7,0--7,19), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,19)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), - Const - (Measure - (Int32 1, (9,5--9,6), - Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), - { LessRange = (9,6--9,7) - GreaterRange = (9,8--9,9) }), (9,5--9,9))); - (SynLongIdent ([b], [], [None]), Some (9,12--9,13), - Const - (Measure - (Int32 2, (9,13--9,14), - Seq ([Named ([m], (9,15--9,16))], (9,15--9,16)), - { LessRange = (9,14--9,15) - GreaterRange = (9,16--9,17) }), (9,13--9,17)))], - (9,0--9,20), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,20))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (9,4--9,5), + Some + (Const + (Measure + (Int32 1, (9,5--9,6), + Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), + { LessRange = (9,6--9,7) + GreaterRange = (9,8--9,9) }), (9,5--9,9))), + (9,3--9,9), Some (Semicolon ((9,9--9,10), Some (9,10)))); + SynExprRecordField + ((SynLongIdent ([b], [], [None]), true), Some (9,12--9,13), + Some + (Const + (Measure + (Int32 2, (9,13--9,14), + Seq ([Named ([m], (9,15--9,16))], (9,15--9,16)), + { LessRange = (9,14--9,15) + GreaterRange = (9,16--9,17) }), (9,13--9,17))), + (9,11--9,17), None)], (9,0--9,20), + { OpeningBraceRange = (9,0--9,2) }), (9,0--9,20))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl index ec7c2e4e312..06ab77e3af0 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl @@ -7,39 +7,51 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), - TypeApp - (Ident typeof, (3,10--3,11), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (3,14--3,15), (3,10--3,15), (3,4--3,15)))], - (3,0--3,17), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,17)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,3--3,4), + Some + (TypeApp + (Ident typeof, (3,10--3,11), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (3,14--3,15), (3,10--3,15), (3,4--3,15))), + (3,2--3,15), None)], (3,0--3,17), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,17)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), - TypeApp - (Ident typeof, (5,10--5,11), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (5,14--5,15), (5,10--5,15), (5,4--5,15)))], - (5,0--5,18), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,3--5,4), + Some + (TypeApp + (Ident typeof, (5,10--5,11), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (5,14--5,15), (5,10--5,15), (5,4--5,15))), + (5,2--5,15), None)], (5,0--5,18), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), - TypeApp - (Ident typeof, (7,11--7,12), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (7,15--7,16), (7,11--7,16), (7,5--7,16)))], - (7,0--7,18), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,18)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (7,4--7,5), + Some + (TypeApp + (Ident typeof, (7,11--7,12), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (7,15--7,16), (7,11--7,16), (7,5--7,16))), + (7,3--7,16), None)], (7,0--7,18), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,18)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), - TypeApp - (Ident typeof, (9,11--9,12), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (9,15--9,16), (9,11--9,16), (9,5--9,16)))], - (9,0--9,19), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,19))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (9,4--9,5), + Some + (TypeApp + (Ident typeof, (9,11--9,12), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (9,15--9,16), (9,11--9,16), (9,5--9,16))), + (9,3--9,16), None)], (9,0--9,19), + { OpeningBraceRange = (9,0--9,2) }), (9,0--9,19))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl index a30127b522f..9704bd825a1 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl @@ -7,46 +7,58 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), - TypeApp - (Ident typedefof, (3,13--3,14), - [App - (LongIdent (SynLongIdent ([option], [], [None])), None, - [Anon (3,14--3,15)], [], None, true, (3,14--3,22))], - [], Some (3,22--3,23), (3,13--3,23), (3,4--3,23)))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,3--3,4), + Some + (TypeApp + (Ident typedefof, (3,13--3,14), + [App + (LongIdent (SynLongIdent ([option], [], [None])), + None, [Anon (3,14--3,15)], [], None, true, + (3,14--3,22))], [], Some (3,22--3,23), + (3,13--3,23), (3,4--3,23))), (3,2--3,23), None)], (3,0--3,25), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,25)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), - TypeApp - (Ident typedefof, (5,13--5,14), - [App - (LongIdent (SynLongIdent ([option], [], [None])), None, - [Anon (5,14--5,15)], [], None, true, (5,14--5,22))], - [], Some (5,22--5,23), (5,13--5,23), (5,4--5,23)))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,3--5,4), + Some + (TypeApp + (Ident typedefof, (5,13--5,14), + [App + (LongIdent (SynLongIdent ([option], [], [None])), + None, [Anon (5,14--5,15)], [], None, true, + (5,14--5,22))], [], Some (5,22--5,23), + (5,13--5,23), (5,4--5,23))), (5,2--5,23), None)], (5,0--5,26), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,26)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), - TypeApp - (Ident typedefof, (7,14--7,15), - [App - (LongIdent (SynLongIdent ([option], [], [None])), None, - [Anon (7,15--7,16)], [], None, true, (7,15--7,23))], - [], Some (7,23--7,24), (7,14--7,24), (7,5--7,24)))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (7,4--7,5), + Some + (TypeApp + (Ident typedefof, (7,14--7,15), + [App + (LongIdent (SynLongIdent ([option], [], [None])), + None, [Anon (7,15--7,16)], [], None, true, + (7,15--7,23))], [], Some (7,23--7,24), + (7,14--7,24), (7,5--7,24))), (7,3--7,24), None)], (7,0--7,26), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,26)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), - TypeApp - (Ident typedefof, (9,14--9,15), - [App - (LongIdent (SynLongIdent ([option], [], [None])), None, - [Anon (9,15--9,16)], [], None, true, (9,15--9,23))], - [], Some (9,23--9,24), (9,14--9,24), (9,5--9,24)))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (9,4--9,5), + Some + (TypeApp + (Ident typedefof, (9,14--9,15), + [App + (LongIdent (SynLongIdent ([option], [], [None])), + None, [Anon (9,15--9,16)], [], None, true, + (9,15--9,23))], [], Some (9,23--9,24), + (9,14--9,24), (9,5--9,24))), (9,3--9,24), None)], (9,0--9,27), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,27))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,27), { LeadingKeyword = Module (1,0--1,6) })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl index 180ed425c9e..485de8f499b 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl @@ -23,16 +23,19 @@ ImplFile false)), Pats [], None, (3,4--3,9)), None, AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,15--3,16), - TypeApp - (Ident nameof, (3,22--3,23), - [Var (SynTypar (T, None, false), (3,23--3,25))], [], - Some (3,25--3,26), (3,22--3,26), (3,16--3,26)))], - (3,12--3,28), { OpeningBraceRange = (3,12--3,14) }), - (3,4--3,9), NoneAtLet, { LeadingKeyword = Let (3,0--3,3) - InlineKeyword = None - EqualsRange = Some (3,10--3,11) })], - (3,0--3,28)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), + Some (3,15--3,16), + Some + (TypeApp + (Ident nameof, (3,22--3,23), + [Var (SynTypar (T, None, false), (3,23--3,25))], + [], Some (3,25--3,26), (3,22--3,26), (3,16--3,26))), + (3,14--3,26), None)], (3,12--3,28), + { OpeningBraceRange = (3,12--3,14) }), (3,4--3,9), + NoneAtLet, { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,10--3,11) })], (3,0--3,28)); Let (false, [SynBinding @@ -52,16 +55,19 @@ ImplFile false)), Pats [], None, (5,4--5,9)), None, AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,15--5,16), - TypeApp - (Ident nameof, (5,22--5,23), - [Var (SynTypar (T, None, false), (5,23--5,25))], [], - Some (5,25--5,26), (5,22--5,26), (5,16--5,26)))], - (5,12--5,29), { OpeningBraceRange = (5,12--5,14) }), - (5,4--5,9), NoneAtLet, { LeadingKeyword = Let (5,0--5,3) - InlineKeyword = None - EqualsRange = Some (5,10--5,11) })], - (5,0--5,29)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), + Some (5,15--5,16), + Some + (TypeApp + (Ident nameof, (5,22--5,23), + [Var (SynTypar (T, None, false), (5,23--5,25))], + [], Some (5,25--5,26), (5,22--5,26), (5,16--5,26))), + (5,14--5,26), None)], (5,12--5,29), + { OpeningBraceRange = (5,12--5,14) }), (5,4--5,9), + NoneAtLet, { LeadingKeyword = Let (5,0--5,3) + InlineKeyword = None + EqualsRange = Some (5,10--5,11) })], (5,0--5,29)); Let (false, [SynBinding @@ -81,16 +87,19 @@ ImplFile false)), Pats [], None, (7,4--7,9)), None, AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,16--7,17), - TypeApp - (Ident nameof, (7,23--7,24), - [Var (SynTypar (T, None, false), (7,24--7,26))], [], - Some (7,26--7,27), (7,23--7,27), (7,17--7,27)))], - (7,12--7,29), { OpeningBraceRange = (7,12--7,14) }), - (7,4--7,9), NoneAtLet, { LeadingKeyword = Let (7,0--7,3) - InlineKeyword = None - EqualsRange = Some (7,10--7,11) })], - (7,0--7,29)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), + Some (7,16--7,17), + Some + (TypeApp + (Ident nameof, (7,23--7,24), + [Var (SynTypar (T, None, false), (7,24--7,26))], + [], Some (7,26--7,27), (7,23--7,27), (7,17--7,27))), + (7,15--7,27), None)], (7,12--7,29), + { OpeningBraceRange = (7,12--7,14) }), (7,4--7,9), + NoneAtLet, { LeadingKeyword = Let (7,0--7,3) + InlineKeyword = None + EqualsRange = Some (7,10--7,11) })], (7,0--7,29)); Let (false, [SynBinding @@ -110,16 +119,19 @@ ImplFile false)), Pats [], None, (9,4--9,9)), None, AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,16--9,17), - TypeApp - (Ident nameof, (9,23--9,24), - [Var (SynTypar (T, None, false), (9,24--9,26))], [], - Some (9,26--9,27), (9,23--9,27), (9,17--9,27)))], - (9,12--9,30), { OpeningBraceRange = (9,12--9,14) }), - (9,4--9,9), NoneAtLet, { LeadingKeyword = Let (9,0--9,3) - InlineKeyword = None - EqualsRange = Some (9,10--9,11) })], - (9,0--9,30))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), + Some (9,16--9,17), + Some + (TypeApp + (Ident nameof, (9,23--9,24), + [Var (SynTypar (T, None, false), (9,24--9,26))], + [], Some (9,26--9,27), (9,23--9,27), (9,17--9,27))), + (9,15--9,27), None)], (9,12--9,30), + { OpeningBraceRange = (9,12--9,14) }), (9,4--9,9), + NoneAtLet, { LeadingKeyword = Let (9,0--9,3) + InlineKeyword = None + EqualsRange = Some (9,10--9,11) })], (9,0--9,30))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,30), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl index 1de6c8767d2..4d76074cab3 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl @@ -7,39 +7,51 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), - TypeApp - (Ident id, (3,6--3,7), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (3,10--3,11), (3,6--3,11), (3,4--3,11)))], - (3,0--3,13), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,13)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,3--3,4), + Some + (TypeApp + (Ident id, (3,6--3,7), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (3,10--3,11), (3,6--3,11), (3,4--3,11))), + (3,2--3,11), None)], (3,0--3,13), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,13)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), - TypeApp - (Ident id, (5,6--5,7), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (5,10--5,11), (5,6--5,11), (5,4--5,11)))], - (5,0--5,14), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,14)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,3--5,4), + Some + (TypeApp + (Ident id, (5,6--5,7), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (5,10--5,11), (5,6--5,11), (5,4--5,11))), + (5,2--5,11), None)], (5,0--5,14), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,14)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), - TypeApp - (Ident id, (7,7--7,8), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (7,11--7,12), (7,7--7,12), (7,5--7,12)))], - (7,0--7,14), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,14)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (7,4--7,5), + Some + (TypeApp + (Ident id, (7,7--7,8), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (7,11--7,12), (7,7--7,12), (7,5--7,12))), + (7,3--7,12), None)], (7,0--7,14), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,14)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), - TypeApp - (Ident id, (9,7--9,8), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (9,11--9,12), (9,7--9,12), (9,5--9,12)))], - (9,0--9,15), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,15))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (9,4--9,5), + Some + (TypeApp + (Ident id, (9,7--9,8), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (9,11--9,12), (9,7--9,12), (9,5--9,12))), + (9,3--9,12), None)], (9,0--9,15), + { OpeningBraceRange = (9,0--9,2) }), (9,0--9,15))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl index ede1aa9a366..31f5cc2a9f2 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl @@ -7,18 +7,24 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,4--3,5), - Quote - (Ident op_Quotation, false, Const (Int32 3, (3,9--3,10)), - false, (3,6--3,13)))], (3,0--3,16), + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,4--3,5), + Some + (Quote + (Ident op_Quotation, false, + Const (Int32 3, (3,9--3,10)), false, (3,6--3,13))), + (3,2--3,13), None)], (3,0--3,16), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,16)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,4--5,5), - Quote - (Ident op_Quotation, false, Const (Int32 3, (5,9--5,10)), - false, (5,6--5,13)))], (5,0--5,15), + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,4--5,5), + Some + (Quote + (Ident op_Quotation, false, + Const (Int32 3, (5,9--5,10)), false, (5,6--5,13))), + (5,2--5,13), None)], (5,0--5,15), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,15))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl index 409a6349663..9f55c85b4c4 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl @@ -7,9 +7,10 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F], [], [None]), Some (3,5--3,6), - Const (Int32 1, (3,7--3,8)))], (3,0--3,11), - { OpeningBraceRange = (3,0--3,2) }), (3,0--3,11))], + [SynExprRecordField + ((SynLongIdent ([F], [], [None]), true), Some (3,5--3,6), + Some (Const (Int32 1, (3,7--3,8))), (3,3--3,8), None)], + (3,0--3,11), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,11))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl index abb4f9c61af..f33c99851d7 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl @@ -7,8 +7,9 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F], [], [None]), Some (3,5--3,6), - ArbitraryAfterError ("anonField", (3,3--3,4)))], (3,0--3,9), + [SynExprRecordField + ((SynLongIdent ([F], [], [None]), true), Some (3,5--3,6), + None, (3,3--3,6), None)], (3,0--3,9), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,9))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl index 0a2441bca98..df23b9de76e 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl @@ -7,10 +7,13 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F1], [], [None]), Some (3,6--3,7), - Const (Int32 1, (3,8--3,9))); - (SynLongIdent ([F2], [], [None]), Some (4,6--4,7), - ArbitraryAfterError ("anonField", (4,3--4,5)))], (3,0--4,10), + [SynExprRecordField + ((SynLongIdent ([F1], [], [None]), true), Some (3,6--3,7), + Some (Const (Int32 1, (3,8--3,9))), (3,3--3,9), + Some (Offside ((3,10--4,3), None))); + SynExprRecordField + ((SynLongIdent ([F2], [], [None]), true), Some (4,6--4,7), + None, (4,3--4,7), None)], (3,0--4,10), { OpeningBraceRange = (3,0--3,2) }), (3,0--4,10))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl index 70fdc8e6a09..c03a6523551 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl @@ -7,10 +7,13 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F1], [], [None]), Some (3,6--3,7), - Const (Int32 1, (3,8--3,9))); - (SynLongIdent ([F2], [], [None]), None, - ArbitraryAfterError ("anonField", (4,3--4,5)))], (3,0--4,8), + [SynExprRecordField + ((SynLongIdent ([F1], [], [None]), true), Some (3,6--3,7), + Some (Const (Int32 1, (3,8--3,9))), (3,3--3,9), + Some (Offside ((3,10--4,3), None))); + SynExprRecordField + ((SynLongIdent ([F2], [], [None]), true), None, None, + (4,3--4,5), None)], (3,0--4,8), { OpeningBraceRange = (3,0--3,2) }), (3,0--4,8))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl index c40cd96963e..1cc58c33049 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl @@ -7,20 +7,26 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F1], [], [None]), Some (3,6--3,7), - Const (Int32 1, (3,8--3,9))); - (SynLongIdent ([F2], [], [None]), Some (4,6--4,7), - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Equality], [], [Some (OriginalNotation "=")]), - None, (5,6--5,7)), Ident F3, (5,3--5,7)), - Const (Int32 3, (5,8--5,9)), (5,3--5,9)))], (3,0--5,12), - { OpeningBraceRange = (3,0--3,2) }), (3,0--5,12))], + [SynExprRecordField + ((SynLongIdent ([F1], [], [None]), true), Some (3,6--3,7), + Some (Const (Int32 1, (3,8--3,9))), (3,3--3,9), + Some (Offside ((3,10--4,3), None))); + SynExprRecordField + ((SynLongIdent ([F2], [], [None]), true), Some (4,6--4,7), + Some + (App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Equality], [], + [Some (OriginalNotation "=")]), None, + (5,6--5,7)), Ident F3, (5,3--5,7)), + Const (Int32 3, (5,8--5,9)), (5,3--5,9))), (4,3--5,9), + None)], (3,0--5,12), { OpeningBraceRange = (3,0--3,2) }), + (3,0--5,12))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl index cc908ff2853..4921cb9582d 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl @@ -7,13 +7,17 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F1], [], [None]), Some (3,6--3,7), - Const (Int32 1, (3,8--3,9))); - (SynLongIdent ([F2], [], [None]), None, - ArbitraryAfterError ("anonField", (4,3--4,5))); - (SynLongIdent ([F3], [], [None]), Some (5,6--5,7), - Const (Int32 3, (5,8--5,9)))], (3,0--5,12), - { OpeningBraceRange = (3,0--3,2) }), (3,0--5,12))], + [SynExprRecordField + ((SynLongIdent ([F1], [], [None]), true), Some (3,6--3,7), + Some (Const (Int32 1, (3,8--3,9))), (3,3--3,9), + Some (Offside ((3,10--4,3), None))); + SynExprRecordField + ((SynLongIdent ([F2], [], [None]), true), None, None, + (4,3--4,5), Some (Offside ((4,6--5,3), None))); + SynExprRecordField + ((SynLongIdent ([F3], [], [None]), true), Some (5,6--5,7), + Some (Const (Int32 3, (5,8--5,9))), (5,3--5,9), None)], + (3,0--5,12), { OpeningBraceRange = (3,0--3,2) }), (3,0--5,12))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl index 4fe46cfb3d5..ab92e60fd1a 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl @@ -7,18 +7,22 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F1], [], [None]), Some (3,6--3,7), - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Equality], [], [Some (OriginalNotation "=")]), - None, (4,6--4,7)), Ident F2, (4,3--4,7)), - Const (Int32 2, (4,8--4,9)), (4,3--4,9)))], (3,0--4,12), - { OpeningBraceRange = (3,0--3,2) }), (3,0--4,12))], + [SynExprRecordField + ((SynLongIdent ([F1], [], [None]), true), Some (3,6--3,7), + Some + (App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Equality], [], + [Some (OriginalNotation "=")]), None, + (4,6--4,7)), Ident F2, (4,3--4,7)), + Const (Int32 2, (4,8--4,9)), (4,3--4,9))), (3,3--4,9), + None)], (3,0--4,12), { OpeningBraceRange = (3,0--3,2) }), + (3,0--4,12))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl index abb76d98ae6..7d528a8649e 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl @@ -7,8 +7,9 @@ ImplFile [Expr (AnonRecd (true, None, - [(SynLongIdent ([Foo], [], [None]), Some (3,11--3,12), - Ident someValue)], (2,0--5,16), + [SynExprRecordField + ((SynLongIdent ([Foo], [], [None]), true), Some (3,11--3,12), + Some (Ident someValue), (3,7--5,13), None)], (2,0--5,16), { OpeningBraceRange = (3,4--3,6) }), (2,0--5,16)); Expr (AnonRecd diff --git a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl index e7e6666975a..2fbff28254e 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl @@ -10,13 +10,18 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([X], [], [None]), Some (2,5--2,6), - Const (Int32 5, (2,7--2,8))); - (SynLongIdent ([Y], [], [None]), Some (3,8--3,9), - Const (Int32 6, (3,10--3,11))); - (SynLongIdent ([Z], [], [None]), Some (4,12--4,13), - Const (Int32 7, (4,14--4,15)))], (2,0--4,18), - { OpeningBraceRange = (2,0--2,2) }), (2,0--4,18))], + [SynExprRecordField + ((SynLongIdent ([X], [], [None]), true), Some (2,5--2,6), + Some (Const (Int32 5, (2,7--2,8))), (2,3--2,8), + Some (Offside ((2,9--3,3), None))); + SynExprRecordField + ((SynLongIdent ([Y], [], [None]), true), Some (3,8--3,9), + Some (Const (Int32 6, (3,10--3,11))), (3,3--3,11), + Some (Offside ((3,12--4,3), None))); + SynExprRecordField + ((SynLongIdent ([Z], [], [None]), true), Some (4,12--4,13), + Some (Const (Int32 7, (4,14--4,15))), (4,3--4,15), None)], + (2,0--4,18), { OpeningBraceRange = (2,0--2,2) }), (2,0--4,18))], PreXmlDocEmpty, [], None, (2,0--4,18), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] From 5ce8cdccf5eedaffbac1f13615a1d7526033865c Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Tue, 16 Sep 2025 22:18:36 +0100 Subject: [PATCH 2/5] Unify anonymous record fields --- .../Checking/CheckRecordSyntaxHelpers.fs | 14 +- .../Checking/Expressions/CheckExpressions.fs | 69 ++++-- .../GraphChecking/FileContentMapping.fs | 34 ++- .../Service/FSharpParseFileResults.fs | 24 +- src/Compiler/Service/ServiceParseTreeWalk.fs | 215 ++++++++---------- src/Compiler/Service/SynExpr.fs | 12 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 2 +- src/Compiler/SyntaxTree/SyntaxTree.fsi | 2 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 20 +- src/Compiler/pars.fsy | 10 - ...iler.Service.SurfaceArea.netstandard20.bsl | 8 +- .../Expression/AnonRecd - Quotation 01.fs.bsl | 105 +++++---- .../Expression/AnonRecd - Quotation 02.fs.bsl | 105 +++++---- .../Expression/AnonRecd - Quotation 03.fs.bsl | 150 ++++++------ .../Expression/AnonRecd - Quotation 04.fs.bsl | 125 ++++++---- .../Expression/AnonymousRecords-01.fs.bsl | 14 +- .../Expression/AnonymousRecords-02.fs.bsl | 7 +- .../Expression/AnonymousRecords-03.fs.bsl | 7 +- .../Expression/AnonymousRecords-06.fs.bsl | 17 +- .../Expression/AnonymousRecords-07.fs.bsl | 76 ++++--- .../Expression/AnonymousRecords-08.fs.bsl | 144 +++++++----- .../Expression/AnonymousRecords-09.fs.bsl | 60 +++-- .../Expression/AnonymousRecords-10.fs.bsl | 68 +++--- .../Expression/AnonymousRecords-11.fs.bsl | 92 ++++---- .../Expression/AnonymousRecords-12.fs.bsl | 60 +++-- .../Expression/AnonymousRecords-13.fs.bsl | 22 +- .../Expression/Record - Anon 01.fs.bsl | 7 +- .../Expression/Record - Anon 02.fs.bsl | 5 +- .../Expression/Record - Anon 07.fs.bsl | 11 +- .../Expression/Record - Anon 08.fs.bsl | 11 +- .../Expression/Record - Anon 09.fs.bsl | 34 +-- .../Expression/Record - Anon 10.fs.bsl | 18 +- .../Expression/Record - Anon 11.fs.bsl | 28 ++- .../SynExprAnonRecdWithStructKeyword.fs.bsl | 5 +- ...sTheRangeOfTheEqualsSignInTheFields.fs.bsl | 19 +- 35 files changed, 890 insertions(+), 710 deletions(-) diff --git a/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs b/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs index c4836865f79..9c4fc52611d 100644 --- a/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs +++ b/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs @@ -100,7 +100,7 @@ let TransformAstForNestedUpdates (cenv: TcFileState) (env: TcEnv) overallTy (lid ) | _ -> None - let rec synExprRecd copyInfo (outerFieldId: Ident) innerFields exprBeingAssigned = + let rec synExprRecd copyInfo (outerFieldId: Ident) innerFields (exprBeingAssigned: SynExpr) = match innerFields with | [] -> failwith "unreachable" | (fieldId: Ident, item) :: rest -> @@ -115,11 +115,13 @@ let TransformAstForNestedUpdates (cenv: TcFileState) (env: TcEnv) overallTy (lid synExprRecd copyInfo fieldId rest exprBeingAssigned match item with - | Item.AnonRecdField( - anonInfo = { - AnonRecdTypeInfo.TupInfo = TupInfo.Const isStruct - }) -> - let fields = [ LongIdentWithDots([ fieldId ], []), None, nestedField ] + | Item.AnonRecdField(anonInfo = { TupInfo = TupInfo.Const isStruct }) -> + let fieldName = (SynLongIdent([ fieldId ], [], [ None ]), true) + let fieldRange = unionRanges fieldId.idRange nestedField.Range + + let fields = + [ SynExprRecordField(fieldName, None, Some nestedField, fieldRange, None) ] + SynExpr.AnonRecd(isStruct, copyInfo outerFieldId, fields, outerFieldId.idRange, { OpeningBraceRange = range0 }) | _ -> let fields = diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 9aaf8d472a8..87567e9eb8e 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -7855,42 +7855,69 @@ and CheckAnonRecdExprDuplicateFields (elems: Ident array) = errorR(Error (FSComp.SR.tcAnonRecdDuplicateFieldId(uc1.idText), uc1.idRange)))) // Check '{| .... |}' -and TcAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, optOrigSynExpr, unsortedFieldIdsAndSynExprsGiven, mWholeExpr) = +and TcAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, optOrigSynExpr, recordFields: SynExprRecordField list, mWholeExpr) = match optOrigSynExpr with | None -> - TcNewAnonRecdExpr cenv overallTy env tpenv (isStruct, unsortedFieldIdsAndSynExprsGiven, mWholeExpr) + TcNewAnonRecdExpr cenv overallTy env tpenv (isStruct, recordFields, mWholeExpr) | Some orig -> // Ideally we should also check for duplicate field IDs in the TcCopyAndUpdateAnonRecdExpr case, but currently the logic is too complex to guarantee a proper error reporting // So here we error instead errorR to avoid cascading internal errors - unsortedFieldIdsAndSynExprsGiven - |> List.countBy (fun (fId, _, _) -> textOfLid fId.LongIdent) + recordFields + |> List.countBy (fun (SynExprRecordField(fieldName = (fId, _))) -> textOfLid fId.LongIdent) |> List.iter (fun (label, count) -> if count > 1 then error (Error (FSComp.SR.tcAnonRecdDuplicateFieldId(label), mWholeExpr))) - TcCopyAndUpdateAnonRecdExpr cenv overallTy env tpenv (isStruct, orig, unsortedFieldIdsAndSynExprsGiven, mWholeExpr) + TcCopyAndUpdateAnonRecdExpr cenv overallTy env tpenv (isStruct, orig, recordFields, mWholeExpr) -and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, unsortedFieldIdsAndSynExprsGiven, mWholeExpr) = +and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, recordFields: SynExprRecordField list, mWholeExpr) = let g = cenv.g - let unsortedFieldSynExprsGiven = unsortedFieldIdsAndSynExprsGiven |> List.map (fun (_, _, fieldExpr) -> fieldExpr) - let unsortedFieldIds = unsortedFieldIdsAndSynExprsGiven |> List.map (fun (synLongIdent, _, _) -> synLongIdent.LongIdent[0]) |> List.toArray - let anonInfo, sortedFieldTys = UnifyAnonRecdTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv mWholeExpr overallTy isStruct unsortedFieldIds + + // For new anonymous records, each field label must be a single identifier. + // If a long identifier is given, report an error and skip that entry for typechecking purposes. + // Also normalize missing expressions to an error expression to keep traversal stable. + let validFields : (Ident * SynExpr * SynLongIdent) list = + recordFields + |> List.choose (fun (SynExprRecordField(fieldName = (synLongIdent, _); expr = expr)) -> + match synLongIdent.LongIdent with + | [ id ] -> + let exprGiven = + match expr with + | Some expr -> expr + | None -> arbExpr ("anonField", synLongIdent.Range) + Some(id, exprGiven, synLongIdent) + | [] -> + // Should not occur for anonymous record expressions; silently skip with a diagnostic. + errorR (Error(FSComp.SR.parsInvalidAnonRecdType(), synLongIdent.Range)) + None + | _ -> + // Nested labels are only valid in copy-and-update; not allowed for new anonymous records + errorR (Error(FSComp.SR.parsInvalidAnonRecdType(), synLongIdent.Range)) + None) + + let unsortedFieldSynExprsGiven = validFields |> List.map (fun (_, e, _) -> e) + + let unsortedFieldIds = validFields |> List.map (fun (id, _, _) -> id) |> List.toArray + + let anonInfo, sortedFieldTys = + UnifyAnonRecdTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv mWholeExpr overallTy isStruct unsortedFieldIds if unsortedFieldIds.Length > 1 then CheckAnonRecdExprDuplicateFields unsortedFieldIds // Sort into canonical order let sortedIndexedArgs = - unsortedFieldIdsAndSynExprsGiven + validFields |> List.indexed |> List.sortBy (fun (i,_) -> unsortedFieldIds[i].idText) // Map from sorted indexes to unsorted indexes let sigma = sortedIndexedArgs |> List.map fst |> List.toArray - let sortedFieldExprs = sortedIndexedArgs |> List.map snd + let sortedFieldTriples = sortedIndexedArgs |> List.map snd - sortedFieldExprs |> List.iteri (fun j (synLongIdent, _, _) -> + sortedFieldTriples + |> List.iteri (fun j (_, _, synLongIdent) -> let m = rangeOfLid synLongIdent.LongIdent let item = Item.AnonRecdField(anonInfo, sortedFieldTys, j, m) CallNameResolutionSink cenv.tcSink (m, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Use, env.eAccessRights)) @@ -7903,11 +7930,12 @@ and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, unsortedField let flexes = unsortedFieldTys |> List.map (fun _ -> true) - let unsortedCheckedArgs, tpenv = TcExprsWithFlexes cenv env mWholeExpr tpenv flexes unsortedFieldTys unsortedFieldSynExprsGiven + let unsortedCheckedArgs, tpenv = + TcExprsWithFlexes cenv env mWholeExpr tpenv flexes unsortedFieldTys unsortedFieldSynExprsGiven mkAnonRecd g mWholeExpr anonInfo unsortedFieldIds unsortedCheckedArgs unsortedFieldTys, tpenv -and TcCopyAndUpdateAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, (origExpr, blockSeparator), unsortedFieldIdsAndSynExprsGiven, mWholeExpr) = +and TcCopyAndUpdateAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, (origExpr, blockSeparator), recordFields: SynExprRecordField list, mWholeExpr) = // The fairly complex case '{| origExpr with X = 1; Y = 2 |}' // The origExpr may be either a record or anonymous record. // The origExpr may be either a struct or not. @@ -7926,14 +7954,17 @@ and TcCopyAndUpdateAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, (or if not (isAppTy g origExprTy || isAnonRecdTy g origExprTy) then error (Error (FSComp.SR.tcCopyAndUpdateNeedsRecordType(), mOrigExpr)) - // Expand expressions with respect to potential nesting + // Expand expressions with respect to potentially nesting let unsortedFieldIdsAndSynExprsGiven = - unsortedFieldIdsAndSynExprsGiven - |> List.map (fun (synLongIdent, _, exprBeingAssigned) -> + recordFields + |> List.map (fun (SynExprRecordField(fieldName = (synLongIdent, _); expr = e)) -> match synLongIdent.LongIdent with | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(), mWholeExpr)) - | [ id ] -> ([], id), Some exprBeingAssigned - | lid -> TransformAstForNestedUpdates cenv env origExprTy lid exprBeingAssigned (origExpr, blockSeparator)) + | [ id ] -> ([], id), e + | lid -> + match e with + | Some exprBeingAssigned -> TransformAstForNestedUpdates cenv env origExprTy lid exprBeingAssigned (origExpr, blockSeparator) + | None -> List.frontAndBack lid, None) |> GroupUpdatesToNestedFields let unsortedFieldSynExprsGiven = unsortedFieldIdsAndSynExprsGiven |> List.choose snd diff --git a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs index efa1b935fc8..c604860ebda 100644 --- a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs +++ b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs @@ -361,6 +361,19 @@ let (|NameofExpr|_|) (e: SynExpr) : NameofResult voption = | _ -> ValueNone | _ -> ValueNone +let visitRecordLikeExpr baseInfo copyInfo (recordFields: SynExprRecordField list) : FileContentEntry list = + let fieldNodes = + [ + for SynExprRecordField(fieldName = (si, _); expr = expr) in recordFields do + yield! visitSynLongIdent si + yield! collectFromOption visitSynExpr expr + ] + + match baseInfo, copyInfo with + | Some(t, e, _, _, _), None -> visitSynType t @ visitSynExpr e @ fieldNodes + | None, Some(e, _) -> visitSynExpr e @ fieldNodes + | _ -> fieldNodes + let visitSynExpr (e: SynExpr) : FileContentEntry list = let rec visit (e: SynExpr) (continuation: FileContentEntry list -> FileContentEntry list) : FileContentEntry list = match e with @@ -374,29 +387,14 @@ let visitSynExpr (e: SynExpr) : FileContentEntry list = let continuations: ((FileContentEntry list -> FileContentEntry list) -> FileContentEntry list) list = List.map visit exprs - Continuation.concatenate continuations continuation - | SynExpr.AnonRecd(copyInfo = copyInfo; recordFields = recordFields) -> - let continuations = - match copyInfo with - | None -> List.map (fun (_, _, e) -> visit e) recordFields - | Some(cp, _) -> visit cp :: List.map (fun (_, _, e) -> visit e) recordFields - Continuation.concatenate continuations continuation | SynExpr.ArrayOrList(exprs = exprs) -> let continuations = List.map visit exprs Continuation.concatenate continuations continuation + | SynExpr.AnonRecd(copyInfo = copyInfo; recordFields = recordFields) -> + continuation (visitRecordLikeExpr None copyInfo recordFields) | SynExpr.Record(baseInfo = baseInfo; copyInfo = copyInfo; recordFields = recordFields) -> - let fieldNodes = - [ - for SynExprRecordField(fieldName = (si, _); expr = expr) in recordFields do - yield! visitSynLongIdent si - yield! collectFromOption visitSynExpr expr - ] - - match baseInfo, copyInfo with - | Some(t, e, _, _, _), None -> visit e (fun nodes -> [ yield! visitSynType t; yield! nodes; yield! fieldNodes ] |> continuation) - | None, Some(e, _) -> visit e (fun nodes -> nodes @ fieldNodes |> continuation) - | _ -> continuation fieldNodes + continuation (visitRecordLikeExpr baseInfo copyInfo recordFields) | SynExpr.New(targetType = targetType; expr = expr) -> visit expr (fun nodes -> visitSynType targetType @ nodes |> continuation) | SynExpr.ObjExpr(objType, argOptions, _, bindings, members, extraImpls, _, _) -> [ diff --git a/src/Compiler/Service/FSharpParseFileResults.fs b/src/Compiler/Service/FSharpParseFileResults.fs index f5c1d978447..4344ec74d9a 100644 --- a/src/Compiler/Service/FSharpParseFileResults.fs +++ b/src/Compiler/Service/FSharpParseFileResults.fs @@ -512,6 +512,15 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, | _ -> () ] + and walkRecordLike (copyExprOpt: (SynExpr * BlockSeparator) option) (fs: SynExprRecordField list) = + [ + match copyExprOpt with + | Some(e, _) -> yield! walkExpr true e + | None -> () + + yield! walkExprs (fs |> List.choose (fun (SynExprRecordField(expr = e)) -> e)) + ] + // Determine the breakpoint locations for an expression. spImplicit indicates we always // emit a breakpoint location for the expression unless it is a syntactic control flow construct and walkExpr spImplicit expr = @@ -629,19 +638,8 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, | SynExpr.ArrayOrList(_, exprs, _) | SynExpr.Tuple(_, exprs, _, _) -> yield! walkExprs exprs - | SynExpr.Record(_, copyExprOpt, fs, _) -> - match copyExprOpt with - | Some(e, _) -> yield! walkExpr true e - | None -> () - - yield! walkExprs (fs |> List.choose (fun (SynExprRecordField(expr = e)) -> e)) - - | SynExpr.AnonRecd(copyInfo = copyExprOpt; recordFields = fs) -> - match copyExprOpt with - | Some(e, _) -> yield! walkExpr true e - | None -> () - - yield! walkExprs (fs |> List.map (fun (_, _, e) -> e)) + | SynExpr.Record(_, copyExprOpt, fs, _) + | SynExpr.AnonRecd(copyInfo = copyExprOpt; recordFields = fs) -> yield! walkRecordLike copyExprOpt fs | SynExpr.ObjExpr(argOptions = args; bindings = bs; members = ms; extraImpls = is) -> let bs = unionBindingAndMembers bs ms diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 3c0e6bff76a..a17370db804 100644 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -400,135 +400,57 @@ module SyntaxTraversal = let traverseSynType = traverseSynType path let traversePat = traversePat path - match e with - | SynExpr.LongIdentSet(expr = synExpr) - | SynExpr.DotGet(expr = synExpr) - | SynExpr.Do(expr = synExpr) - | SynExpr.DoBang(expr = synExpr) - | SynExpr.Assert(expr = synExpr) - | SynExpr.Fixed(expr = synExpr) - | SynExpr.DebugPoint(innerExpr = synExpr) - | SynExpr.AddressOf(expr = synExpr) - | SynExpr.TraitCall(argExpr = synExpr) - | SynExpr.Lazy(expr = synExpr) - | SynExpr.InferredUpcast(expr = synExpr) - | SynExpr.InferredDowncast(expr = synExpr) - | SynExpr.YieldOrReturn(expr = synExpr) - | SynExpr.YieldOrReturnFrom(expr = synExpr) - | SynExpr.FromParseError(expr = synExpr) - | SynExpr.DiscardAfterMissingQualificationAfterDot(expr = synExpr) - | SynExpr.IndexFromEnd(expr = synExpr) - | SynExpr.New(expr = synExpr) - | SynExpr.ArrayOrListComputed(expr = synExpr) - | SynExpr.TypeApp(expr = synExpr) - | SynExpr.DotLambda(expr = synExpr) - | SynExpr.Quote(quotedExpr = synExpr) - | SynExpr.Paren(expr = synExpr) -> traverseSynExpr synExpr - - | SynExpr.InterpolatedString(contents = parts) -> - [ - for part in parts do - match part with - | SynInterpolatedStringPart.String _ -> () - | SynInterpolatedStringPart.FillExpr(fillExpr, _) -> yield dive fillExpr fillExpr.Range traverseSynExpr - ] - |> pick expr - - | SynExpr.Typed(expr = synExpr; targetType = synType) -> - match traverseSynExpr synExpr with - | None -> traverseSynType synType - | x -> x - - | SynExpr.Tuple(exprs = synExprList) - | SynExpr.ArrayOrList(exprs = synExprList) -> synExprList |> List.map (fun x -> dive x x.Range traverseSynExpr) |> pick expr - - | SynExpr.AnonRecd(copyInfo = copyOpt; recordFields = fields) -> + let visitRecordLike + (inheritOpt: (SynType * SynExpr * range * BlockSeparator option * range) option) + (copyOpt: (SynExpr * BlockSeparator) option) + (fields: SynExprRecordField list) + (expr: SynExpr) + = [ - match copyOpt with - | Some(expr, blockSep) -> - yield dive expr expr.Range traverseSynExpr - - yield - dive () blockSep.Range (fun () -> - if posGeq pos blockSep.Range.End then - // special case: caret is after WITH - // { x with $ } - visitor.VisitRecordField(path, Some expr, None) - else - None) - | _ -> () - - for field, _, x in fields do - yield dive () field.Range (fun () -> visitor.VisitRecordField(path, copyOpt |> Option.map fst, Some field)) - yield dive x x.Range traverseSynExpr - ] - |> pick expr - - | SynExpr.Record(baseInfo = inheritOpt; copyInfo = copyOpt; recordFields = fields) -> - [ - let diveIntoSeparator offsideColumn scPosOpt copyOpt = - match scPosOpt with - | Some scPos -> - if posGeq pos scPos then - visitor.VisitRecordField(path, copyOpt, None) // empty field after the inherits - else - None - | None -> - //semicolon position is not available - use offside rule - if pos.Column = offsideColumn then - visitor.VisitRecordField(path, copyOpt, None) // empty field after the inherits - else - None - match inheritOpt with - | Some(_ty, expr, _range, sepOpt, inheritRange) -> - // dive into argument + | Some(_ty, inheritArgExpr, _inheritEqRange, inheritSepOpt, inheritRange) -> yield - dive expr expr.Range (fun expr -> - // special-case:caret is located in the offside position below inherit - // inherit A() - // $ + dive inheritArgExpr inheritArgExpr.Range (fun inner -> if - not (rangeContainsPos expr.Range pos) - && sepOpt.IsNone + not (rangeContainsPos inheritArgExpr.Range pos) + && inheritSepOpt.IsNone && pos.Column = inheritRange.StartColumn then visitor.VisitRecordField(path, None, None) else - traverseSynExpr expr) + traverseSynExpr inner) - match sepOpt with + match inheritSepOpt with | Some blockSep -> yield dive () blockSep.Range (fun () -> - // special case: caret is below 'inherit' + one or more fields are already defined - // inherit A() - // $ - // field1 = 5 - diveIntoSeparator inheritRange.StartColumn blockSep.Position None) + let scPosOpt = blockSep.Position + + if scPosOpt |> Option.exists (fun scPos -> posGeq pos scPos) then + visitor.VisitRecordField(path, None, None) + else + None) | None -> () - | _ -> () + | None -> () match copyOpt with - | Some(expr, blockSep) -> - yield dive expr expr.Range traverseSynExpr + | Some(orig, blockSep) -> + yield dive orig orig.Range traverseSynExpr yield dive () blockSep.Range (fun () -> if posGeq pos blockSep.Range.End then - // special case: caret is after WITH - // { x with $ } - visitor.VisitRecordField(path, Some expr, None) + visitor.VisitRecordField(path, Some orig, None) else None) - | _ -> () + | None -> () - let copyOpt = Option.map fst copyOpt + let copyExprOnly = Option.map fst copyOpt - for SynExprRecordField(fieldName = (field, _); expr = e; blockSeparator = sepOpt) in fields do + for SynExprRecordField(fieldName = (fieldLid, _); expr = e; blockSeparator = sepOpt) in fields do yield - dive (path, copyOpt, Some field) field.Range (fun r -> - if rangeContainsPos field.Range pos then + dive (path, copyExprOnly, Some fieldLid) fieldLid.Range (fun r -> + if rangeContainsPos fieldLid.Range pos then visitor.VisitRecordField r else None) @@ -536,39 +458,92 @@ module SyntaxTraversal = let offsideColumn = match inheritOpt with | Some(_, _, _, _, inheritRange) -> inheritRange.StartColumn - | None -> field.Range.StartColumn + | None -> fieldLid.Range.StartColumn match e with - | Some e -> + | Some fe -> yield - dive e e.Range (fun expr -> - // special case: caret is below field binding - // field x = 5 - // $ + dive fe fe.Range (fun inner -> if - not (rangeContainsPos e.Range pos) + not (rangeContainsPos fe.Range pos) && sepOpt.IsNone && pos.Column = offsideColumn then - visitor.VisitRecordField(path, copyOpt, None) + visitor.VisitRecordField(path, copyExprOnly, None) else - traverseSynExpr expr) + traverseSynExpr inner) | None -> () match sepOpt with | Some blockSep -> yield dive () blockSep.Range (fun () -> - // special case: caret is between field bindings - // field1 = 5 - // $ - // field2 = 5 - diveIntoSeparator offsideColumn blockSep.Position copyOpt) - | _ -> () + match inheritOpt with + | Some _ -> + let scPosOpt = blockSep.Position + + if scPosOpt |> Option.exists (fun scPos -> posGeq pos scPos) then + visitor.VisitRecordField(path, copyExprOnly, None) + elif scPosOpt.IsNone && pos.Column = offsideColumn then + visitor.VisitRecordField(path, copyExprOnly, None) + else + None + | None -> + if posGeq pos blockSep.Range.End then + visitor.VisitRecordField(path, copyExprOnly, None) + else + None) + | None -> () + ] + |> pick expr + match e with + | SynExpr.LongIdentSet(expr = synExpr) + | SynExpr.DotGet(expr = synExpr) + | SynExpr.Do(expr = synExpr) + | SynExpr.DoBang(expr = synExpr) + | SynExpr.Assert(expr = synExpr) + | SynExpr.Fixed(expr = synExpr) + | SynExpr.DebugPoint(innerExpr = synExpr) + | SynExpr.AddressOf(expr = synExpr) + | SynExpr.TraitCall(argExpr = synExpr) + | SynExpr.Lazy(expr = synExpr) + | SynExpr.InferredUpcast(expr = synExpr) + | SynExpr.InferredDowncast(expr = synExpr) + | SynExpr.YieldOrReturn(expr = synExpr) + | SynExpr.YieldOrReturnFrom(expr = synExpr) + | SynExpr.FromParseError(expr = synExpr) + | SynExpr.DiscardAfterMissingQualificationAfterDot(expr = synExpr) + | SynExpr.IndexFromEnd(expr = synExpr) + | SynExpr.New(expr = synExpr) + | SynExpr.ArrayOrListComputed(expr = synExpr) + | SynExpr.TypeApp(expr = synExpr) + | SynExpr.DotLambda(expr = synExpr) + | SynExpr.Quote(quotedExpr = synExpr) + | SynExpr.Paren(expr = synExpr) -> traverseSynExpr synExpr + + | SynExpr.InterpolatedString(contents = parts) -> + [ + for part in parts do + match part with + | SynInterpolatedStringPart.String _ -> () + | SynInterpolatedStringPart.FillExpr(fillExpr, _) -> yield dive fillExpr fillExpr.Range traverseSynExpr ] |> pick expr + | SynExpr.Typed(expr = synExpr; targetType = synType) -> + match traverseSynExpr synExpr with + | None -> traverseSynType synType + | x -> x + + | SynExpr.Tuple(exprs = synExprList) + | SynExpr.ArrayOrList(exprs = synExprList) -> synExprList |> List.map (fun x -> dive x x.Range traverseSynExpr) |> pick expr + + | SynExpr.AnonRecd(copyInfo = copyOpt; recordFields = fields) -> visitRecordLike None copyOpt fields expr + + | SynExpr.Record(baseInfo = inheritOpt; copyInfo = copyOpt; recordFields = fields) -> + visitRecordLike inheritOpt copyOpt fields expr + | SynExpr.ObjExpr(objType = ty; argOptions = baseCallOpt; bindings = binds; members = ms; extraImpls = ifaces) -> let binds = unionBindingAndMembers binds ms diff --git a/src/Compiler/Service/SynExpr.fs b/src/Compiler/Service/SynExpr.fs index 9fd1b3a888a..44c1b13f3e8 100644 --- a/src/Compiler/Service/SynExpr.fs +++ b/src/Compiler/Service/SynExpr.fs @@ -1107,7 +1107,7 @@ module SynExpr = | SynExpr.AnonRecd(copyInfo = Some(SynExpr.Paren(expr = Is inner), _)), (PrefixApp _ | InfixApp _ | Dangling.Problematic _) -> true - | SynExpr.Record(recordFields = recordFields), Dangling.Problematic _ -> + | (SynExpr.Record(recordFields = recordFields) | SynExpr.AnonRecd(recordFields = recordFields)), Dangling.Problematic _ -> let rec loop recordFields = match recordFields with | [] -> false @@ -1117,16 +1117,6 @@ module SynExpr = loop recordFields - | SynExpr.AnonRecd(recordFields = recordFields), Dangling.Problematic _ -> - let rec loop recordFields = - match recordFields with - | [] -> false - | (_, Some _blockSeparator, SynExpr.Paren(expr = Is inner)) :: (SynLongIdent(id = id :: _), _, _) :: _ -> - problematic inner.Range id.idRange - | _ :: recordFields -> loop recordFields - - loop recordFields - | SynExpr.Paren _, SynExpr.Typed _ | SynExpr.Quote _, SynExpr.Typed _ | SynExpr.While(doExpr = SynExpr.Paren(expr = Is inner)), SynExpr.Typed _ diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 8db7131d65e..2be03974a71 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -550,7 +550,7 @@ type SynExpr = | AnonRecd of isStruct: bool * copyInfo: (SynExpr * BlockSeparator) option * - recordFields: (SynLongIdent * range option * SynExpr) list * + recordFields: SynExprRecordField list * range: range * trivia: SynExprAnonRecdTrivia diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 873e8201d1f..aee8d46e7e3 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -608,7 +608,7 @@ type SynExpr = | AnonRecd of isStruct: bool * copyInfo: (SynExpr * BlockSeparator) option * - recordFields: (SynLongIdent * range option * SynExpr) list * + recordFields: SynExprRecordField list * range: range * trivia: SynExprAnonRecdTrivia diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 020dc50bebf..8c4d404242a 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -862,6 +862,12 @@ let rec synExprContainsError inpExpr = and walkExprOpt eOpt = eOpt |> Option.exists walkExpr + and walkRecordLike copyExprOpt (fs: SynExprRecordField list) = + (match copyExprOpt with + | Some(e, _) -> walkExpr e + | None -> false) + || (fs |> List.choose (fun (SynExprRecordField(expr = v)) -> v) |> walkExprs) + and walkExpr e = match e with | SynExpr.FromParseError _ @@ -915,18 +921,8 @@ let rec synExprContainsError inpExpr = | SynExpr.ArrayOrList(_, es, _) | SynExpr.Tuple(_, es, _, _) -> walkExprs es - | SynExpr.AnonRecd(copyInfo = origExpr; recordFields = flds) -> - (match origExpr with - | Some(e, _) -> walkExpr e - | None -> false) - || walkExprs (List.map (fun (_, _, e) -> e) flds) - - | SynExpr.Record(_, origExpr, fs, _) -> - (match origExpr with - | Some(e, _) -> walkExpr e - | None -> false) - || (let flds = fs |> List.choose (fun (SynExprRecordField(expr = v)) -> v) - walkExprs flds) + | SynExpr.AnonRecd(copyInfo = copyOpt; recordFields = fs) + | SynExpr.Record(baseInfo = _; copyInfo = copyOpt; recordFields = fs) -> walkRecordLike copyOpt fs | SynExpr.ObjExpr(bindings = bs; members = ms; extraImpls = is) -> let bs = unionBindingAndMembers bs ms diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index b773f1ea1ac..e648a4ca186 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -5912,12 +5912,6 @@ braceBarExpr: braceBarExprCore: | LBRACE_BAR recdExprCore bar_rbrace { let orig, flds = $2 - let flds = - flds |> List.choose (function - | SynExprRecordField((synLongIdent, _), mEquals, Some e, _, _) when orig.IsSome -> Some(synLongIdent, mEquals, e) // copy-and-update, long identifier signifies nesting - | SynExprRecordField((SynLongIdent([ _id ], _, _) as synLongIdent, _), mEquals, Some e, _, _) -> Some(synLongIdent, mEquals, e) // record construction, long identifier not valid - | SynExprRecordField((synLongIdent, _), mEquals, None, _, _) -> Some(synLongIdent, mEquals, arbExpr ("anonField", synLongIdent.Range)) - | _ -> reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsInvalidAnonRecdType()); None) let mLeftBrace = rhs parseState 1 let mRightBrace = rhs parseState 3 (fun (mStruct: range option) -> @@ -5927,10 +5921,6 @@ braceBarExprCore: | LBRACE_BAR recdExprCore recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBraceBar()) let orig, flds = $2 - let flds = - flds |> List.map (function - | SynExprRecordField((synLongIdent, _), mEquals, Some e, _, _) -> (synLongIdent, mEquals, e) - | SynExprRecordField((synLongIdent, _), mEquals, None, _, _) -> (synLongIdent, mEquals, arbExpr ("anonField", synLongIdent.Range))) let mLeftBrace = rhs parseState 1 let mExpr = rhs parseState 2 (fun (mStruct: range option) -> diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl index dd72f416ac0..9c2e498bb82 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl @@ -2081,8 +2081,8 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Text.Range[ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetSymbolUsesAtLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse]] GetDeclarationListSymbols(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetSymbolUseAtLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpDisplayContext] TryGetCapturedDisplayContext(FSharp.Compiler.Text.Range) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpDisplayContext] GetDisplayContextForPos(FSharp.Compiler.Text.Position) +FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpDisplayContext] TryGetCapturedDisplayContext(FSharp.Compiler.Text.Range) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpImplementationFileContents] ImplementationFile FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpImplementationFileContents] get_ImplementationFile() FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpType] TryGetCapturedType(FSharp.Compiler.Text.Range) @@ -7021,8 +7021,8 @@ FSharp.Compiler.Syntax.SynExpr+AnonRecd: FSharp.Compiler.SyntaxTrivia.SynExprAno FSharp.Compiler.Syntax.SynExpr+AnonRecd: FSharp.Compiler.SyntaxTrivia.SynExprAnonRecdTrivia trivia FSharp.Compiler.Syntax.SynExpr+AnonRecd: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynExpr+AnonRecd: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Syntax.SynLongIdent,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range],FSharp.Compiler.Syntax.SynExpr]] get_recordFields() -FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Syntax.SynLongIdent,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range],FSharp.Compiler.Syntax.SynExpr]] recordFields +FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExprRecordField] get_recordFields() +FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExprRecordField] recordFields FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Syntax.SynExpr,FSharp.Compiler.Syntax.BlockSeparator]] copyInfo FSharp.Compiler.Syntax.SynExpr+AnonRecd: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Syntax.SynExpr,FSharp.Compiler.Syntax.BlockSeparator]] get_copyInfo() FSharp.Compiler.Syntax.SynExpr+App: Boolean get_isInfix() @@ -7771,7 +7771,7 @@ FSharp.Compiler.Syntax.SynExpr: Boolean get_IsWhileBang() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsYieldOrReturn() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsYieldOrReturnFrom() FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewAddressOf(Boolean, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewAnonRecd(Boolean, Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Syntax.SynExpr,FSharp.Compiler.Syntax.BlockSeparator]], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Syntax.SynLongIdent,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range],FSharp.Compiler.Syntax.SynExpr]], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynExprAnonRecdTrivia) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewAnonRecd(Boolean, Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Syntax.SynExpr,FSharp.Compiler.Syntax.BlockSeparator]], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExprRecordField], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynExprAnonRecdTrivia) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewApp(FSharp.Compiler.Syntax.ExprAtomicFlag, Boolean, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewArbitraryAfterError(System.String, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewArrayOrList(Boolean, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExpr], FSharp.Compiler.Text.Range) diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl index 7f3dd8badf2..59df46169e9 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl @@ -7,60 +7,69 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (3,5--3,6), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (3,12--3,13)), Const (Int32 1, (3,10--3,11)), - (3,10--3,13)), Const (Int32 1, (3,14--3,15)), - (3,10--3,15)), false, (3,7--3,18)))], (3,0--3,20), - { OpeningBraceRange = (3,0--3,2) }), (3,0--3,20)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (3,5--3,6), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (3,12--3,13)), Const (Int32 1, (3,10--3,11)), + (3,10--3,13)), Const (Int32 1, (3,14--3,15)), + (3,10--3,15)), false, (3,7--3,18))), (3,3--3,18), + None)], (3,0--3,20), { OpeningBraceRange = (3,0--3,2) }), + (3,0--3,20)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (5,4--5,5), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (5,11--5,12)), Const (Int32 1, (5,9--5,10)), - (5,9--5,12)), Const (Int32 1, (5,13--5,14)), - (5,9--5,14)), false, (5,6--5,17)))], (5,0--5,20), - { OpeningBraceRange = (5,0--5,2) }), (5,0--5,20)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (5,4--5,5), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,11--5,12)), Const (Int32 1, (5,9--5,10)), + (5,9--5,12)), Const (Int32 1, (5,13--5,14)), + (5,9--5,14)), false, (5,6--5,17))), (5,2--5,17), + None)], (5,0--5,20), { OpeningBraceRange = (5,0--5,2) }), + (5,0--5,20)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (7,5--7,6), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (7,12--7,13)), Const (Int32 1, (7,10--7,11)), - (7,10--7,13)), Const (Int32 1, (7,14--7,15)), - (7,10--7,15)), false, (7,7--7,18)))], (7,0--7,21), - { OpeningBraceRange = (7,0--7,2) }), (7,0--7,21))], + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (7,5--7,6), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (7,12--7,13)), Const (Int32 1, (7,10--7,11)), + (7,10--7,13)), Const (Int32 1, (7,14--7,15)), + (7,10--7,15)), false, (7,7--7,18))), (7,3--7,18), + None)], (7,0--7,21), { OpeningBraceRange = (7,0--7,2) }), + (7,0--7,21))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl index a17975ba1da..e624117f84b 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl @@ -7,60 +7,69 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (3,5--3,6), - Quote - (Ident op_QuotationUntyped, true, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (3,13--3,14)), Const (Int32 1, (3,11--3,12)), - (3,11--3,14)), Const (Int32 1, (3,15--3,16)), - (3,11--3,16)), false, (3,7--3,20)))], (3,0--3,22), - { OpeningBraceRange = (3,0--3,2) }), (3,0--3,22)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (3,5--3,6), + Some + (Quote + (Ident op_QuotationUntyped, true, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (3,13--3,14)), Const (Int32 1, (3,11--3,12)), + (3,11--3,14)), Const (Int32 1, (3,15--3,16)), + (3,11--3,16)), false, (3,7--3,20))), (3,3--3,20), + None)], (3,0--3,22), { OpeningBraceRange = (3,0--3,2) }), + (3,0--3,22)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (5,4--5,5), - Quote - (Ident op_QuotationUntyped, true, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (5,12--5,13)), Const (Int32 1, (5,10--5,11)), - (5,10--5,13)), Const (Int32 1, (5,14--5,15)), - (5,10--5,15)), false, (5,6--5,19)))], (5,0--5,22), - { OpeningBraceRange = (5,0--5,2) }), (5,0--5,22)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (5,4--5,5), + Some + (Quote + (Ident op_QuotationUntyped, true, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,12--5,13)), Const (Int32 1, (5,10--5,11)), + (5,10--5,13)), Const (Int32 1, (5,14--5,15)), + (5,10--5,15)), false, (5,6--5,19))), (5,2--5,19), + None)], (5,0--5,22), { OpeningBraceRange = (5,0--5,2) }), + (5,0--5,22)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (7,5--7,6), - Quote - (Ident op_QuotationUntyped, true, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (7,13--7,14)), Const (Int32 1, (7,11--7,12)), - (7,11--7,14)), Const (Int32 1, (7,15--7,16)), - (7,11--7,16)), false, (7,7--7,20)))], (7,0--7,23), - { OpeningBraceRange = (7,0--7,2) }), (7,0--7,23))], + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (7,5--7,6), + Some + (Quote + (Ident op_QuotationUntyped, true, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (7,13--7,14)), Const (Int32 1, (7,11--7,12)), + (7,11--7,14)), Const (Int32 1, (7,15--7,16)), + (7,11--7,16)), false, (7,7--7,20))), (7,3--7,20), + None)], (7,0--7,23), { OpeningBraceRange = (7,0--7,2) }), + (7,0--7,23))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl index 91f4963b53c..e9be0b0eb16 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl @@ -7,78 +7,96 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (3,5--3,6), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (3,12--3,13)), Const (Int32 1, (3,10--3,11)), - (3,10--3,13)), Const (Int32 1, (3,14--3,15)), - (3,10--3,15)), false, (3,7--3,18))); - (SynLongIdent ([B], [], [None]), Some (3,22--3,23), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (3,28--3,34)), (3,28--3,34)), - false, (3,24--3,38)))], (3,0--3,40), - { OpeningBraceRange = (3,0--3,2) }), (3,0--3,40)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (3,5--3,6), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (3,12--3,13)), Const (Int32 1, (3,10--3,11)), + (3,10--3,13)), Const (Int32 1, (3,14--3,15)), + (3,10--3,15)), false, (3,7--3,18))), (3,3--3,18), + Some (Semicolon ((3,18--3,19), Some (3,19)))); + SynExprRecordField + ((SynLongIdent ([B], [], [None]), true), Some (3,22--3,23), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (3,28--3,34)), + (3,28--3,34)), false, (3,24--3,38))), (3,20--3,38), + None)], (3,0--3,40), { OpeningBraceRange = (3,0--3,2) }), + (3,0--3,40)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (5,4--5,5), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (5,11--5,12)), Const (Int32 1, (5,9--5,10)), - (5,9--5,12)), Const (Int32 1, (5,13--5,14)), - (5,9--5,14)), false, (5,6--5,17))); - (SynLongIdent ([B], [], [None]), Some (5,21--5,22), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (5,27--5,33)), (5,27--5,33)), - false, (5,23--5,37)))], (5,0--5,40), - { OpeningBraceRange = (5,0--5,2) }), (5,0--5,40)); + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (5,4--5,5), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,11--5,12)), Const (Int32 1, (5,9--5,10)), + (5,9--5,12)), Const (Int32 1, (5,13--5,14)), + (5,9--5,14)), false, (5,6--5,17))), (5,2--5,17), + Some (Semicolon ((5,17--5,18), Some (5,18)))); + SynExprRecordField + ((SynLongIdent ([B], [], [None]), true), Some (5,21--5,22), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (5,27--5,33)), + (5,27--5,33)), false, (5,23--5,37))), (5,19--5,37), + None)], (5,0--5,40), { OpeningBraceRange = (5,0--5,2) }), + (5,0--5,40)); Expr (AnonRecd (false, None, - [(SynLongIdent ([A], [], [None]), Some (7,5--7,6), - Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Addition], [], - [Some (OriginalNotation "+")]), None, - (7,12--7,13)), Const (Int32 1, (7,10--7,11)), - (7,10--7,13)), Const (Int32 1, (7,14--7,15)), - (7,10--7,15)), false, (7,7--7,18))); - (SynLongIdent ([B], [], [None]), Some (7,22--7,23), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (7,28--7,34)), (7,28--7,34)), - false, (7,24--7,38)))], (7,0--7,41), - { OpeningBraceRange = (7,0--7,2) }), (7,0--7,41))], + [SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), Some (7,5--7,6), + Some + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (7,12--7,13)), Const (Int32 1, (7,10--7,11)), + (7,10--7,13)), Const (Int32 1, (7,14--7,15)), + (7,10--7,15)), false, (7,7--7,18))), (7,3--7,18), + Some (Semicolon ((7,18--7,19), Some (7,19)))); + SynExprRecordField + ((SynLongIdent ([B], [], [None]), true), Some (7,22--7,23), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (7,28--7,34)), + (7,28--7,34)), false, (7,24--7,38))), (7,20--7,38), + None)], (7,0--7,41), { OpeningBraceRange = (7,0--7,2) }), + (7,0--7,41))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,41), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl index 5577001a81e..1d39f8ab6e9 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl @@ -7,57 +7,92 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([Outer], [], [None]), Some (3,9--3,10), - AnonRecd - (false, None, - [(SynLongIdent ([Inner], [], [None]), Some (3,20--3,21), - Quote - (Ident op_Quotation, false, - Const (Int32 1, (3,25--3,26)), false, (3,22--3,29)))], - (3,11--3,31), { OpeningBraceRange = (3,11--3,13) })); - (SynLongIdent ([Other], [], [None]), Some (3,39--3,40), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (3,45--3,51)), (3,45--3,51)), - false, (3,41--3,55)))], (3,0--3,57), - { OpeningBraceRange = (3,0--3,2) }), (3,0--3,57)); + [SynExprRecordField + ((SynLongIdent ([Outer], [], [None]), true), + Some (3,9--3,10), + Some + (AnonRecd + (false, None, + [SynExprRecordField + ((SynLongIdent ([Inner], [], [None]), true), + Some (3,20--3,21), + Some + (Quote + (Ident op_Quotation, false, + Const (Int32 1, (3,25--3,26)), false, + (3,22--3,29))), (3,14--3,29), None)], + (3,11--3,31), { OpeningBraceRange = (3,11--3,13) })), + (3,3--3,31), Some (Semicolon ((3,31--3,32), Some (3,32)))); + SynExprRecordField + ((SynLongIdent ([Other], [], [None]), true), + Some (3,39--3,40), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (3,45--3,51)), + (3,45--3,51)), false, (3,41--3,55))), (3,33--3,55), + None)], (3,0--3,57), { OpeningBraceRange = (3,0--3,2) }), + (3,0--3,57)); Expr (AnonRecd (false, None, - [(SynLongIdent ([Outer], [], [None]), Some (5,8--5,9), - AnonRecd - (false, None, - [(SynLongIdent ([Inner], [], [None]), Some (5,19--5,20), - Quote - (Ident op_Quotation, false, - Const (Int32 1, (5,24--5,25)), false, (5,21--5,28)))], - (5,10--5,30), { OpeningBraceRange = (5,10--5,12) })); - (SynLongIdent ([Other], [], [None]), Some (5,38--5,39), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (5,44--5,50)), (5,44--5,50)), - false, (5,40--5,54)))], (5,0--5,57), - { OpeningBraceRange = (5,0--5,2) }), (5,0--5,57)); + [SynExprRecordField + ((SynLongIdent ([Outer], [], [None]), true), Some (5,8--5,9), + Some + (AnonRecd + (false, None, + [SynExprRecordField + ((SynLongIdent ([Inner], [], [None]), true), + Some (5,19--5,20), + Some + (Quote + (Ident op_Quotation, false, + Const (Int32 1, (5,24--5,25)), false, + (5,21--5,28))), (5,13--5,28), None)], + (5,10--5,30), { OpeningBraceRange = (5,10--5,12) })), + (5,2--5,30), Some (Semicolon ((5,30--5,31), Some (5,31)))); + SynExprRecordField + ((SynLongIdent ([Other], [], [None]), true), + Some (5,38--5,39), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (5,44--5,50)), + (5,44--5,50)), false, (5,40--5,54))), (5,32--5,54), + None)], (5,0--5,57), { OpeningBraceRange = (5,0--5,2) }), + (5,0--5,57)); Expr (AnonRecd (false, None, - [(SynLongIdent ([Outer], [], [None]), Some (7,9--7,10), - AnonRecd - (false, None, - [(SynLongIdent ([Inner], [], [None]), Some (7,20--7,21), - Quote - (Ident op_Quotation, false, - Const (Int32 1, (7,25--7,26)), false, (7,22--7,29)))], - (7,11--7,31), { OpeningBraceRange = (7,11--7,13) })); - (SynLongIdent ([Other], [], [None]), Some (7,39--7,40), - Quote - (Ident op_QuotationUntyped, true, - Const - (String ("test", Regular, (7,45--7,51)), (7,45--7,51)), - false, (7,41--7,55)))], (7,0--7,58), - { OpeningBraceRange = (7,0--7,2) }), (7,0--7,58))], + [SynExprRecordField + ((SynLongIdent ([Outer], [], [None]), true), + Some (7,9--7,10), + Some + (AnonRecd + (false, None, + [SynExprRecordField + ((SynLongIdent ([Inner], [], [None]), true), + Some (7,20--7,21), + Some + (Quote + (Ident op_Quotation, false, + Const (Int32 1, (7,25--7,26)), false, + (7,22--7,29))), (7,14--7,29), None)], + (7,11--7,31), { OpeningBraceRange = (7,11--7,13) })), + (7,3--7,31), Some (Semicolon ((7,31--7,32), Some (7,32)))); + SynExprRecordField + ((SynLongIdent ([Other], [], [None]), true), + Some (7,39--7,40), + Some + (Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (7,45--7,51)), + (7,45--7,51)), false, (7,41--7,55))), (7,33--7,55), + None)], (7,0--7,58), { OpeningBraceRange = (7,0--7,2) }), + (7,0--7,58))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,58), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl index 292574469cd..de20a97e5f8 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl @@ -7,15 +7,17 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([X], [], [None]), Some (1,5--1,6), - Const (Int32 1, (1,7--1,8)))], (1,0--1,11), - { OpeningBraceRange = (1,0--1,2) }), (1,0--1,11)); + [SynExprRecordField + ((SynLongIdent ([X], [], [None]), true), Some (1,5--1,6), + Some (Const (Int32 1, (1,7--1,8))), (1,3--1,8), None)], + (1,0--1,11), { OpeningBraceRange = (1,0--1,2) }), (1,0--1,11)); Expr (AnonRecd (true, None, - [(SynLongIdent ([Y], [], [None]), Some (2,12--2,13), - Const (Int32 2, (2,14--2,15)))], (2,0--2,18), - { OpeningBraceRange = (2,7--2,9) }), (2,0--2,18)); + [SynExprRecordField + ((SynLongIdent ([Y], [], [None]), true), Some (2,12--2,13), + Some (Const (Int32 2, (2,14--2,15))), (2,10--2,15), None)], + (2,0--2,18), { OpeningBraceRange = (2,7--2,9) }), (2,0--2,18)); Expr (AnonRecd (false, None, [], (3,0--3,5), { OpeningBraceRange = (3,0--3,2) }), diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl index fc0a410b79e..d478b60f69a 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl @@ -7,9 +7,10 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([X], [], [None]), Some (1,5--1,6), - Const (Int32 0, (1,7--1,8)))], (1,0--2,0), - { OpeningBraceRange = (1,0--1,2) }), (1,0--2,0))], + [SynExprRecordField + ((SynLongIdent ([X], [], [None]), true), Some (1,5--1,6), + Some (Const (Int32 0, (1,7--1,8))), (1,3--1,8), None)], + (1,0--2,0), { OpeningBraceRange = (1,0--1,2) }), (1,0--2,0))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl index 4582e5eca53..4b2cf1a6e4a 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl @@ -7,9 +7,10 @@ ImplFile [Expr (AnonRecd (true, None, - [(SynLongIdent ([X], [], [None]), Some (1,12--1,13), - Const (Int32 0, (1,14--1,15)))], (1,0--2,0), - { OpeningBraceRange = (1,7--1,9) }), (1,0--2,0))], + [SynExprRecordField + ((SynLongIdent ([X], [], [None]), true), Some (1,12--1,13), + Some (Const (Int32 0, (1,14--1,15))), (1,10--1,15), None)], + (1,0--2,0), { OpeningBraceRange = (1,7--1,9) }), (1,0--2,0))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl index 28d315f97af..239c2fa8e63 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl @@ -20,11 +20,18 @@ ImplFile None, (1,4--1,7)), None, AnonRecd (false, Some (Ident x, Offside ((1,15--1,19), None)), - [(SynLongIdent ([R; D], [(1,21--1,22)], [None; None]), - Some (1,24--1,25), - Const (String ("s", Regular, (1,26--1,29)), (1,26--1,29))); - (SynLongIdent ([A], [], [None]), Some (1,33--1,34), - Const (Int32 3, (1,35--1,36)))], (1,10--1,39), + [SynExprRecordField + ((SynLongIdent ([R; D], [(1,21--1,22)], [None; None]), + true), Some (1,24--1,25), + Some + (Const + (String ("s", Regular, (1,26--1,29)), (1,26--1,29))), + (1,20--1,29), + Some (Semicolon ((1,29--1,30), Some (1,30)))); + SynExprRecordField + ((SynLongIdent ([A], [], [None]), true), + Some (1,33--1,34), Some (Const (Int32 3, (1,35--1,36))), + (1,31--1,36), None)], (1,10--1,39), { OpeningBraceRange = (1,10--1,12) }), (1,4--1,7), NoneAtLet, { LeadingKeyword = Let (1,0--1,3) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl index a8ff99d1b82..0df556269ff 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl @@ -7,47 +7,59 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), - Const - (Measure - (Int32 1, (3,4--3,5), - Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), - { LessRange = (3,5--3,6) - GreaterRange = (3,7--3,8) }), (3,4--3,8)))], - (3,0--3,11), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,11)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,3--3,4), + Some + (Const + (Measure + (Int32 1, (3,4--3,5), + Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), + { LessRange = (3,5--3,6) + GreaterRange = (3,7--3,8) }), (3,4--3,8))), + (3,2--3,8), None)], (3,0--3,11), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,11)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), - Const - (Measure - (Int32 1, (5,4--5,5), - Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), - { LessRange = (5,5--5,6) - GreaterRange = (5,7--5,8) }), (5,4--5,8)))], - (5,0--5,10), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,10)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,3--5,4), + Some + (Const + (Measure + (Int32 1, (5,4--5,5), + Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), + { LessRange = (5,5--5,6) + GreaterRange = (5,7--5,8) }), (5,4--5,8))), + (5,2--5,8), None)], (5,0--5,10), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,10)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), - Const - (Measure - (Int32 1, (7,5--7,6), - Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), - { LessRange = (7,6--7,7) - GreaterRange = (7,8--7,9) }), (7,5--7,9)))], - (7,0--7,11), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,11)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (7,4--7,5), + Some + (Const + (Measure + (Int32 1, (7,5--7,6), + Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), + { LessRange = (7,6--7,7) + GreaterRange = (7,8--7,9) }), (7,5--7,9))), + (7,3--7,9), None)], (7,0--7,11), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,11)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), - Const - (Measure - (Int32 1, (9,5--9,6), - Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), - { LessRange = (9,6--9,7) - GreaterRange = (9,8--9,9) }), (9,5--9,9)))], - (9,0--9,12), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,12))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (9,4--9,5), + Some + (Const + (Measure + (Int32 1, (9,5--9,6), + Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), + { LessRange = (9,6--9,7) + GreaterRange = (9,8--9,9) }), (9,5--9,9))), + (9,3--9,9), None)], (9,0--9,12), + { OpeningBraceRange = (9,0--9,2) }), (9,0--9,12))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl index ed640191c59..8cb723c2d7d 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl @@ -7,75 +7,99 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), - Const - (Measure - (Int32 1, (3,4--3,5), - Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), - { LessRange = (3,5--3,6) - GreaterRange = (3,7--3,8) }), (3,4--3,8))); - (SynLongIdent ([b], [], [None]), Some (3,11--3,12), - Const - (Measure - (Int32 2, (3,12--3,13), - Seq ([Named ([m], (3,14--3,15))], (3,14--3,15)), - { LessRange = (3,13--3,14) - GreaterRange = (3,15--3,16) }), (3,12--3,16)))], - (3,0--3,19), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,19)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,3--3,4), + Some + (Const + (Measure + (Int32 1, (3,4--3,5), + Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), + { LessRange = (3,5--3,6) + GreaterRange = (3,7--3,8) }), (3,4--3,8))), + (3,2--3,8), Some (Semicolon ((3,8--3,9), Some (3,9)))); + SynExprRecordField + ((SynLongIdent ([b], [], [None]), true), Some (3,11--3,12), + Some + (Const + (Measure + (Int32 2, (3,12--3,13), + Seq ([Named ([m], (3,14--3,15))], (3,14--3,15)), + { LessRange = (3,13--3,14) + GreaterRange = (3,15--3,16) }), (3,12--3,16))), + (3,10--3,16), None)], (3,0--3,19), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,19)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), - Const - (Measure - (Int32 1, (5,4--5,5), - Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), - { LessRange = (5,5--5,6) - GreaterRange = (5,7--5,8) }), (5,4--5,8))); - (SynLongIdent ([b], [], [None]), Some (5,11--5,12), - Const - (Measure - (Int32 2, (5,12--5,13), - Seq ([Named ([m], (5,14--5,15))], (5,14--5,15)), - { LessRange = (5,13--5,14) - GreaterRange = (5,15--5,16) }), (5,12--5,16)))], - (5,0--5,18), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,3--5,4), + Some + (Const + (Measure + (Int32 1, (5,4--5,5), + Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), + { LessRange = (5,5--5,6) + GreaterRange = (5,7--5,8) }), (5,4--5,8))), + (5,2--5,8), Some (Semicolon ((5,8--5,9), Some (5,9)))); + SynExprRecordField + ((SynLongIdent ([b], [], [None]), true), Some (5,11--5,12), + Some + (Const + (Measure + (Int32 2, (5,12--5,13), + Seq ([Named ([m], (5,14--5,15))], (5,14--5,15)), + { LessRange = (5,13--5,14) + GreaterRange = (5,15--5,16) }), (5,12--5,16))), + (5,10--5,16), None)], (5,0--5,18), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), - Const - (Measure - (Int32 1, (7,5--7,6), - Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), - { LessRange = (7,6--7,7) - GreaterRange = (7,8--7,9) }), (7,5--7,9))); - (SynLongIdent ([b], [], [None]), Some (7,12--7,13), - Const - (Measure - (Int32 2, (7,13--7,14), - Seq ([Named ([m], (7,15--7,16))], (7,15--7,16)), - { LessRange = (7,14--7,15) - GreaterRange = (7,16--7,17) }), (7,13--7,17)))], - (7,0--7,19), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,19)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (7,4--7,5), + Some + (Const + (Measure + (Int32 1, (7,5--7,6), + Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), + { LessRange = (7,6--7,7) + GreaterRange = (7,8--7,9) }), (7,5--7,9))), + (7,3--7,9), Some (Semicolon ((7,9--7,10), Some (7,10)))); + SynExprRecordField + ((SynLongIdent ([b], [], [None]), true), Some (7,12--7,13), + Some + (Const + (Measure + (Int32 2, (7,13--7,14), + Seq ([Named ([m], (7,15--7,16))], (7,15--7,16)), + { LessRange = (7,14--7,15) + GreaterRange = (7,16--7,17) }), (7,13--7,17))), + (7,11--7,17), None)], (7,0--7,19), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,19)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), - Const - (Measure - (Int32 1, (9,5--9,6), - Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), - { LessRange = (9,6--9,7) - GreaterRange = (9,8--9,9) }), (9,5--9,9))); - (SynLongIdent ([b], [], [None]), Some (9,12--9,13), - Const - (Measure - (Int32 2, (9,13--9,14), - Seq ([Named ([m], (9,15--9,16))], (9,15--9,16)), - { LessRange = (9,14--9,15) - GreaterRange = (9,16--9,17) }), (9,13--9,17)))], - (9,0--9,20), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,20))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (9,4--9,5), + Some + (Const + (Measure + (Int32 1, (9,5--9,6), + Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), + { LessRange = (9,6--9,7) + GreaterRange = (9,8--9,9) }), (9,5--9,9))), + (9,3--9,9), Some (Semicolon ((9,9--9,10), Some (9,10)))); + SynExprRecordField + ((SynLongIdent ([b], [], [None]), true), Some (9,12--9,13), + Some + (Const + (Measure + (Int32 2, (9,13--9,14), + Seq ([Named ([m], (9,15--9,16))], (9,15--9,16)), + { LessRange = (9,14--9,15) + GreaterRange = (9,16--9,17) }), (9,13--9,17))), + (9,11--9,17), None)], (9,0--9,20), + { OpeningBraceRange = (9,0--9,2) }), (9,0--9,20))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl index ec7c2e4e312..06ab77e3af0 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl @@ -7,39 +7,51 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), - TypeApp - (Ident typeof, (3,10--3,11), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (3,14--3,15), (3,10--3,15), (3,4--3,15)))], - (3,0--3,17), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,17)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,3--3,4), + Some + (TypeApp + (Ident typeof, (3,10--3,11), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (3,14--3,15), (3,10--3,15), (3,4--3,15))), + (3,2--3,15), None)], (3,0--3,17), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,17)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), - TypeApp - (Ident typeof, (5,10--5,11), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (5,14--5,15), (5,10--5,15), (5,4--5,15)))], - (5,0--5,18), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,3--5,4), + Some + (TypeApp + (Ident typeof, (5,10--5,11), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (5,14--5,15), (5,10--5,15), (5,4--5,15))), + (5,2--5,15), None)], (5,0--5,18), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), - TypeApp - (Ident typeof, (7,11--7,12), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (7,15--7,16), (7,11--7,16), (7,5--7,16)))], - (7,0--7,18), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,18)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (7,4--7,5), + Some + (TypeApp + (Ident typeof, (7,11--7,12), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (7,15--7,16), (7,11--7,16), (7,5--7,16))), + (7,3--7,16), None)], (7,0--7,18), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,18)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), - TypeApp - (Ident typeof, (9,11--9,12), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (9,15--9,16), (9,11--9,16), (9,5--9,16)))], - (9,0--9,19), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,19))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (9,4--9,5), + Some + (TypeApp + (Ident typeof, (9,11--9,12), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (9,15--9,16), (9,11--9,16), (9,5--9,16))), + (9,3--9,16), None)], (9,0--9,19), + { OpeningBraceRange = (9,0--9,2) }), (9,0--9,19))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl index a30127b522f..9704bd825a1 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl @@ -7,46 +7,58 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), - TypeApp - (Ident typedefof, (3,13--3,14), - [App - (LongIdent (SynLongIdent ([option], [], [None])), None, - [Anon (3,14--3,15)], [], None, true, (3,14--3,22))], - [], Some (3,22--3,23), (3,13--3,23), (3,4--3,23)))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,3--3,4), + Some + (TypeApp + (Ident typedefof, (3,13--3,14), + [App + (LongIdent (SynLongIdent ([option], [], [None])), + None, [Anon (3,14--3,15)], [], None, true, + (3,14--3,22))], [], Some (3,22--3,23), + (3,13--3,23), (3,4--3,23))), (3,2--3,23), None)], (3,0--3,25), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,25)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), - TypeApp - (Ident typedefof, (5,13--5,14), - [App - (LongIdent (SynLongIdent ([option], [], [None])), None, - [Anon (5,14--5,15)], [], None, true, (5,14--5,22))], - [], Some (5,22--5,23), (5,13--5,23), (5,4--5,23)))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,3--5,4), + Some + (TypeApp + (Ident typedefof, (5,13--5,14), + [App + (LongIdent (SynLongIdent ([option], [], [None])), + None, [Anon (5,14--5,15)], [], None, true, + (5,14--5,22))], [], Some (5,22--5,23), + (5,13--5,23), (5,4--5,23))), (5,2--5,23), None)], (5,0--5,26), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,26)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), - TypeApp - (Ident typedefof, (7,14--7,15), - [App - (LongIdent (SynLongIdent ([option], [], [None])), None, - [Anon (7,15--7,16)], [], None, true, (7,15--7,23))], - [], Some (7,23--7,24), (7,14--7,24), (7,5--7,24)))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (7,4--7,5), + Some + (TypeApp + (Ident typedefof, (7,14--7,15), + [App + (LongIdent (SynLongIdent ([option], [], [None])), + None, [Anon (7,15--7,16)], [], None, true, + (7,15--7,23))], [], Some (7,23--7,24), + (7,14--7,24), (7,5--7,24))), (7,3--7,24), None)], (7,0--7,26), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,26)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), - TypeApp - (Ident typedefof, (9,14--9,15), - [App - (LongIdent (SynLongIdent ([option], [], [None])), None, - [Anon (9,15--9,16)], [], None, true, (9,15--9,23))], - [], Some (9,23--9,24), (9,14--9,24), (9,5--9,24)))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (9,4--9,5), + Some + (TypeApp + (Ident typedefof, (9,14--9,15), + [App + (LongIdent (SynLongIdent ([option], [], [None])), + None, [Anon (9,15--9,16)], [], None, true, + (9,15--9,23))], [], Some (9,23--9,24), + (9,14--9,24), (9,5--9,24))), (9,3--9,24), None)], (9,0--9,27), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,27))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,27), { LeadingKeyword = Module (1,0--1,6) })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl index 180ed425c9e..485de8f499b 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl @@ -23,16 +23,19 @@ ImplFile false)), Pats [], None, (3,4--3,9)), None, AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,15--3,16), - TypeApp - (Ident nameof, (3,22--3,23), - [Var (SynTypar (T, None, false), (3,23--3,25))], [], - Some (3,25--3,26), (3,22--3,26), (3,16--3,26)))], - (3,12--3,28), { OpeningBraceRange = (3,12--3,14) }), - (3,4--3,9), NoneAtLet, { LeadingKeyword = Let (3,0--3,3) - InlineKeyword = None - EqualsRange = Some (3,10--3,11) })], - (3,0--3,28)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), + Some (3,15--3,16), + Some + (TypeApp + (Ident nameof, (3,22--3,23), + [Var (SynTypar (T, None, false), (3,23--3,25))], + [], Some (3,25--3,26), (3,22--3,26), (3,16--3,26))), + (3,14--3,26), None)], (3,12--3,28), + { OpeningBraceRange = (3,12--3,14) }), (3,4--3,9), + NoneAtLet, { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,10--3,11) })], (3,0--3,28)); Let (false, [SynBinding @@ -52,16 +55,19 @@ ImplFile false)), Pats [], None, (5,4--5,9)), None, AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,15--5,16), - TypeApp - (Ident nameof, (5,22--5,23), - [Var (SynTypar (T, None, false), (5,23--5,25))], [], - Some (5,25--5,26), (5,22--5,26), (5,16--5,26)))], - (5,12--5,29), { OpeningBraceRange = (5,12--5,14) }), - (5,4--5,9), NoneAtLet, { LeadingKeyword = Let (5,0--5,3) - InlineKeyword = None - EqualsRange = Some (5,10--5,11) })], - (5,0--5,29)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), + Some (5,15--5,16), + Some + (TypeApp + (Ident nameof, (5,22--5,23), + [Var (SynTypar (T, None, false), (5,23--5,25))], + [], Some (5,25--5,26), (5,22--5,26), (5,16--5,26))), + (5,14--5,26), None)], (5,12--5,29), + { OpeningBraceRange = (5,12--5,14) }), (5,4--5,9), + NoneAtLet, { LeadingKeyword = Let (5,0--5,3) + InlineKeyword = None + EqualsRange = Some (5,10--5,11) })], (5,0--5,29)); Let (false, [SynBinding @@ -81,16 +87,19 @@ ImplFile false)), Pats [], None, (7,4--7,9)), None, AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,16--7,17), - TypeApp - (Ident nameof, (7,23--7,24), - [Var (SynTypar (T, None, false), (7,24--7,26))], [], - Some (7,26--7,27), (7,23--7,27), (7,17--7,27)))], - (7,12--7,29), { OpeningBraceRange = (7,12--7,14) }), - (7,4--7,9), NoneAtLet, { LeadingKeyword = Let (7,0--7,3) - InlineKeyword = None - EqualsRange = Some (7,10--7,11) })], - (7,0--7,29)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), + Some (7,16--7,17), + Some + (TypeApp + (Ident nameof, (7,23--7,24), + [Var (SynTypar (T, None, false), (7,24--7,26))], + [], Some (7,26--7,27), (7,23--7,27), (7,17--7,27))), + (7,15--7,27), None)], (7,12--7,29), + { OpeningBraceRange = (7,12--7,14) }), (7,4--7,9), + NoneAtLet, { LeadingKeyword = Let (7,0--7,3) + InlineKeyword = None + EqualsRange = Some (7,10--7,11) })], (7,0--7,29)); Let (false, [SynBinding @@ -110,16 +119,19 @@ ImplFile false)), Pats [], None, (9,4--9,9)), None, AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,16--9,17), - TypeApp - (Ident nameof, (9,23--9,24), - [Var (SynTypar (T, None, false), (9,24--9,26))], [], - Some (9,26--9,27), (9,23--9,27), (9,17--9,27)))], - (9,12--9,30), { OpeningBraceRange = (9,12--9,14) }), - (9,4--9,9), NoneAtLet, { LeadingKeyword = Let (9,0--9,3) - InlineKeyword = None - EqualsRange = Some (9,10--9,11) })], - (9,0--9,30))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), + Some (9,16--9,17), + Some + (TypeApp + (Ident nameof, (9,23--9,24), + [Var (SynTypar (T, None, false), (9,24--9,26))], + [], Some (9,26--9,27), (9,23--9,27), (9,17--9,27))), + (9,15--9,27), None)], (9,12--9,30), + { OpeningBraceRange = (9,12--9,14) }), (9,4--9,9), + NoneAtLet, { LeadingKeyword = Let (9,0--9,3) + InlineKeyword = None + EqualsRange = Some (9,10--9,11) })], (9,0--9,30))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,30), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl index 1de6c8767d2..4d76074cab3 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl @@ -7,39 +7,51 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), - TypeApp - (Ident id, (3,6--3,7), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (3,10--3,11), (3,6--3,11), (3,4--3,11)))], - (3,0--3,13), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,13)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,3--3,4), + Some + (TypeApp + (Ident id, (3,6--3,7), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (3,10--3,11), (3,6--3,11), (3,4--3,11))), + (3,2--3,11), None)], (3,0--3,13), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,13)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), - TypeApp - (Ident id, (5,6--5,7), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (5,10--5,11), (5,6--5,11), (5,4--5,11)))], - (5,0--5,14), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,14)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,3--5,4), + Some + (TypeApp + (Ident id, (5,6--5,7), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (5,10--5,11), (5,6--5,11), (5,4--5,11))), + (5,2--5,11), None)], (5,0--5,14), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,14)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), - TypeApp - (Ident id, (7,7--7,8), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (7,11--7,12), (7,7--7,12), (7,5--7,12)))], - (7,0--7,14), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,14)); + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (7,4--7,5), + Some + (TypeApp + (Ident id, (7,7--7,8), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (7,11--7,12), (7,7--7,12), (7,5--7,12))), + (7,3--7,12), None)], (7,0--7,14), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,14)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), - TypeApp - (Ident id, (9,7--9,8), - [LongIdent (SynLongIdent ([int], [], [None]))], [], - Some (9,11--9,12), (9,7--9,12), (9,5--9,12)))], - (9,0--9,15), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,15))], + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (9,4--9,5), + Some + (TypeApp + (Ident id, (9,7--9,8), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (9,11--9,12), (9,7--9,12), (9,5--9,12))), + (9,3--9,12), None)], (9,0--9,15), + { OpeningBraceRange = (9,0--9,2) }), (9,0--9,15))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl index ede1aa9a366..31f5cc2a9f2 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl @@ -7,18 +7,24 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (3,4--3,5), - Quote - (Ident op_Quotation, false, Const (Int32 3, (3,9--3,10)), - false, (3,6--3,13)))], (3,0--3,16), + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (3,4--3,5), + Some + (Quote + (Ident op_Quotation, false, + Const (Int32 3, (3,9--3,10)), false, (3,6--3,13))), + (3,2--3,13), None)], (3,0--3,16), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,16)); Expr (AnonRecd (false, None, - [(SynLongIdent ([a], [], [None]), Some (5,4--5,5), - Quote - (Ident op_Quotation, false, Const (Int32 3, (5,9--5,10)), - false, (5,6--5,13)))], (5,0--5,15), + [SynExprRecordField + ((SynLongIdent ([a], [], [None]), true), Some (5,4--5,5), + Some + (Quote + (Ident op_Quotation, false, + Const (Int32 3, (5,9--5,10)), false, (5,6--5,13))), + (5,2--5,13), None)], (5,0--5,15), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,15))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl index 409a6349663..9f55c85b4c4 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl @@ -7,9 +7,10 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F], [], [None]), Some (3,5--3,6), - Const (Int32 1, (3,7--3,8)))], (3,0--3,11), - { OpeningBraceRange = (3,0--3,2) }), (3,0--3,11))], + [SynExprRecordField + ((SynLongIdent ([F], [], [None]), true), Some (3,5--3,6), + Some (Const (Int32 1, (3,7--3,8))), (3,3--3,8), None)], + (3,0--3,11), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,11))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl index abb4f9c61af..f33c99851d7 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl @@ -7,8 +7,9 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F], [], [None]), Some (3,5--3,6), - ArbitraryAfterError ("anonField", (3,3--3,4)))], (3,0--3,9), + [SynExprRecordField + ((SynLongIdent ([F], [], [None]), true), Some (3,5--3,6), + None, (3,3--3,6), None)], (3,0--3,9), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,9))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl index 0a2441bca98..df23b9de76e 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl @@ -7,10 +7,13 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F1], [], [None]), Some (3,6--3,7), - Const (Int32 1, (3,8--3,9))); - (SynLongIdent ([F2], [], [None]), Some (4,6--4,7), - ArbitraryAfterError ("anonField", (4,3--4,5)))], (3,0--4,10), + [SynExprRecordField + ((SynLongIdent ([F1], [], [None]), true), Some (3,6--3,7), + Some (Const (Int32 1, (3,8--3,9))), (3,3--3,9), + Some (Offside ((3,10--4,3), None))); + SynExprRecordField + ((SynLongIdent ([F2], [], [None]), true), Some (4,6--4,7), + None, (4,3--4,7), None)], (3,0--4,10), { OpeningBraceRange = (3,0--3,2) }), (3,0--4,10))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl index 70fdc8e6a09..c03a6523551 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl @@ -7,10 +7,13 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F1], [], [None]), Some (3,6--3,7), - Const (Int32 1, (3,8--3,9))); - (SynLongIdent ([F2], [], [None]), None, - ArbitraryAfterError ("anonField", (4,3--4,5)))], (3,0--4,8), + [SynExprRecordField + ((SynLongIdent ([F1], [], [None]), true), Some (3,6--3,7), + Some (Const (Int32 1, (3,8--3,9))), (3,3--3,9), + Some (Offside ((3,10--4,3), None))); + SynExprRecordField + ((SynLongIdent ([F2], [], [None]), true), None, None, + (4,3--4,5), None)], (3,0--4,8), { OpeningBraceRange = (3,0--3,2) }), (3,0--4,8))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl index c40cd96963e..1cc58c33049 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl @@ -7,20 +7,26 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F1], [], [None]), Some (3,6--3,7), - Const (Int32 1, (3,8--3,9))); - (SynLongIdent ([F2], [], [None]), Some (4,6--4,7), - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Equality], [], [Some (OriginalNotation "=")]), - None, (5,6--5,7)), Ident F3, (5,3--5,7)), - Const (Int32 3, (5,8--5,9)), (5,3--5,9)))], (3,0--5,12), - { OpeningBraceRange = (3,0--3,2) }), (3,0--5,12))], + [SynExprRecordField + ((SynLongIdent ([F1], [], [None]), true), Some (3,6--3,7), + Some (Const (Int32 1, (3,8--3,9))), (3,3--3,9), + Some (Offside ((3,10--4,3), None))); + SynExprRecordField + ((SynLongIdent ([F2], [], [None]), true), Some (4,6--4,7), + Some + (App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Equality], [], + [Some (OriginalNotation "=")]), None, + (5,6--5,7)), Ident F3, (5,3--5,7)), + Const (Int32 3, (5,8--5,9)), (5,3--5,9))), (4,3--5,9), + None)], (3,0--5,12), { OpeningBraceRange = (3,0--3,2) }), + (3,0--5,12))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl index cc908ff2853..4921cb9582d 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl @@ -7,13 +7,17 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F1], [], [None]), Some (3,6--3,7), - Const (Int32 1, (3,8--3,9))); - (SynLongIdent ([F2], [], [None]), None, - ArbitraryAfterError ("anonField", (4,3--4,5))); - (SynLongIdent ([F3], [], [None]), Some (5,6--5,7), - Const (Int32 3, (5,8--5,9)))], (3,0--5,12), - { OpeningBraceRange = (3,0--3,2) }), (3,0--5,12))], + [SynExprRecordField + ((SynLongIdent ([F1], [], [None]), true), Some (3,6--3,7), + Some (Const (Int32 1, (3,8--3,9))), (3,3--3,9), + Some (Offside ((3,10--4,3), None))); + SynExprRecordField + ((SynLongIdent ([F2], [], [None]), true), None, None, + (4,3--4,5), Some (Offside ((4,6--5,3), None))); + SynExprRecordField + ((SynLongIdent ([F3], [], [None]), true), Some (5,6--5,7), + Some (Const (Int32 3, (5,8--5,9))), (5,3--5,9), None)], + (3,0--5,12), { OpeningBraceRange = (3,0--3,2) }), (3,0--5,12))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl index 4fe46cfb3d5..ab92e60fd1a 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl @@ -7,18 +7,22 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([F1], [], [None]), Some (3,6--3,7), - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_Equality], [], [Some (OriginalNotation "=")]), - None, (4,6--4,7)), Ident F2, (4,3--4,7)), - Const (Int32 2, (4,8--4,9)), (4,3--4,9)))], (3,0--4,12), - { OpeningBraceRange = (3,0--3,2) }), (3,0--4,12))], + [SynExprRecordField + ((SynLongIdent ([F1], [], [None]), true), Some (3,6--3,7), + Some + (App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Equality], [], + [Some (OriginalNotation "=")]), None, + (4,6--4,7)), Ident F2, (4,3--4,7)), + Const (Int32 2, (4,8--4,9)), (4,3--4,9))), (3,3--4,9), + None)], (3,0--4,12), { OpeningBraceRange = (3,0--3,2) }), + (3,0--4,12))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl index abb76d98ae6..7d528a8649e 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl @@ -7,8 +7,9 @@ ImplFile [Expr (AnonRecd (true, None, - [(SynLongIdent ([Foo], [], [None]), Some (3,11--3,12), - Ident someValue)], (2,0--5,16), + [SynExprRecordField + ((SynLongIdent ([Foo], [], [None]), true), Some (3,11--3,12), + Some (Ident someValue), (3,7--5,13), None)], (2,0--5,16), { OpeningBraceRange = (3,4--3,6) }), (2,0--5,16)); Expr (AnonRecd diff --git a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl index e7e6666975a..2fbff28254e 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl @@ -10,13 +10,18 @@ ImplFile [Expr (AnonRecd (false, None, - [(SynLongIdent ([X], [], [None]), Some (2,5--2,6), - Const (Int32 5, (2,7--2,8))); - (SynLongIdent ([Y], [], [None]), Some (3,8--3,9), - Const (Int32 6, (3,10--3,11))); - (SynLongIdent ([Z], [], [None]), Some (4,12--4,13), - Const (Int32 7, (4,14--4,15)))], (2,0--4,18), - { OpeningBraceRange = (2,0--2,2) }), (2,0--4,18))], + [SynExprRecordField + ((SynLongIdent ([X], [], [None]), true), Some (2,5--2,6), + Some (Const (Int32 5, (2,7--2,8))), (2,3--2,8), + Some (Offside ((2,9--3,3), None))); + SynExprRecordField + ((SynLongIdent ([Y], [], [None]), true), Some (3,8--3,9), + Some (Const (Int32 6, (3,10--3,11))), (3,3--3,11), + Some (Offside ((3,12--4,3), None))); + SynExprRecordField + ((SynLongIdent ([Z], [], [None]), true), Some (4,12--4,13), + Some (Const (Int32 7, (4,14--4,15))), (4,3--4,15), None)], + (2,0--4,18), { OpeningBraceRange = (2,0--2,2) }), (2,0--4,18))], PreXmlDocEmpty, [], None, (2,0--4,18), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] From e5265b1d6077c8f24c91fead63ecea1fb37d2b3d Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Wed, 17 Sep 2025 21:32:52 +0100 Subject: [PATCH 3/5] Reduce diff --- .../Checking/Expressions/CheckExpressions.fs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 87567e9eb8e..4370f3a5154 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -7855,30 +7855,30 @@ and CheckAnonRecdExprDuplicateFields (elems: Ident array) = errorR(Error (FSComp.SR.tcAnonRecdDuplicateFieldId(uc1.idText), uc1.idRange)))) // Check '{| .... |}' -and TcAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, optOrigSynExpr, recordFields: SynExprRecordField list, mWholeExpr) = +and TcAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, optOrigSynExpr, unsortedFieldIdsAndSynExprsGiven: SynExprRecordField list, mWholeExpr) = match optOrigSynExpr with | None -> - TcNewAnonRecdExpr cenv overallTy env tpenv (isStruct, recordFields, mWholeExpr) + TcNewAnonRecdExpr cenv overallTy env tpenv (isStruct, unsortedFieldIdsAndSynExprsGiven, mWholeExpr) | Some orig -> // Ideally we should also check for duplicate field IDs in the TcCopyAndUpdateAnonRecdExpr case, but currently the logic is too complex to guarantee a proper error reporting // So here we error instead errorR to avoid cascading internal errors - recordFields + unsortedFieldIdsAndSynExprsGiven |> List.countBy (fun (SynExprRecordField(fieldName = (fId, _))) -> textOfLid fId.LongIdent) |> List.iter (fun (label, count) -> if count > 1 then error (Error (FSComp.SR.tcAnonRecdDuplicateFieldId(label), mWholeExpr))) - TcCopyAndUpdateAnonRecdExpr cenv overallTy env tpenv (isStruct, orig, recordFields, mWholeExpr) + TcCopyAndUpdateAnonRecdExpr cenv overallTy env tpenv (isStruct, orig, unsortedFieldIdsAndSynExprsGiven, mWholeExpr) -and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, recordFields: SynExprRecordField list, mWholeExpr) = +and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, unsortedFieldIdsAndSynExprsGiven: SynExprRecordField list, mWholeExpr) = let g = cenv.g // For new anonymous records, each field label must be a single identifier. // If a long identifier is given, report an error and skip that entry for typechecking purposes. // Also normalize missing expressions to an error expression to keep traversal stable. - let validFields : (Ident * SynExpr * SynLongIdent) list = - recordFields + let unsortedFieldIdsAndSynExprsGiven : (Ident * SynExpr * SynLongIdent) list = + unsortedFieldIdsAndSynExprsGiven |> List.choose (fun (SynExprRecordField(fieldName = (synLongIdent, _); expr = expr)) -> match synLongIdent.LongIdent with | [ id ] -> @@ -7896,9 +7896,9 @@ and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, recordFields: errorR (Error(FSComp.SR.parsInvalidAnonRecdType(), synLongIdent.Range)) None) - let unsortedFieldSynExprsGiven = validFields |> List.map (fun (_, e, _) -> e) + let unsortedFieldSynExprsGiven = unsortedFieldIdsAndSynExprsGiven |> List.map (fun (_, e, _) -> e) - let unsortedFieldIds = validFields |> List.map (fun (id, _, _) -> id) |> List.toArray + let unsortedFieldIds = unsortedFieldIdsAndSynExprsGiven |> List.map (fun (id, _, _) -> id) |> List.toArray let anonInfo, sortedFieldTys = UnifyAnonRecdTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv mWholeExpr overallTy isStruct unsortedFieldIds @@ -7908,15 +7908,15 @@ and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, recordFields: // Sort into canonical order let sortedIndexedArgs = - validFields + unsortedFieldIdsAndSynExprsGiven |> List.indexed |> List.sortBy (fun (i,_) -> unsortedFieldIds[i].idText) // Map from sorted indexes to unsorted indexes let sigma = sortedIndexedArgs |> List.map fst |> List.toArray - let sortedFieldTriples = sortedIndexedArgs |> List.map snd + let sortedFieldExprs = sortedIndexedArgs |> List.map snd - sortedFieldTriples + sortedFieldExprs |> List.iteri (fun j (_, _, synLongIdent) -> let m = rangeOfLid synLongIdent.LongIdent let item = Item.AnonRecdField(anonInfo, sortedFieldTys, j, m) @@ -7935,7 +7935,7 @@ and TcNewAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, recordFields: mkAnonRecd g mWholeExpr anonInfo unsortedFieldIds unsortedCheckedArgs unsortedFieldTys, tpenv -and TcCopyAndUpdateAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, (origExpr, blockSeparator), recordFields: SynExprRecordField list, mWholeExpr) = +and TcCopyAndUpdateAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, (origExpr, blockSeparator), unsortedFieldIdsAndSynExprsGiven: SynExprRecordField list, mWholeExpr) = // The fairly complex case '{| origExpr with X = 1; Y = 2 |}' // The origExpr may be either a record or anonymous record. // The origExpr may be either a struct or not. @@ -7956,7 +7956,7 @@ and TcCopyAndUpdateAnonRecdExpr cenv (overallTy: TType) env tpenv (isStruct, (or // Expand expressions with respect to potentially nesting let unsortedFieldIdsAndSynExprsGiven = - recordFields + unsortedFieldIdsAndSynExprsGiven |> List.map (fun (SynExprRecordField(fieldName = (synLongIdent, _); expr = e)) -> match synLongIdent.LongIdent with | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(), mWholeExpr)) From 99a8c87f7becd65602877eb948932b43bdc2b739 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Wed, 17 Sep 2025 23:15:16 +0100 Subject: [PATCH 4/5] update baselines --- .../ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl | 2 +- .../ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 1e08e69a953..f47f8818aa1 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -34,7 +34,7 @@ [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2235::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1447-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x000005FD][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1448-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000627][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-516::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-516::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-516::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 5830b7dd0a1..79846e3ca37 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -33,7 +33,7 @@ [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2235::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1447-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000618][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1448-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000640][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-531::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-531::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-531::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. From 7d052dec6514bfb3c20c9a12fee394249da6d652 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Thu, 18 Sep 2025 20:21:20 +0100 Subject: [PATCH 5/5] update baselines --- .../ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl | 2 +- .../ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 9a9e0b97a9f..b17d445ce83 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -34,7 +34,7 @@ [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x000005FD][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000627][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 0ffe02881a3..79c081c00b1 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -33,7 +33,7 @@ [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000618][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000640][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack.