From ec79e8574c107c0df444b9e7b8eeeceb2a25e7c0 Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 10 Feb 2024 17:35:02 +0800 Subject: [PATCH 01/43] Allow access modifies to auto properties --- src/Compiler/Checking/CheckBasics.fs | 1 + src/Compiler/Checking/CheckBasics.fsi | 1 + src/Compiler/Checking/CheckDeclarations.fs | 6 ++-- src/Compiler/Checking/CheckExpressions.fsi | 1 + .../Checking/CheckIncrementalClasses.fs | 1 + .../Checking/CheckIncrementalClasses.fsi | 1 + src/Compiler/Service/ServiceNavigation.fs | 6 ++-- src/Compiler/Service/ServiceNavigation.fsi | 1 + src/Compiler/SyntaxTree/ParseHelpers.fs | 13 ++++++- src/Compiler/SyntaxTree/SyntaxTree.fs | 23 ++---------- src/Compiler/SyntaxTree/SyntaxTree.fsi | 17 ++------- src/Compiler/SyntaxTree/SyntaxTrivia.fs | 24 +++++++++++-- src/Compiler/SyntaxTree/SyntaxTrivia.fsi | 16 ++++++++- src/Compiler/pars.fsy | 36 +++++++++++++++---- 14 files changed, 96 insertions(+), 51 deletions(-) diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs index bbfa5557b2d..7ab45d7aef5 100644 --- a/src/Compiler/Checking/CheckBasics.fs +++ b/src/Compiler/Checking/CheckBasics.fs @@ -20,6 +20,7 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text +open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps diff --git a/src/Compiler/Checking/CheckBasics.fsi b/src/Compiler/Checking/CheckBasics.fsi index e3ad581cb61..d4c32f93c7d 100644 --- a/src/Compiler/Checking/CheckBasics.fsi +++ b/src/Compiler/Checking/CheckBasics.fsi @@ -18,6 +18,7 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text +open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index ef59411179e..727fc168a72 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -4342,7 +4342,7 @@ module TcDeclarations = let rec postAutoProps memb = match memb with | SynMemberDefn.AutoProperty(ident = id) when String.IsNullOrEmpty(id.idText) -> [] - | SynMemberDefn.AutoProperty(attributes=Attributes attribs; isStatic=isStatic; ident=id; typeOpt=tyOpt; propKind=propKind; memberFlags=memberFlags; memberFlagsForSet=memberFlagsForSet; xmlDoc=xmlDoc; accessibility=access; trivia = { GetSetKeywords = mGetSetOpt }) -> + | SynMemberDefn.AutoProperty(attributes=Attributes attribs; isStatic=isStatic; ident=id; typeOpt=tyOpt; propKind=propKind; memberFlags=memberFlags; memberFlagsForSet=memberFlagsForSet; xmlDoc=xmlDoc; trivia = { GetSetKeywords = mGetSetOpt }; getterAccessibility = getterAccesss; setterAccessibility = setterAccess) -> let mMemberPortion = id.idRange // Only the keep the non-field-targeted attributes let attribs = attribs |> List.filter (fun a -> match a.Target with Some t when t.idText = "field" -> false | _ -> true) @@ -4365,7 +4365,7 @@ module TcDeclarations = let rhsExpr = SynExpr.Ident fldId let retInfo = match tyOpt with None -> None | Some ty -> Some (None, SynReturnInfo((ty, SynInfo.unnamedRetVal), ty.Range)) let attribs = mkAttributeList attribs mMemberPortion - let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, retInfo, rhsExpr, rhsExpr.Range, [], attribs, Some memberFlags, SynBindingTrivia.Zero) + let binding = mkSynBinding (xmlDoc, headPat) (getterAccesss, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, retInfo, rhsExpr, rhsExpr.Range, [], attribs, Some memberFlags, SynBindingTrivia.Zero) SynMemberDefn.Member (binding, mMemberPortion) yield getter | _ -> () @@ -4377,7 +4377,7 @@ module TcDeclarations = let vId = ident("v", mMemberPortion) let headPat = SynPat.LongIdent (SynLongIdent(headPatIds, [], List.replicate headPatIds.Length None), None, Some noInferredTypars, SynArgPats.Pats [mkSynPatVar None vId], None, mMemberPortion) let rhsExpr = mkSynAssign (SynExpr.Ident fldId) (SynExpr.Ident vId) - let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, None, rhsExpr, rhsExpr.Range, [], [], Some memberFlagsForSet, SynBindingTrivia.Zero) + let binding = mkSynBinding (xmlDoc, headPat) (setterAccess, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, None, rhsExpr, rhsExpr.Range, [], [], Some memberFlagsForSet, SynBindingTrivia.Zero) SynMemberDefn.Member (binding, mMemberPortion) yield setter | _ -> ()] diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 852fee213e6..7a17b798cbd 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -18,6 +18,7 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.Xml +open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.CheckBasics diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index 85262e72a4c..555cc36edc1 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -19,6 +19,7 @@ open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.Text open FSharp.Compiler.Xml open FSharp.Compiler.TcGlobals +open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fsi b/src/Compiler/Checking/CheckIncrementalClasses.fsi index 428ae98b632..0694dea5c8e 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fsi +++ b/src/Compiler/Checking/CheckIncrementalClasses.fsi @@ -7,6 +7,7 @@ open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text +open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.Xml diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index 03afe63b373..225cc24b4dc 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -13,6 +13,7 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.Text open FSharp.Compiler.Text.Range +open FSharp.Compiler.SyntaxTrivia /// Represents the different kinds of items that can appear in the navigation bar [] @@ -332,9 +333,10 @@ module NavigationImpl = [ createMember (rcid, NavigationItemKind.Field, FSharpGlyph.Field, range, enclosingEntityKind, false, access) ] - | SynMemberDefn.AutoProperty(ident = id; accessibility = access) -> + | SynMemberDefn.AutoProperty(ident = id; getterAccessibility = getterAccessibility; setterAccessibility = setterAccessibility) -> [ - createMember (id, NavigationItemKind.Field, FSharpGlyph.Field, id.idRange, enclosingEntityKind, false, access) + createMember (id, NavigationItemKind.Field, FSharpGlyph.Field, id.idRange, enclosingEntityKind, false, getterAccessibility) + createMember (id, NavigationItemKind.Field, FSharpGlyph.Field, id.idRange, enclosingEntityKind, false, setterAccessibility) ] | SynMemberDefn.AbstractSlot(slotSig = SynValSig(ident = SynIdent(id, _); synType = ty; accessibility = access)) -> [ diff --git a/src/Compiler/Service/ServiceNavigation.fsi b/src/Compiler/Service/ServiceNavigation.fsi index 360855cce39..eddb1c6e7c8 100755 --- a/src/Compiler/Service/ServiceNavigation.fsi +++ b/src/Compiler/Service/ServiceNavigation.fsi @@ -7,6 +7,7 @@ namespace FSharp.Compiler.EditorServices +open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.Syntax open FSharp.Compiler.Text diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index cd4b41787e1..573d66a32fa 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -1117,6 +1117,16 @@ let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDo let memberFlagsForSet = flags SynMemberKind.PropertySet let isStatic = not memberFlags.IsInstance + let getterAccess, setterAccess = + match access, getSetOpt with + | Some _, Some(GetSetKeywords.GetSet(_, None, _, None)) -> access, access + | Some _, Some(GetSetKeywords.GetSet(_, Some x, _, _)) + | Some _, Some(GetSetKeywords.GetSet(_, _, _, Some x)) -> raiseParseErrorAt x.Range (FSComp.SR.parsMultipleAccessibilitiesForGetSet()) + | None, Some(GetSetKeywords.GetSet(_, getterAccess, _, setterAccess)) -> getterAccess, setterAccess + | _, Some(GetSetKeywords.Get _) -> access, None + | _, Some(GetSetKeywords.Set _) -> None, access + | _ -> None, None + let trivia = { LeadingKeyword = leadingKeyword @@ -1134,7 +1144,8 @@ let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDo memberFlags, memberFlagsForSet, xmlDoc, - access, + getterAccess, + setterAccess, expr, memberRange, trivia diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 8b034740be4..d039b4a66ce 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -201,26 +201,6 @@ type SynRationalConst = | Paren of rationalConst: SynRationalConst * range: range -[] -type SynAccess = - | Public of range: range - - | Internal of range: range - - | Private of range: range - - override this.ToString() = - match this with - | Public _ -> "Public" - | Internal _ -> "Internal" - | Private _ -> "Private" - - member this.Range: range = - match this with - | Public m - | Internal m - | Private m -> m - [] type DebugPointAtTarget = | Yes @@ -1462,7 +1442,8 @@ type SynMemberDefn = memberFlags: SynMemberFlags * memberFlagsForSet: SynMemberFlags * xmlDoc: PreXmlDoc * - accessibility: SynAccess option * + getterAccessibility: SynAccess option * + setterAccessibility: SynAccess option * synExpr: SynExpr * range: range * trivia: SynMemberDefnAutoPropertyTrivia diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 3d9ef06dcad..1eb99ea0dd8 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -228,20 +228,6 @@ type SynRationalConst = | Paren of rationalConst: SynRationalConst * range: range -/// Represents an accessibility modifier in F# syntax -[] -type SynAccess = - /// A construct marked or assumed 'public' - | Public of range: range - - /// A construct marked or assumed 'internal' - | Internal of range: range - - /// A construct marked or assumed 'private' - | Private of range: range - - member Range: range - /// Represents whether a debug point should be present for the target /// of a decision tree, that is whether the construct corresponds to a debug /// point in the original source. @@ -1655,7 +1641,8 @@ type SynMemberDefn = memberFlags: SynMemberFlags * memberFlagsForSet: SynMemberFlags * xmlDoc: PreXmlDoc * - accessibility: SynAccess option * + getterAccessibility: SynAccess option * + setterAccessibility: SynAccess option * synExpr: SynExpr * range: range * trivia: SynMemberDefnAutoPropertyTrivia diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fs b/src/Compiler/SyntaxTree/SyntaxTrivia.fs index 7330ac9b695..1f7e35b81e5 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fs +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fs @@ -346,17 +346,37 @@ type SynMemberDefnImplicitCtorTrivia = { AsKeyword: range option } [] type SynArgPatsNamePatPairsTrivia = { ParenRange: range } +[] +type SynAccess = + | Public of range: range + + | Internal of range: range + + | Private of range: range + + override this.ToString() = + match this with + | Public _ -> "Public" + | Internal _ -> "Internal" + | Private _ -> "Private" + + member this.Range: range = + match this with + | Public m + | Internal m + | Private m -> m + [] type GetSetKeywords = | Get of range | Set of range - | GetSet of get: range * set: range + | GetSet of get: range * getterAccess: SynAccess option * set: range * setterAccess: SynAccess option member x.Range = match x with | Get m | Set m -> m - | GetSet(mG, mS) -> + | GetSet(mG, _, mS, _) -> if Range.rangeBeforePos mG mS.Start then Range.unionRanges mG mS else diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi index 137f5432803..d11eb876617 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi @@ -444,12 +444,26 @@ type SynArgPatsNamePatPairsTrivia = ParenRange: range } +/// Represents an accessibility modifier in F# syntax +[] +type SynAccess = + /// A construct marked or assumed 'public' + | Public of range: range + + /// A construct marked or assumed 'internal' + | Internal of range: range + + /// A construct marked or assumed 'private' + | Private of range: range + + member Range: range + /// Represents additional information for `get, set` syntax [] type GetSetKeywords = | Get of range | Set of range - | GetSet of get: range * set: range + | GetSet of get: range * getterAccess: SynAccess option * set: range * setterAccess: SynAccess option member Range: range diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 6c5415667d0..892bb6c9ee2 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -1048,20 +1048,44 @@ classMemberSpfnGetSetElements: else raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsGetOrSetRequired())) } - | nameop COMMA nameop + | opt_access nameop COMMA nameop + { let (SynIdent(id, _)) = $2 + let (SynIdent(id2, _)) = $4 + if not ((id.idText = "get" && id2.idText = "set") || + (id.idText = "set" && id2.idText = "get")) then + raiseParseErrorAt (rhs2 parseState 1 3) (FSComp.SR.parsGetOrSetRequired()) + + if id.idText = "get" then + SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id.idRange, $1, id2.idRange, None)) + else + SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id2.idRange, None, id.idRange, $1)) } + + | nameop COMMA opt_access nameop { let (SynIdent(id, _)) = $1 - let (SynIdent(id2, _)) = $3 + let (SynIdent(id2, _)) = $4 if not ((id.idText = "get" && id2.idText = "set") || (id.idText = "set" && id2.idText = "get")) then raiseParseErrorAt (rhs2 parseState 1 3) (FSComp.SR.parsGetOrSetRequired()) if id.idText = "get" then - SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id.idRange, id2.idRange)) + SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id.idRange, None, id2.idRange, $3)) else - SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id2.idRange, id.idRange)) } + SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id2.idRange, $3, id.idRange, None)) } - | nameop COMMA recover - { (let (SynIdent(id:Ident, _)) = $1 + | opt_access nameop COMMA opt_access nameop + { let (SynIdent(id, _)) = $2 + let (SynIdent(id2, _)) = $5 + if not ((id.idText = "get" && id2.idText = "set") || + (id.idText = "set" && id2.idText = "get")) then + raiseParseErrorAt (rhs2 parseState 1 3) (FSComp.SR.parsGetOrSetRequired()) + + if id.idText = "get" then + SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id.idRange, $1, id2.idRange, $4)) + else + SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id2.idRange, $4, id.idRange, $1)) } + + | opt_access nameop COMMA recover + { (let (SynIdent(id:Ident, _)) = $2 if id.idText = "get" then SynMemberKind.PropertyGet, Some(GetSetKeywords.Get id.idRange) else if id.idText = "set" then From 47f34ab3251f256ca0923a0af5bbfc44f6852959 Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 10 Feb 2024 18:22:53 +0800 Subject: [PATCH 02/43] move types --- src/Compiler/Checking/CheckBasics.fs | 1 - src/Compiler/Checking/CheckBasics.fsi | 1 - src/Compiler/Checking/CheckExpressions.fsi | 1 - .../Checking/CheckIncrementalClasses.fs | 1 - .../Checking/CheckIncrementalClasses.fsi | 1 - src/Compiler/Service/ServiceNavigation.fs | 1 - src/Compiler/Service/ServiceNavigation.fsi | 1 - src/Compiler/SyntaxTree/ParseHelpers.fs | 5 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 61 +++++++++++++++++++ src/Compiler/SyntaxTree/SyntaxTree.fsi | 60 ++++++++++++++++++ src/Compiler/SyntaxTree/SyntaxTrivia.fs | 61 ------------------- src/Compiler/SyntaxTree/SyntaxTrivia.fsi | 60 ------------------ 12 files changed, 124 insertions(+), 130 deletions(-) diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs index 7ab45d7aef5..bbfa5557b2d 100644 --- a/src/Compiler/Checking/CheckBasics.fs +++ b/src/Compiler/Checking/CheckBasics.fs @@ -20,7 +20,6 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text -open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps diff --git a/src/Compiler/Checking/CheckBasics.fsi b/src/Compiler/Checking/CheckBasics.fsi index d4c32f93c7d..e3ad581cb61 100644 --- a/src/Compiler/Checking/CheckBasics.fsi +++ b/src/Compiler/Checking/CheckBasics.fsi @@ -18,7 +18,6 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text -open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 7a17b798cbd..852fee213e6 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -18,7 +18,6 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.Xml -open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.CheckBasics diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index 555cc36edc1..85262e72a4c 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -19,7 +19,6 @@ open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.Text open FSharp.Compiler.Xml open FSharp.Compiler.TcGlobals -open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fsi b/src/Compiler/Checking/CheckIncrementalClasses.fsi index 0694dea5c8e..428ae98b632 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fsi +++ b/src/Compiler/Checking/CheckIncrementalClasses.fsi @@ -7,7 +7,6 @@ open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text -open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.Xml diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index 225cc24b4dc..c64b93042f8 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -13,7 +13,6 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.Text open FSharp.Compiler.Text.Range -open FSharp.Compiler.SyntaxTrivia /// Represents the different kinds of items that can appear in the navigation bar [] diff --git a/src/Compiler/Service/ServiceNavigation.fsi b/src/Compiler/Service/ServiceNavigation.fsi index eddb1c6e7c8..360855cce39 100755 --- a/src/Compiler/Service/ServiceNavigation.fsi +++ b/src/Compiler/Service/ServiceNavigation.fsi @@ -7,7 +7,6 @@ namespace FSharp.Compiler.EditorServices -open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.Syntax open FSharp.Compiler.Text diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index 573d66a32fa..25c5dde1b24 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -1118,10 +1118,11 @@ let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDo let isStatic = not memberFlags.IsInstance let getterAccess, setterAccess = - match access, getSetOpt with + match access, getSetOpt with | Some _, Some(GetSetKeywords.GetSet(_, None, _, None)) -> access, access | Some _, Some(GetSetKeywords.GetSet(_, Some x, _, _)) - | Some _, Some(GetSetKeywords.GetSet(_, _, _, Some x)) -> raiseParseErrorAt x.Range (FSComp.SR.parsMultipleAccessibilitiesForGetSet()) + | Some _, Some(GetSetKeywords.GetSet(_, _, _, Some x)) -> + raiseParseErrorAt x.Range (FSComp.SR.parsMultipleAccessibilitiesForGetSet ()) | None, Some(GetSetKeywords.GetSet(_, getterAccess, _, setterAccess)) -> getterAccess, setterAccess | _, Some(GetSetKeywords.Get _) -> access, None | _, Some(GetSetKeywords.Set _) -> None, access diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index d039b4a66ce..7585daf8c63 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -201,6 +201,67 @@ type SynRationalConst = | Paren of rationalConst: SynRationalConst * range: range +[] +type SynAccess = + | Public of range: range + + | Internal of range: range + + | Private of range: range + + override this.ToString() = + match this with + | Public _ -> "Public" + | Internal _ -> "Internal" + | Private _ -> "Private" + + member this.Range: range = + match this with + | Public m + | Internal m + | Private m -> m + +[] +type GetSetKeywords = + | Get of range + | Set of range + | GetSet of get: range * getterAccess: SynAccess option * set: range * setterAccess: SynAccess option + + member x.Range = + match x with + | Get m + | Set m -> m + | GetSet(mG, _, mS, _) -> + if Range.rangeBeforePos mG mS.Start then + Range.unionRanges mG mS + else + Range.unionRanges mS mG + +[] +type SynMemberDefnAutoPropertyTrivia = + { + LeadingKeyword: SynLeadingKeyword + WithKeyword: range option + EqualsRange: range option + GetSetKeywords: GetSetKeywords option + } + +[] +type SynMemberDefnAbstractSlotTrivia = + { + GetSetKeywords: GetSetKeywords option + } + + static member Zero = { GetSetKeywords = None } + +[] +type SynMemberSigMemberTrivia = + { + GetSetKeywords: GetSetKeywords option + } + + static member Zero: SynMemberSigMemberTrivia = { GetSetKeywords = None } + [] type DebugPointAtTarget = | Yes diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 1eb99ea0dd8..5ee96309126 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -228,6 +228,66 @@ type SynRationalConst = | Paren of rationalConst: SynRationalConst * range: range +/// Represents an accessibility modifier in F# syntax +[] +type SynAccess = + /// A construct marked or assumed 'public' + | Public of range: range + + /// A construct marked or assumed 'internal' + | Internal of range: range + + /// A construct marked or assumed 'private' + | Private of range: range + + member Range: range + +/// Represents additional information for `get, set` syntax +[] +type GetSetKeywords = + | Get of range + | Set of range + | GetSet of get: range * getterAccess: SynAccess option * set: range * setterAccess: SynAccess option + + member Range: range + +/// Represents additional information for SynMemberDefn.AutoProperty +[] +type SynMemberDefnAutoPropertyTrivia = + { + /// Used leading keyword of AutoProperty + LeadingKeyword: SynLeadingKeyword + + /// The syntax range of the `with` keyword + WithKeyword: range option + + /// The syntax range of the `=` token + EqualsRange: range option + + /// The syntax range of 'get, set' + GetSetKeywords: GetSetKeywords option + } + +/// Represents additional information for SynMemberDefn.AbstractSlot +[] +type SynMemberDefnAbstractSlotTrivia = + { + /// The syntax range of 'get, set' + GetSetKeywords: GetSetKeywords option + } + + static member Zero: SynMemberDefnAbstractSlotTrivia + +/// Represents additional information for SynMemberSig.Member +[] +type SynMemberSigMemberTrivia = + { + /// The syntax range of 'get, set' + GetSetKeywords: GetSetKeywords option + } + + static member Zero: SynMemberSigMemberTrivia + /// Represents whether a debug point should be present for the target /// of a decision tree, that is whether the construct corresponds to a debug /// point in the original source. diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fs b/src/Compiler/SyntaxTree/SyntaxTrivia.fs index 1f7e35b81e5..8b5d439a7ec 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fs +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fs @@ -346,59 +346,6 @@ type SynMemberDefnImplicitCtorTrivia = { AsKeyword: range option } [] type SynArgPatsNamePatPairsTrivia = { ParenRange: range } -[] -type SynAccess = - | Public of range: range - - | Internal of range: range - - | Private of range: range - - override this.ToString() = - match this with - | Public _ -> "Public" - | Internal _ -> "Internal" - | Private _ -> "Private" - - member this.Range: range = - match this with - | Public m - | Internal m - | Private m -> m - -[] -type GetSetKeywords = - | Get of range - | Set of range - | GetSet of get: range * getterAccess: SynAccess option * set: range * setterAccess: SynAccess option - - member x.Range = - match x with - | Get m - | Set m -> m - | GetSet(mG, _, mS, _) -> - if Range.rangeBeforePos mG mS.Start then - Range.unionRanges mG mS - else - Range.unionRanges mS mG - -[] -type SynMemberDefnAutoPropertyTrivia = - { - LeadingKeyword: SynLeadingKeyword - WithKeyword: range option - EqualsRange: range option - GetSetKeywords: GetSetKeywords option - } - -[] -type SynMemberDefnAbstractSlotTrivia = - { - GetSetKeywords: GetSetKeywords option - } - - static member Zero = { GetSetKeywords = None } - [] type SynFieldTrivia = { @@ -418,14 +365,6 @@ type SynTypeOrTrivia = { OrKeyword: range } [] type SynBindingReturnInfoTrivia = { ColonRange: range option } -[] -type SynMemberSigMemberTrivia = - { - GetSetKeywords: GetSetKeywords option - } - - static member Zero: SynMemberSigMemberTrivia = { GetSetKeywords = None } - [] type SynTyparDeclTrivia = { diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi index d11eb876617..a3ffe0227a3 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi @@ -444,56 +444,6 @@ type SynArgPatsNamePatPairsTrivia = ParenRange: range } -/// Represents an accessibility modifier in F# syntax -[] -type SynAccess = - /// A construct marked or assumed 'public' - | Public of range: range - - /// A construct marked or assumed 'internal' - | Internal of range: range - - /// A construct marked or assumed 'private' - | Private of range: range - - member Range: range - -/// Represents additional information for `get, set` syntax -[] -type GetSetKeywords = - | Get of range - | Set of range - | GetSet of get: range * getterAccess: SynAccess option * set: range * setterAccess: SynAccess option - - member Range: range - -/// Represents additional information for SynMemberDefn.AutoProperty -[] -type SynMemberDefnAutoPropertyTrivia = - { - /// Used leading keyword of AutoProperty - LeadingKeyword: SynLeadingKeyword - - /// The syntax range of the `with` keyword - WithKeyword: range option - - /// The syntax range of the `=` token - EqualsRange: range option - - /// The syntax range of 'get, set' - GetSetKeywords: GetSetKeywords option - } - -/// Represents additional information for SynMemberDefn.AbstractSlot -[] -type SynMemberDefnAbstractSlotTrivia = - { - /// The syntax range of 'get, set' - GetSetKeywords: GetSetKeywords option - } - - static member Zero: SynMemberDefnAbstractSlotTrivia - /// Represents additional information for SynField [] type SynFieldTrivia = @@ -522,16 +472,6 @@ type SynBindingReturnInfoTrivia = ColonRange: range option } -/// Represents additional information for SynMemberSig.Member -[] -type SynMemberSigMemberTrivia = - { - /// The syntax range of 'get, set' - GetSetKeywords: GetSetKeywords option - } - - static member Zero: SynMemberSigMemberTrivia - /// Represents additional information for SynTyparDecl [] type SynTyparDeclTrivia = From 76e615bb10acd903b0453fad21ce1c19528320e9 Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 10 Feb 2024 18:26:06 +0800 Subject: [PATCH 03/43] update release note --- docs/release-notes/.FSharp.Compiler.Service/8.0.300.md | 1 + docs/release-notes/.Language/preview.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md index 6a4d44d2aec..7ac58e299f3 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -18,6 +18,7 @@ * Higher-order-function-based API for working with the untyped abstract syntax tree. ([PR #16462](https://github.com/dotnet/fsharp/pull/16462)) * Allow returning bool instead of unit option for partial active patterns. ([Language suggestion #1041](https://github.com/fsharp/fslang-suggestions/issues/1041), [PR #16473](https://github.com/dotnet/fsharp/pull/16473)) * Symbols: Add GenericArguments to FSharpEntity ([PR #16470](https://github.com/dotnet/fsharp/pull/16470)) +* Allow access modifies to auto properties getters and setters ([PR 16687](https://github.com/dotnet/fsharp/pull/16687), [Language suggestion #430](https://github.com/fsharp/fslang-suggestions/issues/430)) ### Changed diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 832dd924a44..5559fee7313 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -4,6 +4,7 @@ * Bidirectional F#/C# interop for 'unmanaged' constraint. ([PR #12154](https://github.com/dotnet/fsharp/pull/12154)) * Make `.Is*` discriminated union properties visible. ([Language suggestion #222](https://github.com/fsharp/fslang-suggestions/issues/222), [PR #16341](https://github.com/dotnet/fsharp/pull/16341)) * Allow returning bool instead of unit option for partial active patterns. ([Language suggestion #1041](https://github.com/fsharp/fslang-suggestions/issues/1041), [PR #16473](https://github.com/dotnet/fsharp/pull/16473)) +* Allow access modifies to auto properties getters and setters ([PR 16687](https://github.com/dotnet/fsharp/pull/16687), [Language suggestion #430](https://github.com/fsharp/fslang-suggestions/issues/430)) ### Fixed From 5c3b230edd1fa26eb645f22705af0bf912d2d872 Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 10 Feb 2024 20:38:35 +0800 Subject: [PATCH 04/43] Put it under preview flag --- src/Compiler/FSComp.txt | 3 ++- src/Compiler/Facilities/LanguageFeatures.fs | 4 ++++ src/Compiler/Facilities/LanguageFeatures.fsi | 1 + src/Compiler/SyntaxTree/ParseHelpers.fs | 12 ++++++++++-- src/Compiler/SyntaxTree/ParseHelpers.fsi | 1 + src/Compiler/SyntaxTree/SyntaxTree.fs | 1 + src/Compiler/SyntaxTree/SyntaxTree.fsi | 1 + src/Compiler/pars.fsy | 8 ++++---- src/Compiler/xlf/FSComp.txt.cs.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.de.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.es.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.fr.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.it.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.ja.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.ko.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.pl.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.ru.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.tr.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 +++++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 +++++ 21 files changed, 89 insertions(+), 7 deletions(-) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index a9fc2692157..bd18f6b8ad3 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1742,4 +1742,5 @@ featureReuseSameFieldsInStructUnions,"Share underlying fields in a [] di 3862,parsStaticMemberImcompleteSyntax,"Incomplete declaration of a static construct. Use 'static let','static do','static member' or 'static val' for declaration." 3863,parsExpectingField,"Expecting record field" 3864,tooManyMethodsInDotNetTypeWritingAssembly,"The type '%s' has too many methods. Found: '%d', maximum: '%d'" -3865,parsOnlySimplePatternsAreAllowedInConstructors,"Only simple patterns are allowed in primary constructors" \ No newline at end of file +3865,parsOnlySimplePatternsAreAllowedInConstructors,"Only simple patterns are allowed in primary constructors" +featureAllowAccessModifiersToAutoPropertiesGettersAndSetters,"Allow access modifiers to auto properties getters and setters" \ No newline at end of file diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index e7c2a25ee3d..801bd0b229a 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -85,6 +85,7 @@ type LanguageFeature = | WarningIndexedPropertiesGetSetSameType | WarningWhenTailCallAttrOnNonRec | BooleanReturningAndReturnTypeDirectedPartialActivePattern + | AllowAccessModifiersToAutoPropertiesGettersAndSetters /// LanguageVersion management type LanguageVersion(versionText) = @@ -197,6 +198,7 @@ type LanguageVersion(versionText) = LanguageFeature.WarningWhenTailCallAttrOnNonRec, previewVersion LanguageFeature.UnionIsPropertiesVisible, previewVersion LanguageFeature.BooleanReturningAndReturnTypeDirectedPartialActivePattern, previewVersion + LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -340,6 +342,8 @@ type LanguageVersion(versionText) = | LanguageFeature.WarningWhenTailCallAttrOnNonRec -> FSComp.SR.featureChkTailCallAttrOnNonRec () | LanguageFeature.BooleanReturningAndReturnTypeDirectedPartialActivePattern -> FSComp.SR.featureBooleanReturningAndReturnTypeDirectedPartialActivePattern () + | LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters -> + FSComp.SR.featureAllowAccessModifiersToAutoPropertiesGettersAndSetters () /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 29d6c2c33a3..14e8cf51fe5 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -76,6 +76,7 @@ type LanguageFeature = | WarningIndexedPropertiesGetSetSameType | WarningWhenTailCallAttrOnNonRec | BooleanReturningAndReturnTypeDirectedPartialActivePattern + | AllowAccessModifiersToAutoPropertiesGettersAndSetters /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index 25c5dde1b24..17ee6f21834 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -1100,7 +1100,7 @@ let mkSynUnionCase attributes (access: SynAccess option) id kind mDecl (xmlDoc, let mDecl = unionRangeWithXmlDoc xmlDoc mDecl SynUnionCase(attributes, id, kind, xmlDoc, None, mDecl, trivia) -let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDoc attribs flags rangeStart = +let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDoc attribs flags rangeStart langVersion = let mWith, (getSet, getSetOpt) = accessors let memberRange = @@ -1123,7 +1123,14 @@ let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDo | Some _, Some(GetSetKeywords.GetSet(_, Some x, _, _)) | Some _, Some(GetSetKeywords.GetSet(_, _, _, Some x)) -> raiseParseErrorAt x.Range (FSComp.SR.parsMultipleAccessibilitiesForGetSet ()) - | None, Some(GetSetKeywords.GetSet(_, getterAccess, _, setterAccess)) -> getterAccess, setterAccess + | None, Some(GetSetKeywords.GetSet(_, getterAccess, _, setterAccess)) -> + match getterAccess, setterAccess with + | Some x, _ + | _, Some x -> + checkLanguageFeatureError langVersion LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range + | None, None -> () + + getterAccess, setterAccess | _, Some(GetSetKeywords.Get _) -> access, None | _, Some(GetSetKeywords.Set _) -> None, access | _ -> None, None @@ -1145,6 +1152,7 @@ let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDo memberFlags, memberFlagsForSet, xmlDoc, + access, getterAccess, setterAccess, expr, diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fsi b/src/Compiler/SyntaxTree/ParseHelpers.fsi index 9add16af683..2cb3c520343 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fsi +++ b/src/Compiler/SyntaxTree/ParseHelpers.fsi @@ -277,6 +277,7 @@ val mkAutoPropDefn: attribs: SynAttributes -> flags: (SynMemberKind -> SynMemberFlags) * SynLeadingKeyword -> rangeStart: range -> + langVersion: LanguageVersion -> SynMemberDefn val mkValField: diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 7585daf8c63..00d94c9648c 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1503,6 +1503,7 @@ type SynMemberDefn = memberFlags: SynMemberFlags * memberFlagsForSet: SynMemberFlags * xmlDoc: PreXmlDoc * + accessibility: SynAccess option * getterAccessibility: SynAccess option * setterAccessibility: SynAccess option * synExpr: SynExpr * diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 5ee96309126..982927d2ea0 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1701,6 +1701,7 @@ type SynMemberDefn = memberFlags: SynMemberFlags * memberFlagsForSet: SynMemberFlags * xmlDoc: PreXmlDoc * + accessibility: SynAccess option * getterAccessibility: SynAccess option * setterAccessibility: SynAccess option * synExpr: SynExpr * diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 892bb6c9ee2..7f7743c90f7 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -2192,7 +2192,7 @@ autoPropsDefnDecl: errorR (Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSet (), rhs parseState 2)) fun attribs flags rangeStart -> let xmlDoc = grabXmlDocAtRangeStart (parseState, attribs, rangeStart) - [ mkAutoPropDefn mVal $3 $4 $5 (Some mEquals) $7 $8 xmlDoc attribs flags rangeStart ] } + [ mkAutoPropDefn mVal $3 $4 $5 (Some mEquals) $7 $8 xmlDoc attribs flags rangeStart parseState.LexBuffer.LanguageVersion ] } | VAL opt_mutable opt_access ident opt_typ ends_coming_soon_or_recover { let mVal = rhs parseState 1 @@ -2205,7 +2205,7 @@ autoPropsDefnDecl: errorR (Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSet (), rhs parseState 2)) fun attribs flags rangeStart -> let xmlDoc = grabXmlDocAtRangeStart (parseState, attribs, rangeStart) - [ mkAutoPropDefn mVal $3 $4 $5 None expr (None, (SynMemberKind.Member, None)) xmlDoc attribs flags rangeStart ] } + [ mkAutoPropDefn mVal $3 $4 $5 None expr (None, (SynMemberKind.Member, None)) xmlDoc attribs flags rangeStart parseState.LexBuffer.LanguageVersion ] } | VAL opt_mutable opt_access ident opt_typ OBLOCKSEP { let mVal = rhs parseState 1 @@ -2218,7 +2218,7 @@ autoPropsDefnDecl: errorR (Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSet (), rhs parseState 2)) fun attribs flags rangeStart -> let xmlDoc = grabXmlDocAtRangeStart (parseState, attribs, rangeStart) - [ mkAutoPropDefn mVal $3 $4 $5 None expr (None, (SynMemberKind.Member, None)) xmlDoc attribs flags rangeStart ] } + [ mkAutoPropDefn mVal $3 $4 $5 None expr (None, (SynMemberKind.Member, None)) xmlDoc attribs flags rangeStart parseState.LexBuffer.LanguageVersion ] } | VAL opt_mutable opt_access recover { let mVal = rhs parseState 1 @@ -2228,7 +2228,7 @@ autoPropsDefnDecl: errorR (Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSet (), rhs parseState 2)) fun attribs flags rangeStart -> let xmlDoc = grabXmlDocAtRangeStart(parseState, attribs, rangeStart) - [ mkAutoPropDefn mVal $3 id None None expr (None, (SynMemberKind.Member, None)) xmlDoc attribs flags rangeStart ] } + [ mkAutoPropDefn mVal $3 id None None expr (None, (SynMemberKind.Member, None)) xmlDoc attribs flags rangeStart parseState.LexBuffer.LanguageVersion ] } /* An optional type on an auto-property definition */ opt_typ: diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index c7dbc64bac7..b6b3e4f56a7 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -227,6 +227,11 @@ další převody orientované na typ + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions aplikativní výpočetní výrazy diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index d5800420f00..f3a17764fec 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -227,6 +227,11 @@ zusätzliche typgesteuerte Konvertierungen + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions applikative Berechnungsausdrücke diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index dcfce175697..ed887c52184 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -227,6 +227,11 @@ conversiones adicionales dirigidas a tipos + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions expresiones de cálculo aplicativas diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 590c4fb8e15..eea44fc4e4f 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -227,6 +227,11 @@ conversions supplémentaires dirigées vers le type + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions expressions de calcul applicatives diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 70613984b76..fd639342ae6 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -227,6 +227,11 @@ conversioni aggiuntive dirette ai tipi + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions espressioni di calcolo applicativo diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 84a9ca6ef70..f4d2699cbaa 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -227,6 +227,11 @@ その他の型指定された変換 + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions 適用できる計算式 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 38ffac7d32d..00efc286d77 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -227,6 +227,11 @@ 추가 형식-디렉션 변환 + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions 적용 가능한 계산 식 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index ac1d54f63c4..8c3a793c8dc 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -227,6 +227,11 @@ dodatkowe konwersje ukierunkowane na typ + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions praktyczne wyrażenia obliczeniowe diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 6beb1946267..af6284b64a7 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -227,6 +227,11 @@ conversões direcionadas por tipos adicionais + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions expressões de computação aplicáveis diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 1b83dc7cc6b..4050c482270 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -227,6 +227,11 @@ дополнительные преобразования на основе типа + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions применимые вычислительные выражения diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 43f5069b2eb..31d5e4faf85 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -227,6 +227,11 @@ ek tür ile yönlendirilen dönüştürmeler + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions uygulama hesaplama ifadeleri diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 91cad01e99e..9127e6ef239 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -227,6 +227,11 @@ 附加类型定向转换 + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions 适用的计算表达式 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index f12b3fd0b5e..e77b7ba89d3 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -227,6 +227,11 @@ 其他類型導向轉換 + + Allow access modifiers to auto properties getters and setters + Allow access modifiers to auto properties getters and setters + + applicative computation expressions 適用的計算運算式 From f974953354f83c843ab48424d1d4ce247e8be300 Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 10 Feb 2024 21:23:28 +0800 Subject: [PATCH 05/43] add and update baseline --- src/Compiler/pars.fsy | 9 ++ ...vice.SurfaceArea.netstandard20.release.bsl | 128 ++++++++++-------- .../LeadingKeyword/DefaultValKeyword.fs.bsl | 3 +- .../LeadingKeyword/MemberValKeyword.fs.bsl | 3 +- .../LeadingKeyword/OverrideValKeyword.fs.bsl | 3 +- .../StaticMemberValKeyword.fs.bsl | 3 +- .../Member/Abstract - Property 02.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 01.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 02.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 03.fs.bsl | 5 +- .../SyntaxTree/Member/Auto property 04.fs.bsl | 6 +- .../SyntaxTree/Member/Auto property 05.fs.bsl | 6 +- .../SyntaxTree/Member/Auto property 06.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 07.fs.bsl | 6 +- .../SyntaxTree/Member/Auto property 08.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 09.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 10.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 11.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 12.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 13.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 14.fs | 4 + .../SyntaxTree/Member/Auto property 14.fs.bsl | 59 ++++++++ .../SyntaxTree/Member/Auto property 15.fs | 4 + .../SyntaxTree/Member/Auto property 15.fs.bsl | 26 ++++ .../Member/SignatureMemberWithSetget.fsi.bsl | 3 +- ...lotContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- ...ertyContainsTheRangeOfTheEqualsSign.fs.bsl | 5 +- ...rtyContainsTheRangeOfTheWithKeyword.fs.bsl | 7 +- ...erDefnAutoPropertyHasCorrectKeyword.fs.bsl | 12 +- ...ldContainsTheRangeOfTheWithKeyword.fsi.bsl | 3 +- 30 files changed, 233 insertions(+), 94 deletions(-) create mode 100644 tests/service/data/SyntaxTree/Member/Auto property 14.fs create mode 100644 tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Member/Auto property 15.fs create mode 100644 tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 7f7743c90f7..05abd13456d 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -1083,6 +1083,15 @@ classMemberSpfnGetSetElements: SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id.idRange, $1, id2.idRange, $4)) else SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id2.idRange, $4, id.idRange, $1)) } + + | nameop COMMA recover + { (let (SynIdent(id:Ident, _)) = $1 + if id.idText = "get" then + SynMemberKind.PropertyGet, Some(GetSetKeywords.Get id.idRange) + else if id.idText = "set" then + SynMemberKind.PropertySet, Some(GetSetKeywords.Set id.idRange) + else + raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsGetOrSetRequired())) } | opt_access nameop COMMA recover { (let (SynIdent(id:Ident, _)) = $2 diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index da61adbe19b..ea8da8a84f2 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -5739,6 +5739,39 @@ FSharp.Compiler.Syntax.DebugPointAtWith: System.String ToString() FSharp.Compiler.Syntax.ExprAtomicFlag: FSharp.Compiler.Syntax.ExprAtomicFlag Atomic FSharp.Compiler.Syntax.ExprAtomicFlag: FSharp.Compiler.Syntax.ExprAtomicFlag NonAtomic FSharp.Compiler.Syntax.ExprAtomicFlag: Int32 value__ +FSharp.Compiler.Syntax.GetSetKeywords+Get: FSharp.Compiler.Text.Range Item +FSharp.Compiler.Syntax.GetSetKeywords+Get: FSharp.Compiler.Text.Range get_Item() +FSharp.Compiler.Syntax.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get +FSharp.Compiler.Syntax.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get_get() +FSharp.Compiler.Syntax.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get_set() +FSharp.Compiler.Syntax.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range set +FSharp.Compiler.Syntax.GetSetKeywords+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_getterAccess() +FSharp.Compiler.Syntax.GetSetKeywords+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_setterAccess() +FSharp.Compiler.Syntax.GetSetKeywords+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] getterAccess +FSharp.Compiler.Syntax.GetSetKeywords+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] setterAccess +FSharp.Compiler.Syntax.GetSetKeywords+Set: FSharp.Compiler.Text.Range Item +FSharp.Compiler.Syntax.GetSetKeywords+Set: FSharp.Compiler.Text.Range get_Item() +FSharp.Compiler.Syntax.GetSetKeywords+Tags: Int32 Get +FSharp.Compiler.Syntax.GetSetKeywords+Tags: Int32 GetSet +FSharp.Compiler.Syntax.GetSetKeywords+Tags: Int32 Set +FSharp.Compiler.Syntax.GetSetKeywords: Boolean IsGet +FSharp.Compiler.Syntax.GetSetKeywords: Boolean IsGetSet +FSharp.Compiler.Syntax.GetSetKeywords: Boolean IsSet +FSharp.Compiler.Syntax.GetSetKeywords: Boolean get_IsGet() +FSharp.Compiler.Syntax.GetSetKeywords: Boolean get_IsGetSet() +FSharp.Compiler.Syntax.GetSetKeywords: Boolean get_IsSet() +FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords NewGet(FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords NewGetSet(FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess]) +FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords NewSet(FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords+Get +FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords+GetSet +FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords+Set +FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords+Tags +FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Text.Range Range +FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Text.Range get_Range() +FSharp.Compiler.Syntax.GetSetKeywords: Int32 Tag +FSharp.Compiler.Syntax.GetSetKeywords: Int32 get_Tag() +FSharp.Compiler.Syntax.GetSetKeywords: System.String ToString() FSharp.Compiler.Syntax.Ident: FSharp.Compiler.Text.Range get_idRange() FSharp.Compiler.Syntax.Ident: FSharp.Compiler.Text.Range idRange FSharp.Compiler.Syntax.Ident: System.String ToString() @@ -7680,12 +7713,12 @@ FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Syntax.SynMeasure+Var FSharp.Compiler.Syntax.SynMeasure: Int32 Tag FSharp.Compiler.Syntax.SynMeasure: Int32 get_Tag() FSharp.Compiler.Syntax.SynMeasure: System.String ToString() +FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia get_trivia() +FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia trivia FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynMemberFlags flags FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynMemberFlags get_flags() FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynValSig get_slotSig() FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynValSig slotSig -FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia get_trivia() -FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia trivia FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Boolean get_isStatic() @@ -7694,14 +7727,14 @@ FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.Ident FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.Ident ident FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynExpr get_synExpr() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynExpr synExpr +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia get_trivia() +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia trivia FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags get_memberFlags() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags get_memberFlagsForSet() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags memberFlags FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags memberFlagsForSet FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberKind get_propKind() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberKind propKind -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia get_trivia() -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia trivia FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Xml.PreXmlDoc get_xmlDoc() @@ -7710,6 +7743,10 @@ FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Collections. FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] get_attributes() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] accessibility FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_accessibility() +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_getterAccessibility() +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_setterAccessibility() +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] getterAccessibility +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] setterAccessibility FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType] get_typeOpt() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType] typeOpt FSharp.Compiler.Syntax.SynMemberDefn+GetSetMember: FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia get_trivia() @@ -7818,8 +7855,8 @@ FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsMember() FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsNestedType() FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsOpen() FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsValField() -FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAbstractSlot(FSharp.Compiler.Syntax.SynValSig, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia) -FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAutoProperty(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia) +FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAbstractSlot(FSharp.Compiler.Syntax.SynValSig, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia) +FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAutoProperty(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewGetSetMember(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitCtor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynPat, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitInherit(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range) @@ -7848,6 +7885,22 @@ FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynMemberDefn: Int32 Tag FSharp.Compiler.Syntax.SynMemberDefn: Int32 get_Tag() FSharp.Compiler.Syntax.SynMemberDefn: System.String ToString() +FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia Zero +FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia get_Zero() +FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] GetSetKeywords +FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] get_GetSetKeywords() +FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: System.String ToString() +FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords]) +FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword LeadingKeyword +FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword get_LeadingKeyword() +FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] GetSetKeywords +FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] get_GetSetKeywords() +FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] EqualsRange +FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] WithKeyword +FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_EqualsRange() +FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_WithKeyword() +FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: System.String ToString() +FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Void .ctor(FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords]) FSharp.Compiler.Syntax.SynMemberFlags: Boolean Equals(System.Object) FSharp.Compiler.Syntax.SynMemberFlags: Boolean GetterOrSetterIsCompilerGenerated FSharp.Compiler.Syntax.SynMemberFlags: Boolean IsDispatchSlot @@ -7913,10 +7966,10 @@ FSharp.Compiler.Syntax.SynMemberSig+Interface: FSharp.Compiler.Text.Range get_ra FSharp.Compiler.Syntax.SynMemberSig+Interface: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynMemberFlags flags FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynMemberFlags get_flags() +FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynMemberSigMemberTrivia get_trivia() +FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynMemberSigMemberTrivia trivia FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynValSig get_memberSig() FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynValSig memberSig -FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia get_trivia() -FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia trivia FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynMemberSig+NestedType: FSharp.Compiler.Syntax.SynTypeDefnSig get_nestedType() @@ -7944,7 +7997,7 @@ FSharp.Compiler.Syntax.SynMemberSig: Boolean get_IsNestedType() FSharp.Compiler.Syntax.SynMemberSig: Boolean get_IsValField() FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewInherit(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewInterface(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewMember(FSharp.Compiler.Syntax.SynValSig, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia) +FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewMember(FSharp.Compiler.Syntax.SynValSig, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynMemberSigMemberTrivia) FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewNestedType(FSharp.Compiler.Syntax.SynTypeDefnSig, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewValField(FSharp.Compiler.Syntax.SynField, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig+Inherit @@ -7958,6 +8011,12 @@ FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynMemberSig: Int32 Tag FSharp.Compiler.Syntax.SynMemberSig: Int32 get_Tag() FSharp.Compiler.Syntax.SynMemberSig: System.String ToString() +FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: FSharp.Compiler.Syntax.SynMemberSigMemberTrivia Zero +FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: FSharp.Compiler.Syntax.SynMemberSigMemberTrivia get_Zero() +FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] GetSetKeywords +FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] get_GetSetKeywords() +FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: System.String ToString() +FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords]) FSharp.Compiler.Syntax.SynModuleDecl+Attributes: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynModuleDecl+Attributes: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynModuleDecl+Attributes: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes @@ -9663,35 +9722,6 @@ FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia: FSharp.Compiler.SyntaxT FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia: Int32 Tag FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia: Int32 get_Tag() FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Get: FSharp.Compiler.Text.Range Item -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Get: FSharp.Compiler.Text.Range get_Item() -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get_get() -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get_set() -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range set -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Set: FSharp.Compiler.Text.Range Item -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Set: FSharp.Compiler.Text.Range get_Item() -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Tags: Int32 Get -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Tags: Int32 GetSet -FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Tags: Int32 Set -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean IsGet -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean IsGetSet -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean IsSet -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean get_IsGet() -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean get_IsGetSet() -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean get_IsSet() -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords NewGet(FSharp.Compiler.Text.Range) -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords NewGetSet(FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords NewSet(FSharp.Compiler.Text.Range) -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Get -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords+GetSet -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Set -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Tags -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.Text.Range Range -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.Text.Range get_Range() -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Int32 Tag -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Int32 get_Tag() -FSharp.Compiler.SyntaxTrivia.GetSetKeywords: System.String ToString() FSharp.Compiler.SyntaxTrivia.IdentTrivia+HasParenthesis: FSharp.Compiler.Text.Range get_leftParenRange() FSharp.Compiler.SyntaxTrivia.IdentTrivia+HasParenthesis: FSharp.Compiler.Text.Range get_rightParenRange() FSharp.Compiler.SyntaxTrivia.IdentTrivia+HasParenthesis: FSharp.Compiler.Text.Range leftParenRange @@ -10118,22 +10148,6 @@ FSharp.Compiler.SyntaxTrivia.SynMeasureConstantTrivia: FSharp.Compiler.Text.Rang FSharp.Compiler.SyntaxTrivia.SynMeasureConstantTrivia: FSharp.Compiler.Text.Range get_LessRange() FSharp.Compiler.SyntaxTrivia.SynMeasureConstantTrivia: System.String ToString() FSharp.Compiler.SyntaxTrivia.SynMeasureConstantTrivia: Void .ctor(FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia Zero -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia get_Zero() -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] GetSetKeywords -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] get_GetSetKeywords() -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords]) -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword LeadingKeyword -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword get_LeadingKeyword() -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] GetSetKeywords -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] get_GetSetKeywords() -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] EqualsRange -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] WithKeyword -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_EqualsRange() -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_WithKeyword() -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Void .ctor(FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords]) FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] AsKeyword FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_AsKeyword() FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia: System.String ToString() @@ -10150,12 +10164,6 @@ FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharp FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_SetKeyword() FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: System.String ToString() FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) -FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia Zero -FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia get_Zero() -FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] GetSetKeywords -FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] get_GetSetKeywords() -FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords]) FSharp.Compiler.SyntaxTrivia.SynModuleDeclNestedModuleTrivia: FSharp.Compiler.SyntaxTrivia.SynModuleDeclNestedModuleTrivia Zero FSharp.Compiler.SyntaxTrivia.SynModuleDeclNestedModuleTrivia: FSharp.Compiler.SyntaxTrivia.SynModuleDeclNestedModuleTrivia get_Zero() FSharp.Compiler.SyntaxTrivia.SynModuleDeclNestedModuleTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] EqualsRange diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl index 0451b561b92..aae0b57cb0c 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl @@ -28,7 +28,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (3,26--3,27)), (3,4--3,27), + None, None, None, Const (Int32 1, (3,26--3,27)), + (3,4--3,27), { LeadingKeyword = DefaultVal ((3,4--3,11), (3,12--3,15)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl index 7178d569385..a5a5c94bbf8 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl @@ -28,7 +28,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (3,25--3,26)), (3,4--3,26), + None, None, None, Const (Int32 1, (3,25--3,26)), + (3,4--3,26), { LeadingKeyword = MemberVal ((3,4--3,10), (3,11--3,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl index 4d3005f29e3..de95a8f3bbb 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl @@ -28,7 +28,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (3,27--3,28)), (3,4--3,28), + None, None, None, Const (Int32 1, (3,27--3,28)), + (3,4--3,28), { LeadingKeyword = OverrideVal ((3,4--3,12), (3,13--3,16)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl index 809096c0c78..2ac6f5d2c39 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl @@ -28,7 +28,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (3,32--3,33)), (3,4--3,33), + None, None, None, Const (Int32 1, (3,32--3,33)), + (3,4--3,33), { LeadingKeyword = StaticMemberVal ((3,4--3,10), (3,11--3,17), (3,18--3,21)) diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl index b136527eb6b..4177671e31b 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl @@ -32,7 +32,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertyGetSet }, (4,4--4,33), { GetSetKeywords = - Some (GetSet ((4,25--4,28), (4,30--4,33))) })], + Some + (GetSet ((4,25--4,28), None, (4,30--4,33), None)) })], (4,4--4,33)), [], None, (3,5--4,33), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,7--3,8) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl index 5155ca1b3e3..4576c205a95 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl @@ -27,7 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (4,20--4,21)), (4,4--4,21), + None, None, None, Const (Int32 1, (4,20--4,21)), + (4,4--4,21), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl index af2cbcfa598..b8736fd23e2 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl @@ -27,7 +27,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, + None, None, None, ArbitraryAfterError ("typedSequentialExprBlock1", (4,19--4,19)), (4,4--4,19), diff --git a/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl index 4dc2510f320..c489efc4380 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl @@ -27,7 +27,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, + None, None, None, ArbitraryAfterError ("typedSequentialExprBlock1", (4,19--4,19)), (4,4--4,19), @@ -51,7 +51,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 2, (5,20--5,21)), (5,4--5,21), + None, None, None, Const (Int32 2, (5,20--5,21)), + (5,4--5,21), { LeadingKeyword = MemberVal ((5,4--5,10), (5,11--5,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl index 9497c483352..f9c511bfc5e 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl @@ -27,7 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, ArbitraryAfterError ("autoProp2", (4,17--4,17)), + None, None, None, + ArbitraryAfterError ("autoProp2", (4,17--4,17)), (4,4--4,17), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) @@ -49,7 +50,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 2, (5,20--5,21)), (5,4--5,21), + None, None, None, Const (Int32 2, (5,20--5,21)), + (5,4--5,21), { LeadingKeyword = MemberVal ((5,4--5,10), (5,11--5,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl index 84a9f629f6e..541adf1f681 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl @@ -27,7 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, ArbitraryAfterError ("autoProp3", (4,14--4,14)), + None, None, None, + ArbitraryAfterError ("autoProp3", (4,14--4,14)), (4,4--4,14), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) @@ -49,7 +50,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 2, (5,20--5,21)), (5,4--5,21), + None, None, None, Const (Int32 2, (5,20--5,21)), + (5,4--5,21), { LeadingKeyword = MemberVal ((5,4--5,10), (5,11--5,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl index 50d5378bf80..0a7d12909ea 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl @@ -27,7 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (4,20--4,21)), (4,4--4,21), + None, None, None, Const (Int32 1, (4,20--4,21)), + (4,4--4,21), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl index 492124d31f0..12a7bfa4ef7 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl @@ -32,13 +32,15 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 7, (4,24--4,25)), (4,4--4,38), + None, None, None, Const (Int32 7, (4,24--4,25)), + (4,4--4,38), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,26--4,30) EqualsRange = Some (4,22--4,23) GetSetKeywords = - Some (GetSet ((4,31--4,34), (4,35--4,38))) })], + Some + (GetSet ((4,31--4,34), None, (4,35--4,38), None)) })], (4,4--4,38)), [], Some (ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl index 82805ec6df7..f4e62f0ba4b 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl @@ -27,7 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (4,19--4,20)), (4,4--4,29), + None, None, None, Const (Int32 1, (4,19--4,20)), + (4,4--4,29), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,21--4,25) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl index 00760cf2537..2ccd7d7a362 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl @@ -27,7 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (4,20--4,21)), (4,4--4,30), + None, None, None, Const (Int32 1, (4,20--4,21)), + (4,4--4,30), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,22--4,26) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl index 1a61306fb2d..1bb870f1f31 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl @@ -27,7 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (4,19--4,20)), (4,4--4,29), + None, None, None, Const (Int32 1, (4,19--4,20)), + (4,4--4,29), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,21--4,25) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl index 14121127b62..b0235cf362a 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl @@ -27,7 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (4,19--4,20)), (4,4--4,29), + None, None, None, Const (Int32 1, (4,19--4,20)), + (4,4--4,29), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,21--4,25) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl index d466718e4af..79d41c4f5a0 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl @@ -27,7 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (4,19--4,20)), (4,4--4,20), + None, None, None, Const (Int32 1, (4,19--4,20)), + (4,4--4,20), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,21--4,25) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl index d0c7a6c9dbc..a4515894463 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl @@ -27,7 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (4,19--4,20)), (4,4--4,20), + None, None, None, Const (Int32 1, (4,19--4,20)), + (4,4--4,20), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,21--4,25) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 14.fs b/tests/service/data/SyntaxTree/Member/Auto property 14.fs new file mode 100644 index 00000000000..c69c16bcfbf --- /dev/null +++ b/tests/service/data/SyntaxTree/Member/Auto property 14.fs @@ -0,0 +1,4 @@ +module A + +type X() = + member val Y: int = 7 with public get, private set diff --git a/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl new file mode 100644 index 00000000000..bf24b421311 --- /dev/null +++ b/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl @@ -0,0 +1,59 @@ +ImplFile + (ParsedImplFileInput + ("/root/Member/Auto property 14.fs", false, QualifiedNameOfFile A, [], [], + [SynModuleOrNamespace + ([A], false, NamedModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], [X], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (3,5--3,6)), + ObjectModel + (Unspecified, + [ImplicitCtor + (None, [], Const (Unit, (3,6--3,8)), None, + PreXmlDoc ((3,6), FSharp.Compiler.Xml.XmlDocCollector), + (3,5--3,6), { AsKeyword = None }); + AutoProperty + ([], false, Y, + Some (LongIdent (SynLongIdent ([int], [], [None]))), + PropertyGetSet, + { IsInstance = true + IsDispatchSlot = false + IsOverrideOrExplicitImpl = false + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + MemberKind = Member }, + { IsInstance = true + IsDispatchSlot = false + IsOverrideOrExplicitImpl = false + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + MemberKind = PropertySet }, + PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), + None, Some (Public (4,31--4,37)), + Some (Private (4,43--4,50)), + Const (Int32 7, (4,24--4,25)), (4,4--4,54), + { LeadingKeyword = + MemberVal ((4,4--4,10), (4,11--4,14)) + WithKeyword = Some (4,26--4,30) + EqualsRange = Some (4,22--4,23) + GetSetKeywords = + Some + (GetSet + ((4,38--4,41), Some (Public (4,31--4,37)), + (4,51--4,54), Some (Private (4,43--4,50)))) })], + (4,4--4,54)), [], + Some + (ImplicitCtor + (None, [], Const (Unit, (3,6--3,8)), None, + PreXmlDoc ((3,6), FSharp.Compiler.Xml.XmlDocCollector), + (3,5--3,6), { AsKeyword = None })), (3,5--4,54), + { LeadingKeyword = Type (3,0--3,4) + EqualsRange = Some (3,9--3,10) + WithKeyword = None })], (3,0--4,54))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--4,54), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 15.fs b/tests/service/data/SyntaxTree/Member/Auto property 15.fs new file mode 100644 index 00000000000..aedf83865d3 --- /dev/null +++ b/tests/service/data/SyntaxTree/Member/Auto property 15.fs @@ -0,0 +1,4 @@ +module A + +type X() = + member val internal Y: int = 7 with public get, private set diff --git a/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl new file mode 100644 index 00000000000..e48f3c1e3a8 --- /dev/null +++ b/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl @@ -0,0 +1,26 @@ +ImplFile + (ParsedImplFileInput + ("/root/Member/Auto property 15.fs", false, QualifiedNameOfFile A, [], [], + [SynModuleOrNamespace + ([A], false, NamedModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], [X], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (3,5--3,6)), + Simple (None (3,5--3,6), (3,5--3,6)), + [ImplicitCtor + (None, [], Const (Unit, (3,6--3,8)), None, + PreXmlDoc ((3,6), FSharp.Compiler.Xml.XmlDocCollector), + (3,5--3,6), { AsKeyword = None })], None, (3,5--3,6), + { LeadingKeyword = Type (3,0--3,4) + EqualsRange = None + WithKeyword = None })], (3,0--3,6))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) + +(4,40)-(4,46) parse error When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. +(5,0)-(5,0) parse error Incomplete structured construct at or before this point in implementation file diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl index db84482f638..2ea2ecd15d8 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl @@ -32,7 +32,8 @@ SigFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertyGetSet }, (6,4--8,39), { GetSetKeywords = - Some (GetSet ((8,36--8,39), (8,28--8,31))) })], + Some + (GetSet ((8,36--8,39), None, (8,28--8,31), None)) })], (6,4--8,39)), [], (4,5--8,39), { LeadingKeyword = Type (4,0--4,4) EqualsRange = Some (4,7--4,8) diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl index f3b24278efa..17bef2d8981 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl @@ -40,7 +40,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertyGetSet }, (3,4--3,42), { GetSetKeywords = - Some (GetSet ((3,35--3,38), (3,39--3,42))) })], + Some + (GetSet ((3,35--3,38), None, (3,39--3,42), None)) })], (3,4--3,42)), [], Some (ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl index 7cfa4c283eb..75e8d5de26e 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl @@ -51,13 +51,14 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Ident name, (4,4--5,40), + None, None, None, Ident name, (4,4--5,40), { LeadingKeyword = MemberVal ((5,4--5,10), (5,11--5,14)) WithKeyword = Some (5,27--5,31) EqualsRange = Some (5,20--5,21) GetSetKeywords = - Some (GetSet ((5,32--5,35), (5,37--5,40))) })], + Some + (GetSet ((5,32--5,35), None, (5,37--5,40), None)) })], (4,4--5,40)), [], Some (ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl index 0bef3c32697..82c7fc00c2d 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl @@ -34,13 +34,14 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Ident autoProp, (3,4--3,52), + None, None, None, Ident autoProp, (3,4--3,52), { LeadingKeyword = MemberVal ((3,4--3,10), (3,11--3,14)) WithKeyword = Some (3,39--3,43) EqualsRange = Some (3,28--3,29) GetSetKeywords = - Some (GetSet ((3,44--3,47), (3,49--3,52))) }); + Some + (GetSet ((3,44--3,47), None, (3,49--3,52), None)) }); AutoProperty ([], false, AutoProperty2, None, Member, { IsInstance = true @@ -56,7 +57,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Ident autoProp, (4,4--4,39), + None, None, None, Ident autoProp, (4,4--4,39), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl index f3b34e63689..67858fd3916 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl @@ -28,7 +28,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (3,32--3,33)), (3,4--3,33), + None, None, None, Const (Int32 1, (3,32--3,33)), + (3,4--3,33), { LeadingKeyword = StaticMemberVal ((3,4--3,10), (3,11--3,17), (3,18--3,21)) @@ -51,7 +52,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (4,25--4,26)), (4,4--4,26), + None, None, None, Const (Int32 1, (4,25--4,26)), + (4,4--4,26), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = None @@ -73,7 +75,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 2, (5,27--5,28)), (5,4--5,28), + None, None, None, Const (Int32 2, (5,27--5,28)), + (5,4--5,28), { LeadingKeyword = OverrideVal ((5,4--5,12), (5,13--5,16)) WithKeyword = None @@ -95,7 +98,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Const (Int32 1, (6,26--6,27)), (6,4--6,27), + None, None, None, Const (Int32 1, (6,26--6,27)), + (6,4--6,27), { LeadingKeyword = DefaultVal ((6,4--6,11), (6,12--6,15)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl index 32b9b945708..73ab09a709c 100644 --- a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl @@ -35,7 +35,8 @@ SigFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertyGetSet }, (5,4--5,42), { GetSetKeywords = - Some (GetSet ((5,35--5,38), (5,39--5,42))) })], + Some + (GetSet ((5,35--5,38), None, (5,39--5,42), None)) })], (5,4--5,42)), [], (4,5--5,42), { LeadingKeyword = Type (4,0--4,4) EqualsRange = Some (4,9--4,10) From 3588adab525f4fb423a704377c1ca5fe7cb2944c Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 11 Feb 2024 11:48:22 +0800 Subject: [PATCH 06/43] move checks leave parser --- src/Compiler/Checking/CheckDeclarations.fs | 44 +++++-- src/Compiler/FSComp.txt | 3 +- src/Compiler/SyntaxTree/ParseHelpers.fs | 22 +--- src/Compiler/SyntaxTree/ParseHelpers.fsi | 3 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 41 ------ src/Compiler/SyntaxTree/SyntaxTree.fsi | 46 ------- src/Compiler/SyntaxTree/SyntaxTrivia.fs | 41 ++++++ src/Compiler/SyntaxTree/SyntaxTrivia.fsi | 46 +++++++ src/Compiler/pars.fsy | 77 ++++------- src/Compiler/xlf/FSComp.txt.cs.xlf | 5 + src/Compiler/xlf/FSComp.txt.de.xlf | 5 + src/Compiler/xlf/FSComp.txt.es.xlf | 5 + src/Compiler/xlf/FSComp.txt.fr.xlf | 5 + src/Compiler/xlf/FSComp.txt.it.xlf | 5 + src/Compiler/xlf/FSComp.txt.ja.xlf | 5 + src/Compiler/xlf/FSComp.txt.ko.xlf | 5 + src/Compiler/xlf/FSComp.txt.pl.xlf | 5 + src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 + src/Compiler/xlf/FSComp.txt.ru.xlf | 5 + src/Compiler/xlf/FSComp.txt.tr.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 + ...vice.SurfaceArea.netstandard20.release.bsl | 124 +++++++++--------- .../Member/Abstract - Property 02.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 07.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 08.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 09.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 10.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 14.fs.bsl | 5 +- .../SyntaxTree/Member/Auto property 15.fs.bsl | 52 ++++++-- .../Member/SignatureMemberWithSetget.fsi.bsl | 3 +- ...lotContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- ...ertyContainsTheRangeOfTheEqualsSign.fs.bsl | 3 +- ...rtyContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- ...ldContainsTheRangeOfTheWithKeyword.fsi.bsl | 3 +- 35 files changed, 331 insertions(+), 265 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 727fc168a72..d5c46735f3d 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -4292,7 +4292,7 @@ module TcDeclarations = | _ -> () /// Split auto-properties into 'let' and 'member' bindings - let private SplitAutoProps members = + let private SplitAutoProps (g: TcGlobals) members = let membersIncludingAutoProps, vals_Inherits_Abstractslots = members |> List.partition (fun memb -> match memb with @@ -4342,7 +4342,7 @@ module TcDeclarations = let rec postAutoProps memb = match memb with | SynMemberDefn.AutoProperty(ident = id) when String.IsNullOrEmpty(id.idText) -> [] - | SynMemberDefn.AutoProperty(attributes=Attributes attribs; isStatic=isStatic; ident=id; typeOpt=tyOpt; propKind=propKind; memberFlags=memberFlags; memberFlagsForSet=memberFlagsForSet; xmlDoc=xmlDoc; trivia = { GetSetKeywords = mGetSetOpt }; getterAccessibility = getterAccesss; setterAccessibility = setterAccess) -> + | SynMemberDefn.AutoProperty(attributes=Attributes attribs; isStatic=isStatic; ident=id; typeOpt=tyOpt; propKind=propKind; memberFlags=memberFlags; memberFlagsForSet=memberFlagsForSet; xmlDoc=xmlDoc; trivia = { GetSetKeywords = mGetSetOpt }; accessibility = access; getterAccessibility = getterAccess; setterAccessibility = setterAccess) -> let mMemberPortion = id.idRange // Only the keep the non-field-targeted attributes let attribs = attribs |> List.filter (fun a -> match a.Target with Some t when t.idText = "field" -> false | _ -> true) @@ -4355,7 +4355,35 @@ module TcDeclarations = match propKind, mGetSetOpt with | SynMemberKind.PropertySet, Some getSetKeywords -> errorR(Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSetNotJustSet(), getSetKeywords.Range)) | _ -> () - + + let getterAccess, setterAccess = + match propKind with + | SynMemberKind.PropertyGetSet -> + match access with + | Some _ -> + match getterAccess, setterAccess with + | None, None -> access, access + | Some x, _ + | _, Some x -> error(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + | None -> + match getterAccess, setterAccess with + | Some x, _ + | _, Some x -> + checkLanguageFeatureError g.langVersion LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range + getterAccess, setterAccess + | _, _ -> None, None + | SynMemberKind.PropertySet -> + match access, setterAccess with + | Some _, Some x -> error(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + | _, None -> None, access + | None, _ -> None, setterAccess + | SynMemberKind.Member + | SynMemberKind.PropertyGet + | _ -> + match access, getterAccess with + | Some _, Some x -> error(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + | _, None -> access, None + | None, _ -> getterAccess, None [ match propKind with | SynMemberKind.Member @@ -4365,7 +4393,7 @@ module TcDeclarations = let rhsExpr = SynExpr.Ident fldId let retInfo = match tyOpt with None -> None | Some ty -> Some (None, SynReturnInfo((ty, SynInfo.unnamedRetVal), ty.Range)) let attribs = mkAttributeList attribs mMemberPortion - let binding = mkSynBinding (xmlDoc, headPat) (getterAccesss, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, retInfo, rhsExpr, rhsExpr.Range, [], attribs, Some memberFlags, SynBindingTrivia.Zero) + let binding = mkSynBinding (xmlDoc, headPat) (getterAccess, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, retInfo, rhsExpr, rhsExpr.Range, [], attribs, Some memberFlags, SynBindingTrivia.Zero) SynMemberDefn.Member (binding, mMemberPortion) yield getter | _ -> () @@ -4401,9 +4429,9 @@ module TcDeclarations = /// where simpleRepr can contain inherit type, declared fields and virtual slots. /// body = members /// where members contain methods/overrides, also implicit ctor, inheritCall and local definitions. - let rec private SplitTyconDefn (SynTypeDefn(typeInfo=synTyconInfo;typeRepr=trepr; members=extraMembers)) = + let rec private SplitTyconDefn g (SynTypeDefn(typeInfo=synTyconInfo;typeRepr=trepr; members=extraMembers)) = let extraMembers = desugarGetSetMembers extraMembers - let extraMembers, extra_vals_Inherits_Abstractslots = SplitAutoProps extraMembers + let extraMembers, extra_vals_Inherits_Abstractslots = SplitAutoProps g extraMembers let implements1 = extraMembers |> List.choose (function SynMemberDefn.Interface (interfaceType=ty) -> Some(ty, ty.Range) | _ -> None) match trepr with @@ -4424,7 +4452,7 @@ module TcDeclarations = let slotsigs = members |> List.choose (function SynMemberDefn.AbstractSlot (slotSig = x; flags = y) -> Some(x, y) | _ -> None) - let members,_vals_Inherits_Abstractslots = SplitAutoProps members + let members,_vals_Inherits_Abstractslots = SplitAutoProps g members let isConcrete = members |> List.exists (function @@ -4486,7 +4514,7 @@ module TcDeclarations = // Split the definitions into "core representations" and "members". The code to process core representations // is shared between processing of signature files and implementation files. - let mutRecDefnsAfterSplit = mutRecDefns |> MutRecShapes.mapTycons SplitTyconDefn + let mutRecDefnsAfterSplit = mutRecDefns |> MutRecShapes.mapTycons (fun i -> SplitTyconDefn g i) // Create the entities for each module and type definition, and process the core representation of each type definition. let tycons, envMutRecPrelim, mutRecDefnsAfterCore = diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index bd18f6b8ad3..eabe67b0386 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1743,4 +1743,5 @@ featureReuseSameFieldsInStructUnions,"Share underlying fields in a [] di 3863,parsExpectingField,"Expecting record field" 3864,tooManyMethodsInDotNetTypeWritingAssembly,"The type '%s' has too many methods. Found: '%d', maximum: '%d'" 3865,parsOnlySimplePatternsAreAllowedInConstructors,"Only simple patterns are allowed in primary constructors" -featureAllowAccessModifiersToAutoPropertiesGettersAndSetters,"Allow access modifiers to auto properties getters and setters" \ No newline at end of file +featureAllowAccessModifiersToAutoPropertiesGettersAndSetters,"Allow access modifiers to auto properties getters and setters" +3866,parsAccessModifiersBeforeGettersAndSettersNotAllowedInSigFile,"The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file." \ No newline at end of file diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index 17ee6f21834..e4c766b1b69 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -1100,8 +1100,8 @@ let mkSynUnionCase attributes (access: SynAccess option) id kind mDecl (xmlDoc, let mDecl = unionRangeWithXmlDoc xmlDoc mDecl SynUnionCase(attributes, id, kind, xmlDoc, None, mDecl, trivia) -let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDoc attribs flags rangeStart langVersion = - let mWith, (getSet, getSetOpt) = accessors +let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDoc attribs flags rangeStart = + let mWith, (getSet, getSetOpt, getterAccess, setterAccess) = accessors let memberRange = match getSetOpt with @@ -1117,24 +1117,6 @@ let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDo let memberFlagsForSet = flags SynMemberKind.PropertySet let isStatic = not memberFlags.IsInstance - let getterAccess, setterAccess = - match access, getSetOpt with - | Some _, Some(GetSetKeywords.GetSet(_, None, _, None)) -> access, access - | Some _, Some(GetSetKeywords.GetSet(_, Some x, _, _)) - | Some _, Some(GetSetKeywords.GetSet(_, _, _, Some x)) -> - raiseParseErrorAt x.Range (FSComp.SR.parsMultipleAccessibilitiesForGetSet ()) - | None, Some(GetSetKeywords.GetSet(_, getterAccess, _, setterAccess)) -> - match getterAccess, setterAccess with - | Some x, _ - | _, Some x -> - checkLanguageFeatureError langVersion LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range - | None, None -> () - - getterAccess, setterAccess - | _, Some(GetSetKeywords.Get _) -> access, None - | _, Some(GetSetKeywords.Set _) -> None, access - | _ -> None, None - let trivia = { LeadingKeyword = leadingKeyword diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fsi b/src/Compiler/SyntaxTree/ParseHelpers.fsi index 2cb3c520343..a90b010eef2 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fsi +++ b/src/Compiler/SyntaxTree/ParseHelpers.fsi @@ -272,12 +272,11 @@ val mkAutoPropDefn: typ: SynType option -> mEquals: range option -> expr: SynExpr -> - accessors: range option * (SynMemberKind * GetSetKeywords option) -> + accessors: range option * (SynMemberKind * GetSetKeywords option * SynAccess option * SynAccess option) -> xmlDoc: PreXmlDoc -> attribs: SynAttributes -> flags: (SynMemberKind -> SynMemberFlags) * SynLeadingKeyword -> rangeStart: range -> - langVersion: LanguageVersion -> SynMemberDefn val mkValField: diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 00d94c9648c..a4ba8c601f4 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -221,47 +221,6 @@ type SynAccess = | Internal m | Private m -> m -[] -type GetSetKeywords = - | Get of range - | Set of range - | GetSet of get: range * getterAccess: SynAccess option * set: range * setterAccess: SynAccess option - - member x.Range = - match x with - | Get m - | Set m -> m - | GetSet(mG, _, mS, _) -> - if Range.rangeBeforePos mG mS.Start then - Range.unionRanges mG mS - else - Range.unionRanges mS mG - -[] -type SynMemberDefnAutoPropertyTrivia = - { - LeadingKeyword: SynLeadingKeyword - WithKeyword: range option - EqualsRange: range option - GetSetKeywords: GetSetKeywords option - } - -[] -type SynMemberDefnAbstractSlotTrivia = - { - GetSetKeywords: GetSetKeywords option - } - - static member Zero = { GetSetKeywords = None } - -[] -type SynMemberSigMemberTrivia = - { - GetSetKeywords: GetSetKeywords option - } - - static member Zero: SynMemberSigMemberTrivia = { GetSetKeywords = None } - [] type DebugPointAtTarget = | Yes diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 982927d2ea0..2f1d1d5776c 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -242,52 +242,6 @@ type SynAccess = member Range: range -/// Represents additional information for `get, set` syntax -[] -type GetSetKeywords = - | Get of range - | Set of range - | GetSet of get: range * getterAccess: SynAccess option * set: range * setterAccess: SynAccess option - - member Range: range - -/// Represents additional information for SynMemberDefn.AutoProperty -[] -type SynMemberDefnAutoPropertyTrivia = - { - /// Used leading keyword of AutoProperty - LeadingKeyword: SynLeadingKeyword - - /// The syntax range of the `with` keyword - WithKeyword: range option - - /// The syntax range of the `=` token - EqualsRange: range option - - /// The syntax range of 'get, set' - GetSetKeywords: GetSetKeywords option - } - -/// Represents additional information for SynMemberDefn.AbstractSlot -[] -type SynMemberDefnAbstractSlotTrivia = - { - /// The syntax range of 'get, set' - GetSetKeywords: GetSetKeywords option - } - - static member Zero: SynMemberDefnAbstractSlotTrivia - -/// Represents additional information for SynMemberSig.Member -[] -type SynMemberSigMemberTrivia = - { - /// The syntax range of 'get, set' - GetSetKeywords: GetSetKeywords option - } - - static member Zero: SynMemberSigMemberTrivia - /// Represents whether a debug point should be present for the target /// of a decision tree, that is whether the construct corresponds to a debug /// point in the original source. diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fs b/src/Compiler/SyntaxTree/SyntaxTrivia.fs index 8b5d439a7ec..7330ac9b695 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fs +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fs @@ -346,6 +346,39 @@ type SynMemberDefnImplicitCtorTrivia = { AsKeyword: range option } [] type SynArgPatsNamePatPairsTrivia = { ParenRange: range } +[] +type GetSetKeywords = + | Get of range + | Set of range + | GetSet of get: range * set: range + + member x.Range = + match x with + | Get m + | Set m -> m + | GetSet(mG, mS) -> + if Range.rangeBeforePos mG mS.Start then + Range.unionRanges mG mS + else + Range.unionRanges mS mG + +[] +type SynMemberDefnAutoPropertyTrivia = + { + LeadingKeyword: SynLeadingKeyword + WithKeyword: range option + EqualsRange: range option + GetSetKeywords: GetSetKeywords option + } + +[] +type SynMemberDefnAbstractSlotTrivia = + { + GetSetKeywords: GetSetKeywords option + } + + static member Zero = { GetSetKeywords = None } + [] type SynFieldTrivia = { @@ -365,6 +398,14 @@ type SynTypeOrTrivia = { OrKeyword: range } [] type SynBindingReturnInfoTrivia = { ColonRange: range option } +[] +type SynMemberSigMemberTrivia = + { + GetSetKeywords: GetSetKeywords option + } + + static member Zero: SynMemberSigMemberTrivia = { GetSetKeywords = None } + [] type SynTyparDeclTrivia = { diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi index a3ffe0227a3..137f5432803 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi @@ -444,6 +444,42 @@ type SynArgPatsNamePatPairsTrivia = ParenRange: range } +/// Represents additional information for `get, set` syntax +[] +type GetSetKeywords = + | Get of range + | Set of range + | GetSet of get: range * set: range + + member Range: range + +/// Represents additional information for SynMemberDefn.AutoProperty +[] +type SynMemberDefnAutoPropertyTrivia = + { + /// Used leading keyword of AutoProperty + LeadingKeyword: SynLeadingKeyword + + /// The syntax range of the `with` keyword + WithKeyword: range option + + /// The syntax range of the `=` token + EqualsRange: range option + + /// The syntax range of 'get, set' + GetSetKeywords: GetSetKeywords option + } + +/// Represents additional information for SynMemberDefn.AbstractSlot +[] +type SynMemberDefnAbstractSlotTrivia = + { + /// The syntax range of 'get, set' + GetSetKeywords: GetSetKeywords option + } + + static member Zero: SynMemberDefnAbstractSlotTrivia + /// Represents additional information for SynField [] type SynFieldTrivia = @@ -472,6 +508,16 @@ type SynBindingReturnInfoTrivia = ColonRange: range option } +/// Represents additional information for SynMemberSig.Member +[] +type SynMemberSigMemberTrivia = + { + /// The syntax range of 'get, set' + GetSetKeywords: GetSetKeywords option + } + + static member Zero: SynMemberSigMemberTrivia + /// Represents additional information for SynTyparDecl [] type SynTyparDeclTrivia = diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 05abd13456d..9f6f3029509 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -949,7 +949,14 @@ classMemberSpfn: | opt_attributes opt_access memberSpecFlags opt_inline opt_access nameop opt_explicitValTyparDecls COLON topTypeWithTypeConstraints classMemberSpfnGetSet optLiteralValueSpfn { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) let isInline, doc, vis2, id, explicitValTyparDecls, (ty, arity), (mEquals, optLiteralValue) = (Option.isSome $4), grabXmlDoc(parseState, $1, 1), $5, $6, $7, $9, $11 - let mWith, (getSet, getSetRangeOpt) = $10 + let mWith, (getSet, getSetRangeOpt, getterAccess, setterAccess) = $10 + match getterAccess with + | Some(x: SynAccess) -> warning(Error(FSComp.SR.parsAccessModifiersBeforeGettersAndSettersNotAllowedInSigFile(), x.Range)) + | _ -> () + match setterAccess with + | Some(x: SynAccess) -> warning(Error(FSComp.SR.parsAccessModifiersBeforeGettersAndSettersNotAllowedInSigFile(), x.Range)) + | _ -> () + let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet let mWhole = let m = rhs parseState 3 @@ -1021,7 +1028,7 @@ classMemberSpfn: /* The optional "with get, set" on a member in a signature */ classMemberSpfnGetSet: | /* EMPTY */ - { None, (SynMemberKind.Member, None) } + { None, (SynMemberKind.Member, None, None, None) } | WITH classMemberSpfnGetSetElements { let mWith = rhs parseState 1 @@ -1039,39 +1046,15 @@ classMemberSpfnGetSet: /* The "get, set" on a property member in a signature */ classMemberSpfnGetSetElements: - | nameop - { (let (SynIdent(id:Ident, _)) = $1 + | opt_access nameop + { (let (SynIdent(id:Ident, _)) = $2 if id.idText = "get" then - SynMemberKind.PropertyGet, Some(GetSetKeywords.Get id.idRange) + SynMemberKind.PropertyGet, Some(GetSetKeywords.Get id.idRange), $1, None else if id.idText = "set" then - SynMemberKind.PropertySet, Some(GetSetKeywords.Set id.idRange) + SynMemberKind.PropertySet, Some(GetSetKeywords.Set id.idRange), None, $1 else raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsGetOrSetRequired())) } - | opt_access nameop COMMA nameop - { let (SynIdent(id, _)) = $2 - let (SynIdent(id2, _)) = $4 - if not ((id.idText = "get" && id2.idText = "set") || - (id.idText = "set" && id2.idText = "get")) then - raiseParseErrorAt (rhs2 parseState 1 3) (FSComp.SR.parsGetOrSetRequired()) - - if id.idText = "get" then - SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id.idRange, $1, id2.idRange, None)) - else - SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id2.idRange, None, id.idRange, $1)) } - - | nameop COMMA opt_access nameop - { let (SynIdent(id, _)) = $1 - let (SynIdent(id2, _)) = $4 - if not ((id.idText = "get" && id2.idText = "set") || - (id.idText = "set" && id2.idText = "get")) then - raiseParseErrorAt (rhs2 parseState 1 3) (FSComp.SR.parsGetOrSetRequired()) - - if id.idText = "get" then - SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id.idRange, None, id2.idRange, $3)) - else - SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id2.idRange, $3, id.idRange, None)) } - | opt_access nameop COMMA opt_access nameop { let (SynIdent(id, _)) = $2 let (SynIdent(id2, _)) = $5 @@ -1080,31 +1063,22 @@ classMemberSpfnGetSetElements: raiseParseErrorAt (rhs2 parseState 1 3) (FSComp.SR.parsGetOrSetRequired()) if id.idText = "get" then - SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id.idRange, $1, id2.idRange, $4)) + SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id.idRange, id2.idRange)), $1, $4 else - SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id2.idRange, $4, id.idRange, $1)) } - - | nameop COMMA recover - { (let (SynIdent(id:Ident, _)) = $1 - if id.idText = "get" then - SynMemberKind.PropertyGet, Some(GetSetKeywords.Get id.idRange) - else if id.idText = "set" then - SynMemberKind.PropertySet, Some(GetSetKeywords.Set id.idRange) - else - raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsGetOrSetRequired())) } + SynMemberKind.PropertyGetSet, Some(GetSetKeywords.GetSet(id2.idRange, id.idRange)), $4, $1 } | opt_access nameop COMMA recover { (let (SynIdent(id:Ident, _)) = $2 if id.idText = "get" then - SynMemberKind.PropertyGet, Some(GetSetKeywords.Get id.idRange) + SynMemberKind.PropertyGet, Some(GetSetKeywords.Get id.idRange), $1, None else if id.idText = "set" then - SynMemberKind.PropertySet, Some(GetSetKeywords.Set id.idRange) + SynMemberKind.PropertySet, Some(GetSetKeywords.Set id.idRange), None, $1 else - raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsGetOrSetRequired())) } + raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsGetOrSetRequired())) } | OBLOCKBEGIN oblockend ODECLEND { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsIdentifierExpected()) - SynMemberKind.Member, None } + SynMemberKind.Member, None, None, None } memberSpecFlags: | memberFlags { $1 } @@ -2067,7 +2041,7 @@ classDefnMember: | opt_attributes opt_access abstractMemberFlags opt_inline nameop opt_explicitValTyparDecls COLON topTypeWithTypeConstraints classMemberSpfnGetSet opt_ODECLEND { let ty, arity = $8 let isInline, doc, id, explicitValTyparDecls = (Option.isSome $4), grabXmlDoc(parseState, $1, 1), $5, $6 - let mWith, (getSet, getSetRangeOpt) = $9 + let mWith, (getSet, getSetRangeOpt, getterAccess, setterAccess) = $9 let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet let mWhole = let m = rhs parseState 1 @@ -2075,7 +2049,8 @@ classDefnMember: | None -> unionRanges m ty.Range | Some gs -> unionRanges m gs.Range |> unionRangeWithXmlDoc doc - if Option.isSome $2 then errorR(Error(FSComp.SR.parsAccessibilityModsIllegalForAbstract(), mWhole)) + if Option.isSome $2 || Option.isSome getterAccess || Option.isSome setterAccess + then errorR(Error(FSComp.SR.parsAccessibilityModsIllegalForAbstract(), mWhole)) let mkFlags, leadingKeyword = $3 let trivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $4; WithKeyword = mWith; EqualsRange = None } let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, None, None, mWhole, trivia) @@ -2201,7 +2176,7 @@ autoPropsDefnDecl: errorR (Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSet (), rhs parseState 2)) fun attribs flags rangeStart -> let xmlDoc = grabXmlDocAtRangeStart (parseState, attribs, rangeStart) - [ mkAutoPropDefn mVal $3 $4 $5 (Some mEquals) $7 $8 xmlDoc attribs flags rangeStart parseState.LexBuffer.LanguageVersion ] } + [ mkAutoPropDefn mVal $3 $4 $5 (Some mEquals) $7 $8 xmlDoc attribs flags rangeStart ] } | VAL opt_mutable opt_access ident opt_typ ends_coming_soon_or_recover { let mVal = rhs parseState 1 @@ -2214,7 +2189,7 @@ autoPropsDefnDecl: errorR (Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSet (), rhs parseState 2)) fun attribs flags rangeStart -> let xmlDoc = grabXmlDocAtRangeStart (parseState, attribs, rangeStart) - [ mkAutoPropDefn mVal $3 $4 $5 None expr (None, (SynMemberKind.Member, None)) xmlDoc attribs flags rangeStart parseState.LexBuffer.LanguageVersion ] } + [ mkAutoPropDefn mVal $3 $4 $5 None expr (None, (SynMemberKind.Member, None, None, None)) xmlDoc attribs flags rangeStart ] } | VAL opt_mutable opt_access ident opt_typ OBLOCKSEP { let mVal = rhs parseState 1 @@ -2227,7 +2202,7 @@ autoPropsDefnDecl: errorR (Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSet (), rhs parseState 2)) fun attribs flags rangeStart -> let xmlDoc = grabXmlDocAtRangeStart (parseState, attribs, rangeStart) - [ mkAutoPropDefn mVal $3 $4 $5 None expr (None, (SynMemberKind.Member, None)) xmlDoc attribs flags rangeStart parseState.LexBuffer.LanguageVersion ] } + [ mkAutoPropDefn mVal $3 $4 $5 None expr (None, (SynMemberKind.Member, None, None, None)) xmlDoc attribs flags rangeStart ] } | VAL opt_mutable opt_access recover { let mVal = rhs parseState 1 @@ -2237,7 +2212,7 @@ autoPropsDefnDecl: errorR (Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSet (), rhs parseState 2)) fun attribs flags rangeStart -> let xmlDoc = grabXmlDocAtRangeStart(parseState, attribs, rangeStart) - [ mkAutoPropDefn mVal $3 id None None expr (None, (SynMemberKind.Member, None)) xmlDoc attribs flags rangeStart parseState.LexBuffer.LanguageVersion ] } + [ mkAutoPropDefn mVal $3 id None None expr (None, (SynMemberKind.Member, None, None, None)) xmlDoc attribs flags rangeStart ] } /* An optional type on an auto-property definition */ opt_typ: diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index b6b3e4f56a7..b54f9aaa4ec 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -887,6 +887,11 @@ Funkce správy balíčků vyžaduje jazykovou verzi 5.0 nebo vyšší. + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. Syntaxi průniku omezení lze použít pouze s flexibilními typy, například „#IDisposable a #ISomeInterface“. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index f3a17764fec..0ca678a13c2 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -887,6 +887,11 @@ Für das „Paketverwaltungsfeature“ ist Sprachversion 5.0 oder höher erforderlich + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. Die Einschränkungsüberschneidungssyntax kann nur mit flexiblen Typen verwendet werden, z. B. "#IDisposable & #ISomeInterface". diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index ed887c52184..8df2c1c3cf0 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -887,6 +887,11 @@ La característica de "administración de paquetes" requiere la versión de lenguaje 5.0 o superior + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. La sintaxis de intersección de restricciones solo se puede usar con tipos flexibles, por ejemplo, "#IDisposable &#ISomeInterface". diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index eea44fc4e4f..7b14f362852 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -887,6 +887,11 @@ La fonction « gestion des paquets » nécessite une version de langue 5.0 ou supérieure. + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. La syntaxe d'intersection de contraintes ne peut être utilisée qu'avec des types flexibles, par ex. '#IDisposable et #ISomeInterface'. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index fd639342ae6..9c923fc1fe6 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -887,6 +887,11 @@ La funzionalità 'gestione pacchetti' richiede la versione del linguaggio 5.0 o superiore + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. La sintassi dell'intersezione dei vincoli può essere usata solo con tipi flessibili, ad esempio '#IDisposable & #ISomeInterface'. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index f4d2699cbaa..95aaa690cf0 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -887,6 +887,11 @@ 'package management' (パッケージ管理) 機能には、言語バージョン 5.0 以降が必要です + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. 制約交差構文は、"#IDisposable & #ISomeInterface" など、柔軟な型でのみ使用できます。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 00efc286d77..4ce3b12588b 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -887,6 +887,11 @@ '패키지 관리' 기능을 사용하려면 언어 버전 5.0 이상이 필요합니다. + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. 제약 조건 교차 구문은 유연한 형식(예: '#IDisposable &#ISomeInterface')에서만 사용할 수 있습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 8c3a793c8dc..f5ea2d522ee 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -887,6 +887,11 @@ Funkcja „Zarządzanie pakietami” wymaga języka w wersji 5.0 lub nowszej + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. Składnia przecięcia ograniczenia może być używana tylko z typami elastycznymi, np. „#IDisposable &#ISomeInterface”. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index af6284b64a7..44d8df91205 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -887,6 +887,11 @@ O recurso 'gerenciamento de pacotes' requer a versão 5.0 ou superior do idioma + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. A sintaxe de interseção de restrição só pode ser usada com tipos flexíveis, por exemplo, "#IDisposable & #ISomeInterface". diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 4050c482270..d9a51bb6e29 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -887,6 +887,11 @@ Для функции управления пакетами требуется версия языка 5.0 или более поздняя + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. Синтаксис пересечения ограничений можно использовать только с гибкими типами, например. "#IDisposable & #ISomeInterface". diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 31d5e4faf85..90db21b473c 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -887,6 +887,11 @@ ‘Paket yönetimi’ özelliği, dil sürümü 5.0 veya üstünü gerektirir + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. Kısıtlama kesişimi söz dizimi yalnızca esnek türlerle kullanılabilir. Ör. '#IDisposable & #ISomeInterface'. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 9127e6ef239..30fcdc6c46f 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -887,6 +887,11 @@ “包管理”功能需要语言版本 5.0 或更高版本 + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. 约束交集语法只能与灵活类型一起使用,例如 "#IDisposable & #ISomeInterface"。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index e77b7ba89d3..eb04592e7d9 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -887,6 +887,11 @@ 「套件管理」功能需要語言版本 5.0 或更新版本 + + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + + Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. 條件約束交集語法只能搭配彈性類型使用,例如「#IDisposable 與 #ISomeInterface'」。 diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index ea8da8a84f2..dfa92cb26c8 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -5739,39 +5739,6 @@ FSharp.Compiler.Syntax.DebugPointAtWith: System.String ToString() FSharp.Compiler.Syntax.ExprAtomicFlag: FSharp.Compiler.Syntax.ExprAtomicFlag Atomic FSharp.Compiler.Syntax.ExprAtomicFlag: FSharp.Compiler.Syntax.ExprAtomicFlag NonAtomic FSharp.Compiler.Syntax.ExprAtomicFlag: Int32 value__ -FSharp.Compiler.Syntax.GetSetKeywords+Get: FSharp.Compiler.Text.Range Item -FSharp.Compiler.Syntax.GetSetKeywords+Get: FSharp.Compiler.Text.Range get_Item() -FSharp.Compiler.Syntax.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get -FSharp.Compiler.Syntax.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get_get() -FSharp.Compiler.Syntax.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get_set() -FSharp.Compiler.Syntax.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range set -FSharp.Compiler.Syntax.GetSetKeywords+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_getterAccess() -FSharp.Compiler.Syntax.GetSetKeywords+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_setterAccess() -FSharp.Compiler.Syntax.GetSetKeywords+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] getterAccess -FSharp.Compiler.Syntax.GetSetKeywords+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] setterAccess -FSharp.Compiler.Syntax.GetSetKeywords+Set: FSharp.Compiler.Text.Range Item -FSharp.Compiler.Syntax.GetSetKeywords+Set: FSharp.Compiler.Text.Range get_Item() -FSharp.Compiler.Syntax.GetSetKeywords+Tags: Int32 Get -FSharp.Compiler.Syntax.GetSetKeywords+Tags: Int32 GetSet -FSharp.Compiler.Syntax.GetSetKeywords+Tags: Int32 Set -FSharp.Compiler.Syntax.GetSetKeywords: Boolean IsGet -FSharp.Compiler.Syntax.GetSetKeywords: Boolean IsGetSet -FSharp.Compiler.Syntax.GetSetKeywords: Boolean IsSet -FSharp.Compiler.Syntax.GetSetKeywords: Boolean get_IsGet() -FSharp.Compiler.Syntax.GetSetKeywords: Boolean get_IsGetSet() -FSharp.Compiler.Syntax.GetSetKeywords: Boolean get_IsSet() -FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords NewGet(FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords NewGetSet(FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess]) -FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords NewSet(FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords+Get -FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords+GetSet -FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords+Set -FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Syntax.GetSetKeywords+Tags -FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Text.Range Range -FSharp.Compiler.Syntax.GetSetKeywords: FSharp.Compiler.Text.Range get_Range() -FSharp.Compiler.Syntax.GetSetKeywords: Int32 Tag -FSharp.Compiler.Syntax.GetSetKeywords: Int32 get_Tag() -FSharp.Compiler.Syntax.GetSetKeywords: System.String ToString() FSharp.Compiler.Syntax.Ident: FSharp.Compiler.Text.Range get_idRange() FSharp.Compiler.Syntax.Ident: FSharp.Compiler.Text.Range idRange FSharp.Compiler.Syntax.Ident: System.String ToString() @@ -7713,12 +7680,12 @@ FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Syntax.SynMeasure+Var FSharp.Compiler.Syntax.SynMeasure: Int32 Tag FSharp.Compiler.Syntax.SynMeasure: Int32 get_Tag() FSharp.Compiler.Syntax.SynMeasure: System.String ToString() -FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia get_trivia() -FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia trivia FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynMemberFlags flags FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynMemberFlags get_flags() FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynValSig get_slotSig() FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Syntax.SynValSig slotSig +FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia get_trivia() +FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia trivia FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynMemberDefn+AbstractSlot: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Boolean get_isStatic() @@ -7727,14 +7694,14 @@ FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.Ident FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.Ident ident FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynExpr get_synExpr() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynExpr synExpr -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia get_trivia() -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia trivia FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags get_memberFlags() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags get_memberFlagsForSet() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags memberFlags FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags memberFlagsForSet FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberKind get_propKind() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberKind propKind +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia get_trivia() +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia trivia FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Xml.PreXmlDoc get_xmlDoc() @@ -7855,8 +7822,8 @@ FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsMember() FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsNestedType() FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsOpen() FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsValField() -FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAbstractSlot(FSharp.Compiler.Syntax.SynValSig, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia) -FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAutoProperty(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia) +FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAbstractSlot(FSharp.Compiler.Syntax.SynValSig, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia) +FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAutoProperty(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewGetSetMember(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitCtor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynPat, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitInherit(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range) @@ -7885,22 +7852,6 @@ FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynMemberDefn: Int32 Tag FSharp.Compiler.Syntax.SynMemberDefn: Int32 get_Tag() FSharp.Compiler.Syntax.SynMemberDefn: System.String ToString() -FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia Zero -FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia get_Zero() -FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] GetSetKeywords -FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] get_GetSetKeywords() -FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: System.String ToString() -FSharp.Compiler.Syntax.SynMemberDefnAbstractSlotTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords]) -FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword LeadingKeyword -FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword get_LeadingKeyword() -FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] GetSetKeywords -FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] get_GetSetKeywords() -FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] EqualsRange -FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] WithKeyword -FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_EqualsRange() -FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_WithKeyword() -FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: System.String ToString() -FSharp.Compiler.Syntax.SynMemberDefnAutoPropertyTrivia: Void .ctor(FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords]) FSharp.Compiler.Syntax.SynMemberFlags: Boolean Equals(System.Object) FSharp.Compiler.Syntax.SynMemberFlags: Boolean GetterOrSetterIsCompilerGenerated FSharp.Compiler.Syntax.SynMemberFlags: Boolean IsDispatchSlot @@ -7966,10 +7917,10 @@ FSharp.Compiler.Syntax.SynMemberSig+Interface: FSharp.Compiler.Text.Range get_ra FSharp.Compiler.Syntax.SynMemberSig+Interface: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynMemberFlags flags FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynMemberFlags get_flags() -FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynMemberSigMemberTrivia get_trivia() -FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynMemberSigMemberTrivia trivia FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynValSig get_memberSig() FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Syntax.SynValSig memberSig +FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia get_trivia() +FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia trivia FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynMemberSig+Member: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynMemberSig+NestedType: FSharp.Compiler.Syntax.SynTypeDefnSig get_nestedType() @@ -7997,7 +7948,7 @@ FSharp.Compiler.Syntax.SynMemberSig: Boolean get_IsNestedType() FSharp.Compiler.Syntax.SynMemberSig: Boolean get_IsValField() FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewInherit(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewInterface(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewMember(FSharp.Compiler.Syntax.SynValSig, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynMemberSigMemberTrivia) +FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewMember(FSharp.Compiler.Syntax.SynValSig, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia) FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewNestedType(FSharp.Compiler.Syntax.SynTypeDefnSig, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig NewValField(FSharp.Compiler.Syntax.SynField, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Syntax.SynMemberSig+Inherit @@ -8011,12 +7962,6 @@ FSharp.Compiler.Syntax.SynMemberSig: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynMemberSig: Int32 Tag FSharp.Compiler.Syntax.SynMemberSig: Int32 get_Tag() FSharp.Compiler.Syntax.SynMemberSig: System.String ToString() -FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: FSharp.Compiler.Syntax.SynMemberSigMemberTrivia Zero -FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: FSharp.Compiler.Syntax.SynMemberSigMemberTrivia get_Zero() -FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] GetSetKeywords -FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords] get_GetSetKeywords() -FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: System.String ToString() -FSharp.Compiler.Syntax.SynMemberSigMemberTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.GetSetKeywords]) FSharp.Compiler.Syntax.SynModuleDecl+Attributes: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynModuleDecl+Attributes: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynModuleDecl+Attributes: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes @@ -9722,6 +9667,35 @@ FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia: FSharp.Compiler.SyntaxT FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia: Int32 Tag FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia: Int32 get_Tag() FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia: System.String ToString() +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Get: FSharp.Compiler.Text.Range Item +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Get: FSharp.Compiler.Text.Range get_Item() +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get_get() +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range get_set() +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+GetSet: FSharp.Compiler.Text.Range set +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Set: FSharp.Compiler.Text.Range Item +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Set: FSharp.Compiler.Text.Range get_Item() +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Tags: Int32 Get +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Tags: Int32 GetSet +FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Tags: Int32 Set +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean IsGet +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean IsGetSet +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean IsSet +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean get_IsGet() +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean get_IsGetSet() +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Boolean get_IsSet() +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords NewGet(FSharp.Compiler.Text.Range) +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords NewGetSet(FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords NewSet(FSharp.Compiler.Text.Range) +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Get +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords+GetSet +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Set +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.SyntaxTrivia.GetSetKeywords+Tags +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.Text.Range Range +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: FSharp.Compiler.Text.Range get_Range() +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Int32 Tag +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: Int32 get_Tag() +FSharp.Compiler.SyntaxTrivia.GetSetKeywords: System.String ToString() FSharp.Compiler.SyntaxTrivia.IdentTrivia+HasParenthesis: FSharp.Compiler.Text.Range get_leftParenRange() FSharp.Compiler.SyntaxTrivia.IdentTrivia+HasParenthesis: FSharp.Compiler.Text.Range get_rightParenRange() FSharp.Compiler.SyntaxTrivia.IdentTrivia+HasParenthesis: FSharp.Compiler.Text.Range leftParenRange @@ -10148,6 +10122,22 @@ FSharp.Compiler.SyntaxTrivia.SynMeasureConstantTrivia: FSharp.Compiler.Text.Rang FSharp.Compiler.SyntaxTrivia.SynMeasureConstantTrivia: FSharp.Compiler.Text.Range get_LessRange() FSharp.Compiler.SyntaxTrivia.SynMeasureConstantTrivia: System.String ToString() FSharp.Compiler.SyntaxTrivia.SynMeasureConstantTrivia: Void .ctor(FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia Zero +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia get_Zero() +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] GetSetKeywords +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] get_GetSetKeywords() +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: System.String ToString() +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords]) +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword LeadingKeyword +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword get_LeadingKeyword() +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] GetSetKeywords +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] get_GetSetKeywords() +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] EqualsRange +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] WithKeyword +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_EqualsRange() +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_WithKeyword() +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: System.String ToString() +FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia: Void .ctor(FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords]) FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] AsKeyword FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_AsKeyword() FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia: System.String ToString() @@ -10164,6 +10154,12 @@ FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharp FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_SetKeyword() FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: System.String ToString() FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) +FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia Zero +FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia get_Zero() +FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] GetSetKeywords +FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords] get_GetSetKeywords() +FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: System.String ToString() +FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.GetSetKeywords]) FSharp.Compiler.SyntaxTrivia.SynModuleDeclNestedModuleTrivia: FSharp.Compiler.SyntaxTrivia.SynModuleDeclNestedModuleTrivia Zero FSharp.Compiler.SyntaxTrivia.SynModuleDeclNestedModuleTrivia: FSharp.Compiler.SyntaxTrivia.SynModuleDeclNestedModuleTrivia get_Zero() FSharp.Compiler.SyntaxTrivia.SynModuleDeclNestedModuleTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] EqualsRange diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl index 4177671e31b..b136527eb6b 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl @@ -32,8 +32,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertyGetSet }, (4,4--4,33), { GetSetKeywords = - Some - (GetSet ((4,25--4,28), None, (4,30--4,33), None)) })], + Some (GetSet ((4,25--4,28), (4,30--4,33))) })], (4,4--4,33)), [], None, (3,5--4,33), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,7--3,8) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl index 12a7bfa4ef7..84e7a69d193 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl @@ -39,8 +39,7 @@ ImplFile WithKeyword = Some (4,26--4,30) EqualsRange = Some (4,22--4,23) GetSetKeywords = - Some - (GetSet ((4,31--4,34), None, (4,35--4,38), None)) })], + Some (GetSet ((4,31--4,34), (4,35--4,38))) })], (4,4--4,38)), [], Some (ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl index f4e62f0ba4b..982030b64d2 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl @@ -46,4 +46,4 @@ ImplFile (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:22). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7. -(6,0)-(6,1) parse error Incomplete structured construct at or before this point in member definition. Expected identifier, '(', '(*)' or other token. +(6,0)-(6,1) parse error Incomplete structured construct at or before this point. Expected identifier, '(', '(*)' or other token. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl index 2ccd7d7a362..f4d9b9aa777 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl @@ -69,4 +69,4 @@ ImplFile (5,4)-(5,10) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:23). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7. -(5,4)-(5,10) parse error Incomplete structured construct at or before this point in member definition. Expected identifier, '(', '(*)' or other token. +(5,4)-(5,10) parse error Incomplete structured construct at or before this point. Expected identifier, '(', '(*)' or other token. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl index 1bb870f1f31..aeaf553b54c 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl @@ -45,4 +45,4 @@ ImplFile (5,0)-(5,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:22). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7. -(5,0)-(5,0) parse error Incomplete structured construct at or before this point in member definition. Expected identifier, '(', '(*)' or other token. +(5,0)-(5,0) parse error Incomplete structured construct at or before this point. Expected identifier, '(', '(*)' or other token. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl index bf24b421311..2235a327002 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl @@ -40,10 +40,7 @@ ImplFile WithKeyword = Some (4,26--4,30) EqualsRange = Some (4,22--4,23) GetSetKeywords = - Some - (GetSet - ((4,38--4,41), Some (Public (4,31--4,37)), - (4,51--4,54), Some (Private (4,43--4,50)))) })], + Some (GetSet ((4,38--4,41), (4,51--4,54))) })], (4,4--4,54)), [], Some (ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl index e48f3c1e3a8..457b112dc31 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl @@ -9,18 +9,48 @@ ImplFile ([], None, [], [X], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), - Simple (None (3,5--3,6), (3,5--3,6)), - [ImplicitCtor - (None, [], Const (Unit, (3,6--3,8)), None, - PreXmlDoc ((3,6), FSharp.Compiler.Xml.XmlDocCollector), - (3,5--3,6), { AsKeyword = None })], None, (3,5--3,6), + ObjectModel + (Unspecified, + [ImplicitCtor + (None, [], Const (Unit, (3,6--3,8)), None, + PreXmlDoc ((3,6), FSharp.Compiler.Xml.XmlDocCollector), + (3,5--3,6), { AsKeyword = None }); + AutoProperty + ([], false, Y, + Some (LongIdent (SynLongIdent ([int], [], [None]))), + PropertyGetSet, + { IsInstance = true + IsDispatchSlot = false + IsOverrideOrExplicitImpl = false + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + MemberKind = Member }, + { IsInstance = true + IsDispatchSlot = false + IsOverrideOrExplicitImpl = false + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + MemberKind = PropertySet }, + PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), + Some (Internal (4,15--4,23)), + Some (Public (4,40--4,46)), Some (Private (4,52--4,59)), + Const (Int32 7, (4,33--4,34)), (4,4--4,63), + { LeadingKeyword = + MemberVal ((4,4--4,10), (4,11--4,14)) + WithKeyword = Some (4,35--4,39) + EqualsRange = Some (4,31--4,32) + GetSetKeywords = + Some (GetSet ((4,47--4,50), (4,60--4,63))) })], + (4,4--4,63)), [], + Some + (ImplicitCtor + (None, [], Const (Unit, (3,6--3,8)), None, + PreXmlDoc ((3,6), FSharp.Compiler.Xml.XmlDocCollector), + (3,5--3,6), { AsKeyword = None })), (3,5--4,63), { LeadingKeyword = Type (3,0--3,4) - EqualsRange = None - WithKeyword = None })], (3,0--3,6))], + EqualsRange = Some (3,9--3,10) + WithKeyword = None })], (3,0--4,63))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, - (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + (1,0--4,63), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] CodeComments = [] }, set [])) - -(4,40)-(4,46) parse error When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. -(5,0)-(5,0) parse error Incomplete structured construct at or before this point in implementation file diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl index 2ea2ecd15d8..db84482f638 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl @@ -32,8 +32,7 @@ SigFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertyGetSet }, (6,4--8,39), { GetSetKeywords = - Some - (GetSet ((8,36--8,39), None, (8,28--8,31), None)) })], + Some (GetSet ((8,36--8,39), (8,28--8,31))) })], (6,4--8,39)), [], (4,5--8,39), { LeadingKeyword = Type (4,0--4,4) EqualsRange = Some (4,7--4,8) diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl index 17bef2d8981..f3b24278efa 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl @@ -40,8 +40,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertyGetSet }, (3,4--3,42), { GetSetKeywords = - Some - (GetSet ((3,35--3,38), None, (3,39--3,42), None)) })], + Some (GetSet ((3,35--3,38), (3,39--3,42))) })], (3,4--3,42)), [], Some (ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl index 75e8d5de26e..9ebebcbddf1 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl @@ -57,8 +57,7 @@ ImplFile WithKeyword = Some (5,27--5,31) EqualsRange = Some (5,20--5,21) GetSetKeywords = - Some - (GetSet ((5,32--5,35), None, (5,37--5,40), None)) })], + Some (GetSet ((5,32--5,35), (5,37--5,40))) })], (4,4--5,40)), [], Some (ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl index 82c7fc00c2d..c5a3db03d4d 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl @@ -40,8 +40,7 @@ ImplFile WithKeyword = Some (3,39--3,43) EqualsRange = Some (3,28--3,29) GetSetKeywords = - Some - (GetSet ((3,44--3,47), None, (3,49--3,52), None)) }); + Some (GetSet ((3,44--3,47), (3,49--3,52))) }); AutoProperty ([], false, AutoProperty2, None, Member, { IsInstance = true diff --git a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl index 73ab09a709c..32b9b945708 100644 --- a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl @@ -35,8 +35,7 @@ SigFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertyGetSet }, (5,4--5,42), { GetSetKeywords = - Some - (GetSet ((5,35--5,38), None, (5,39--5,42), None)) })], + Some (GetSet ((5,35--5,38), (5,39--5,42))) })], (5,4--5,42)), [], (4,5--5,42), { LeadingKeyword = Type (4,0--4,4) EqualsRange = Some (4,9--4,10) From 09311ef3f3409c99f427b70fb7847a53b58824fb Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 11 Feb 2024 12:02:27 +0800 Subject: [PATCH 07/43] update ServiceNavigation; fantomas --- src/Compiler/Service/ServiceNavigation.fs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index c64b93042f8..bb118ae2c76 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -332,10 +332,19 @@ module NavigationImpl = [ createMember (rcid, NavigationItemKind.Field, FSharpGlyph.Field, range, enclosingEntityKind, false, access) ] - | SynMemberDefn.AutoProperty(ident = id; getterAccessibility = getterAccessibility; setterAccessibility = setterAccessibility) -> + | SynMemberDefn.AutoProperty( + ident = id; accessibility = access; getterAccessibility = getterAccessibility; setterAccessibility = setterAccessibility; propKind = propKind) -> + let getterAccessibility = getterAccessibility |> Option.orElse access + let setterAccessibility = setterAccessibility |> Option.orElse access + [ - createMember (id, NavigationItemKind.Field, FSharpGlyph.Field, id.idRange, enclosingEntityKind, false, getterAccessibility) - createMember (id, NavigationItemKind.Field, FSharpGlyph.Field, id.idRange, enclosingEntityKind, false, setterAccessibility) + match propKind with + | SynMemberKind.PropertyGetSet -> + yield createMember (id, NavigationItemKind.Field, FSharpGlyph.Field, id.idRange, enclosingEntityKind, false, getterAccessibility) + yield createMember (id, NavigationItemKind.Field, FSharpGlyph.Field, id.idRange, enclosingEntityKind, false, setterAccessibility) + | SynMemberKind.PropertySet -> + yield createMember (id, NavigationItemKind.Field, FSharpGlyph.Field, id.idRange, enclosingEntityKind, false, setterAccessibility) + | _ -> yield createMember (id, NavigationItemKind.Field, FSharpGlyph.Field, id.idRange, enclosingEntityKind, false, getterAccessibility) ] | SynMemberDefn.AbstractSlot(slotSig = SynValSig(ident = SynIdent(id, _); synType = ty; accessibility = access)) -> [ From dc04a91f3f2b8178cd51ef2921eb51726cf11e9d Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 11 Feb 2024 15:16:45 +0800 Subject: [PATCH 08/43] add tests --- src/Compiler/Checking/CheckDeclarations.fs | 14 +- .../AutoPropsWithModifierBeforeGetSet.fs | 172 ++++++++++++++++++ .../FSharp.Compiler.ComponentTests.fsproj | 1 + 3 files changed, 183 insertions(+), 4 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index d5c46735f3d..cd919a0cde3 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -4364,24 +4364,30 @@ module TcDeclarations = match getterAccess, setterAccess with | None, None -> access, access | Some x, _ - | _, Some x -> error(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + | _, Some x -> + errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + None, None | None -> match getterAccess, setterAccess with | Some x, _ | _, Some x -> - checkLanguageFeatureError g.langVersion LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range + checkLanguageFeatureAndRecover g.langVersion LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range getterAccess, setterAccess | _, _ -> None, None | SynMemberKind.PropertySet -> match access, setterAccess with - | Some _, Some x -> error(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + | Some _, Some x -> + errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + None, None | _, None -> None, access | None, _ -> None, setterAccess | SynMemberKind.Member | SynMemberKind.PropertyGet | _ -> match access, getterAccess with - | Some _, Some x -> error(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + | Some _, Some x -> + errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + None, None | _, None -> access, None | None, _ -> getterAccess, None [ diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs new file mode 100644 index 00000000000..6bce30c9c05 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +module Conformance.BasicGrammarElements.AutoPropsWithModifierBeforeGetSet + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +let verifyCompile compilation = + compilation + |> asExe + |> withOptions ["--nowarn:988"] + |> compile + +let verifyCompileAndRun compilation = + compilation + |> asExe + |> withOptions ["--nowarn:988"] + |> compileAndRun + +[] +let ``Instance Properties Test`` = + Fs """type InstancePropertiesTest() = + member val B1: int = 0 with get + // should failed + member val B2: int = 0 with set + member val B3: int = 0 with get, set + member val B4: int = 0 with internal get + // should failed + member val B5: int = 0 with internal set + member val B6: int = 0 with internal get, internal set + member val B7: int = 0 with internal get, set + member val B8: int = 0 with get, internal set + // should failed + member val internal B11: int = 0 with internal get, set + // should failed + member val internal B12: int = 0 with internal get + // should failed + member val internal B13: int = 0 with internal set + member val internal B14: int = 0 with get, set + member val internal B15: int = 0 with get + // should failed + member val internal B16: int = 0 with set""" + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 3135, Line 4, Col 33, Line 4, Col 36, "To indicate that this property can be set, use 'member val PropertyName = expr with get,set'.") + (Error 3135, Line 8, Col 42, Line 8, Col 45, "To indicate that this property can be set, use 'member val PropertyName = expr with get,set'.") + (Error 0558, Line 13, Col 43, Line 13, Col 51, "When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.") + (Error 0558, Line 15, Col 43, Line 15, Col 51, "When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.") + (Error 3135, Line 17, Col 52, Line 17, Col 55, "To indicate that this property can be set, use 'member val PropertyName = expr with get,set'.") + (Error 0558, Line 17, Col 43, Line 17, Col 51, "When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.") + (Error 3135, Line 21, Col 43, Line 21, Col 46, "To indicate that this property can be set, use 'member val PropertyName = expr with get,set'.") + ] + +[] +let ``Static Properties Test`` = + Fs """type StaticPropertiesTest() = + static member val B1: int = 0 with get + // should failed + static member val B2: int = 0 with set + static member val B3: int = 0 with get, set + static member val B4: int = 0 with internal get + // should failed + static member val B5: int = 0 with internal set + static member val B6: int = 0 with internal get, internal set + static member val B7: int = 0 with internal get, set + static member val B8: int = 0 with get, internal set + // should failed + static member val internal B11: int = 0 with internal get, set + // should failed + static member val internal B12: int = 0 with internal get + // should failed + static member val internal B13: int = 0 with internal set + static member val internal B14: int = 0 with get, set + static member val internal B15: int = 0 with get + // should failed + static member val internal B16: int = 0 with set""" + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 3135, Line 4, Col 40, Line 4, Col 43, "To indicate that this property can be set, use 'member val PropertyName = expr with get,set'.") + (Error 3135, Line 8, Col 49, Line 8, Col 52, "To indicate that this property can be set, use 'member val PropertyName = expr with get,set'.") + (Error 0558, Line 13, Col 50, Line 13, Col 58, "When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.") + (Error 0558, Line 15, Col 50, Line 15, Col 58, "When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.") + (Error 3135, Line 17, Col 59, Line 17, Col 62, "To indicate that this property can be set, use 'member val PropertyName = expr with get,set'.") + (Error 0558, Line 17, Col 50, Line 17, Col 58, "When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.") + (Error 3135, Line 21, Col 50, Line 21, Col 53, "To indicate that this property can be set, use 'member val PropertyName = expr with get,set'.") + ] + +[] +let ``Abstract Properties Test: access modifiers are not allowed`` = + Fs """type ``Abstract Properties Test`` = + abstract member B1: int with get, set + abstract member B2: int with get + abstract member B3: int with set + // should failed + abstract member B4: int with internal get, set + // should failed + abstract member B5: int with get, internal set + // should failed + abstract member B6: int with internal get, internal set + // should failed + abstract member B7: int with internal get + // should failed + abstract member B8: int with internal set""" + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 0561, Line 6, Col 5, Line 6, Col 51, "Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type.") + (Error 0561, Line 8, Col 5, Line 8, Col 51, "Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type.") + (Error 0561, Line 10, Col 5, Line 10, Col 60, "Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type.") + (Error 0561, Line 12, Col 5, Line 12, Col 46, "Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type.") + (Error 0561, Line 14, Col 5, Line 14, Col 46, "Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type.") + ] + +[] +let ``Signature File Test: no access modifiers before getter and setter`` = + Fsi """module Program + + type A = + new: unit -> A + member internal B: int + member internal C: int with get, set + // will warning + member D: int with internal get, private set + abstract E: int with get, set + // will warning + abstract F: int with get, private set""" + |> verifyCompile + |> shouldFail + |> withDiagnostics [ + (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and set ters are not allowed in signature file.") + (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and set ters are not allowed in signature file.") + (Warning 3866, Line 10, Col 31, Line 8, Col 38, "The modifier will be ignored because accessible modifiers before getters and set ters are not allowed in signature file.") + ] + +[] +let ``Signature And Implement File Test`` = + let encodeFs = + FsSource """module Program + +type A() = + member val B: int = 0 with internal get, internal set + member val C: int = 0 with internal get, internal set + member val D: int = 0 with internal get, private set""" + Fsi """module Program + + type A = + new: unit -> A + member internal B: int + member internal C: int with get, set + // will warning + member D: int with internal get, private set + abstract E: int with get, set""" + |> withAdditionalSourceFile encodeFs + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and set ters are not allowed in signature file.") + (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and set ters are not allowed in signature file.") + (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains + member private A.D: int with set + but its signature specifies + member A.D: int with set + The accessibility specified in the signature is more than that specified in the implementation") + (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains + member internal A.D: int + but its signature specifies + member A.D: int + The accessibility specified in the signature is more than that specified in the implementation") + ] diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index ec4fc441f29..2ef191736fc 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -56,6 +56,7 @@ + From 6cf5d1c29db933ddd923c26c0cb382dc4f347c23 Mon Sep 17 00:00:00 2001 From: ijklam Date: Fri, 1 Mar 2024 20:31:10 +0800 Subject: [PATCH 09/43] fix tests --- .../AutoPropsWithModifierBeforeGetSet.fs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index 6bce30c9c05..fa299086542 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -19,7 +19,7 @@ let verifyCompileAndRun compilation = |> compileAndRun [] -let ``Instance Properties Test`` = +let ``Instance Properties Test`` () = Fs """type InstancePropertiesTest() = member val B1: int = 0 with get // should failed @@ -54,7 +54,7 @@ let ``Instance Properties Test`` = ] [] -let ``Static Properties Test`` = +let ``Static Properties Test`` () = Fs """type StaticPropertiesTest() = static member val B1: int = 0 with get // should failed @@ -89,7 +89,7 @@ let ``Static Properties Test`` = ] [] -let ``Abstract Properties Test: access modifiers are not allowed`` = +let ``Abstract Properties Test: access modifiers are not allowed`` () = Fs """type ``Abstract Properties Test`` = abstract member B1: int with get, set abstract member B2: int with get @@ -115,7 +115,7 @@ let ``Abstract Properties Test: access modifiers are not allowed`` = ] [] -let ``Signature File Test: no access modifiers before getter and setter`` = +let ``Signature File Test: no access modifiers before getter and setter`` () = Fsi """module Program type A = @@ -136,7 +136,7 @@ let ``Signature File Test: no access modifiers before getter and setter`` = ] [] -let ``Signature And Implement File Test`` = +let ``Signature And Implement File Test`` () = let encodeFs = FsSource """module Program From dbc52d493b45841411022e83783cca0bf4ccf395 Mon Sep 17 00:00:00 2001 From: ijklam Date: Fri, 1 Mar 2024 23:40:11 +0800 Subject: [PATCH 10/43] fix tests --- .../AutoPropsWithModifierBeforeGetSet.fs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index fa299086542..7333e59e93d 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -41,6 +41,7 @@ let ``Instance Properties Test`` () = member val internal B15: int = 0 with get // should failed member val internal B16: int = 0 with set""" + |> withLangVersionPreview |> typecheck |> shouldFail |> withDiagnostics [ @@ -76,6 +77,7 @@ let ``Static Properties Test`` () = static member val internal B15: int = 0 with get // should failed static member val internal B16: int = 0 with set""" + |> withLangVersionPreview |> typecheck |> shouldFail |> withDiagnostics [ @@ -104,6 +106,7 @@ let ``Abstract Properties Test: access modifiers are not allowed`` () = abstract member B7: int with internal get // should failed abstract member B8: int with internal set""" + |> withLangVersionPreview |> typecheck |> shouldFail |> withDiagnostics [ @@ -127,6 +130,7 @@ let ``Signature File Test: no access modifiers before getter and setter`` () = abstract E: int with get, set // will warning abstract F: int with get, private set""" + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -154,6 +158,7 @@ type A() = member D: int with internal get, private set abstract E: int with get, set""" |> withAdditionalSourceFile encodeFs + |> withLangVersionPreview |> compile |> shouldFail |> withDiagnostics [ From fbe1736ebcff65417bffddd5ddb42944587fea43 Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 2 Mar 2024 01:43:14 +0800 Subject: [PATCH 11/43] fix tests --- .../AutoPropsWithModifierBeforeGetSet.fs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index 7333e59e93d..3238bba99f4 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -134,9 +134,10 @@ let ``Signature File Test: no access modifiers before getter and setter`` () = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and set ters are not allowed in signature file.") - (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and set ters are not allowed in signature file.") - (Warning 3866, Line 10, Col 31, Line 8, Col 38, "The modifier will be ignored because accessible modifiers before getters and set ters are not allowed in signature file.") + (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") + (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") + (Warning 3866, Line 10, Col 31, Line 8, Col 38, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") + (Error 240, Line 1, Col 1, Line 11, Col 46, "The signature file 'Program' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match.") ] [] @@ -162,8 +163,8 @@ type A() = |> compile |> shouldFail |> withDiagnostics [ - (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and set ters are not allowed in signature file.") - (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and set ters are not allowed in signature file.") + (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") + (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains member private A.D: int with set but its signature specifies From 8e3a529558b09d7c56b688dd47e28efdcf3e508a Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 2 Mar 2024 02:32:34 +0800 Subject: [PATCH 12/43] fix tests --- .../AutoPropsWithModifierBeforeGetSet.fs | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index 3238bba99f4..1fff66bba7f 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -120,24 +120,24 @@ let ``Abstract Properties Test: access modifiers are not allowed`` () = [] let ``Signature File Test: no access modifiers before getter and setter`` () = Fsi """module Program - - type A = - new: unit -> A - member internal B: int - member internal C: int with get, set - // will warning - member D: int with internal get, private set - abstract E: int with get, set - // will warning - abstract F: int with get, private set""" + +type A = + new: unit -> A + member internal B: int + member internal C: int with get, set + // will warning + member D: int with internal get, private set + abstract E: int with get, set + // will warning + abstract F: int with get, private set""" |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") - (Warning 3866, Line 10, Col 31, Line 8, Col 38, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") - (Error 240, Line 1, Col 1, Line 11, Col 46, "The signature file 'Program' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match.") + (Warning 3866, Line 11, Col 31, Line 8, Col 38, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") + (Error 240, Line 1, Col 1, Line 11, Col 42, "The signature file 'Program' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match.") ] [] @@ -150,14 +150,14 @@ type A() = member val C: int = 0 with internal get, internal set member val D: int = 0 with internal get, private set""" Fsi """module Program - - type A = - new: unit -> A - member internal B: int - member internal C: int with get, set - // will warning - member D: int with internal get, private set - abstract E: int with get, set""" + +type A = + new: unit -> A + member internal B: int + member internal C: int with get, set + // will warning + member D: int with internal get, private set + abstract E: int with get, set""" |> withAdditionalSourceFile encodeFs |> withLangVersionPreview |> compile From 88e16782a11d0bfcdab5a3730641d3ceac8132aa Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 2 Mar 2024 02:35:25 +0800 Subject: [PATCH 13/43] fix --- .../MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index 1fff66bba7f..7e50420be72 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -136,7 +136,7 @@ type A = |> withDiagnostics [ (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") - (Warning 3866, Line 11, Col 31, Line 8, Col 38, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") + (Warning 3866, Line 11, Col 31, Line 11, Col 38, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") (Error 240, Line 1, Col 1, Line 11, Col 42, "The signature file 'Program' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match.") ] From 304348fa9918899769726a2b51fbbe33a026b785 Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 2 Mar 2024 03:07:39 +0800 Subject: [PATCH 14/43] fix --- .../MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index 7e50420be72..b5626794d9c 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -156,8 +156,7 @@ type A = member internal B: int member internal C: int with get, set // will warning - member D: int with internal get, private set - abstract E: int with get, set""" + member D: int with internal get, private set""" |> withAdditionalSourceFile encodeFs |> withLangVersionPreview |> compile From f82df9ed0873ed3ffef0fb19638a8d2af1ade4a7 Mon Sep 17 00:00:00 2001 From: ijklam Date: Sat, 2 Mar 2024 03:40:23 +0800 Subject: [PATCH 15/43] fix --- .../AutoPropsWithModifierBeforeGetSet.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index b5626794d9c..af378e0b10b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -166,12 +166,12 @@ type A = (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains member private A.D: int with set - but its signature specifies +but its signature specifies member A.D: int with set - The accessibility specified in the signature is more than that specified in the implementation") +The accessibility specified in the signature is more than that specified in the implementation") (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains member internal A.D: int - but its signature specifies +but its signature specifies member A.D: int - The accessibility specified in the signature is more than that specified in the implementation") +The accessibility specified in the signature is more than that specified in the implementation") ] From 97933a5b73f4ee431210636ed33f4069b1ae3da6 Mon Sep 17 00:00:00 2001 From: ijklam <43789618+Tangent-90@users.noreply.github.com> Date: Sat, 2 Mar 2024 04:37:40 +0800 Subject: [PATCH 16/43] fix --- .../MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index af378e0b10b..1521cd246d5 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -167,11 +167,11 @@ type A = (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains member private A.D: int with set but its signature specifies - member A.D: int with set + member A.D: int with set The accessibility specified in the signature is more than that specified in the implementation") (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains member internal A.D: int but its signature specifies - member A.D: int + member A.D: int The accessibility specified in the signature is more than that specified in the implementation") ] From 5a2d1fe5d276e1744c92c7e68fab75f8330f51d7 Mon Sep 17 00:00:00 2001 From: ijklam <43789618+Tangent-90@users.noreply.github.com> Date: Sat, 2 Mar 2024 05:55:19 +0800 Subject: [PATCH 17/43] add spaces --- .../MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index 1521cd246d5..8cbb793a95b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -165,12 +165,12 @@ type A = (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains - member private A.D: int with set + member private A.D: int with set but its signature specifies member A.D: int with set The accessibility specified in the signature is more than that specified in the implementation") (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains - member internal A.D: int + member internal A.D: int but its signature specifies member A.D: int The accessibility specified in the signature is more than that specified in the implementation") From 55e90813993e5ba57fbb732aad5faed29a501b1e Mon Sep 17 00:00:00 2001 From: ijklam Date: Tue, 5 Mar 2024 22:11:50 +0800 Subject: [PATCH 18/43] fix grammar --- src/Compiler/FSComp.txt | 2 +- src/Compiler/xlf/FSComp.txt.cs.xlf | 4 +- src/Compiler/xlf/FSComp.txt.de.xlf | 4 +- src/Compiler/xlf/FSComp.txt.es.xlf | 4 +- src/Compiler/xlf/FSComp.txt.fr.xlf | 4 +- src/Compiler/xlf/FSComp.txt.it.xlf | 4 +- src/Compiler/xlf/FSComp.txt.ja.xlf | 4 +- src/Compiler/xlf/FSComp.txt.ko.xlf | 4 +- src/Compiler/xlf/FSComp.txt.pl.xlf | 4 +- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 4 +- src/Compiler/xlf/FSComp.txt.ru.xlf | 4 +- src/Compiler/xlf/FSComp.txt.tr.xlf | 4 +- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 4 +- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 4 +- .../AutoPropsWithModifierBeforeGetSet.fs | 44 +++++++++---------- 15 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index b01ae65862e..a834f06d1d7 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1747,4 +1747,4 @@ featureReuseSameFieldsInStructUnions,"Share underlying fields in a [] di 3864,tooManyMethodsInDotNetTypeWritingAssembly,"The type '%s' has too many methods. Found: '%d', maximum: '%d'" 3865,parsOnlySimplePatternsAreAllowedInConstructors,"Only simple patterns are allowed in primary constructors" featureAllowAccessModifiersToAutoPropertiesGettersAndSetters,"Allow access modifiers to auto properties getters and setters" -3866,parsAccessModifiersBeforeGettersAndSettersNotAllowedInSigFile,"The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file." \ No newline at end of file +3866,parsAccessModifiersBeforeGettersAndSettersNotAllowedInSigFile,"The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file." \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 6f5a9917162..265796ff457 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 1763e40f516..00d3f8fa117 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index edb7f81451e..6ca34652320 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index acf1d659841..d58f9d1c985 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index ffd344eb313..7047082d50f 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 9fec3132b7e..5b36b870885 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 83100be58e5..6a1ddc4eb1f 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index d0b68ea2aac..fe2c3d35019 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 7d6257a13ce..d020fe90a8e 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index a8c475adaf2..bac57c5e781 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index e397891356f..b17dba8ce76 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 9354c615978..37b0fab11bb 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index fc8903ff698..1ef681918f6 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -908,8 +908,8 @@ - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. + The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index 8cbb793a95b..8e1703df5a2 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -22,24 +22,24 @@ let verifyCompileAndRun compilation = let ``Instance Properties Test`` () = Fs """type InstancePropertiesTest() = member val B1: int = 0 with get - // should failed + // should fail member val B2: int = 0 with set member val B3: int = 0 with get, set member val B4: int = 0 with internal get - // should failed + // should fail member val B5: int = 0 with internal set member val B6: int = 0 with internal get, internal set member val B7: int = 0 with internal get, set member val B8: int = 0 with get, internal set - // should failed + // should fail member val internal B11: int = 0 with internal get, set - // should failed + // should fail member val internal B12: int = 0 with internal get - // should failed + // should fail member val internal B13: int = 0 with internal set member val internal B14: int = 0 with get, set member val internal B15: int = 0 with get - // should failed + // should fail member val internal B16: int = 0 with set""" |> withLangVersionPreview |> typecheck @@ -58,24 +58,24 @@ let ``Instance Properties Test`` () = let ``Static Properties Test`` () = Fs """type StaticPropertiesTest() = static member val B1: int = 0 with get - // should failed + // should fail static member val B2: int = 0 with set static member val B3: int = 0 with get, set static member val B4: int = 0 with internal get - // should failed + // should fail static member val B5: int = 0 with internal set static member val B6: int = 0 with internal get, internal set static member val B7: int = 0 with internal get, set static member val B8: int = 0 with get, internal set - // should failed + // should fail static member val internal B11: int = 0 with internal get, set - // should failed + // should fail static member val internal B12: int = 0 with internal get - // should failed + // should fail static member val internal B13: int = 0 with internal set static member val internal B14: int = 0 with get, set static member val internal B15: int = 0 with get - // should failed + // should fail static member val internal B16: int = 0 with set""" |> withLangVersionPreview |> typecheck @@ -96,15 +96,15 @@ let ``Abstract Properties Test: access modifiers are not allowed`` () = abstract member B1: int with get, set abstract member B2: int with get abstract member B3: int with set - // should failed + // should fail abstract member B4: int with internal get, set - // should failed + // should fail abstract member B5: int with get, internal set - // should failed + // should fail abstract member B6: int with internal get, internal set - // should failed + // should fail abstract member B7: int with internal get - // should failed + // should fail abstract member B8: int with internal set""" |> withLangVersionPreview |> typecheck @@ -134,9 +134,9 @@ type A = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") - (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") - (Warning 3866, Line 11, Col 31, Line 11, Col 38, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") + (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file.") + (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file.") + (Warning 3866, Line 11, Col 31, Line 11, Col 38, "The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file.") (Error 240, Line 1, Col 1, Line 11, Col 42, "The signature file 'Program' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match.") ] @@ -162,8 +162,8 @@ type A = |> compile |> shouldFail |> withDiagnostics [ - (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") - (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because accessible modifiers before getters and setters are not allowed in signature file.") + (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file.") + (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file.") (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains member private A.D: int with set but its signature specifies From 34a0010b87624fe8c4c43c7f53b2173899862bd6 Mon Sep 17 00:00:00 2001 From: ijklam Date: Tue, 12 Mar 2024 14:42:48 +0800 Subject: [PATCH 19/43] support in signature file --- src/Compiler/Checking/CheckDeclarations.fs | 37 ++------------------- src/Compiler/Checking/CheckExpressions.fs | 16 ++++++++- src/Compiler/FSComp.txt | 1 - src/Compiler/Service/ServiceNavigation.fs | 24 +++++++++----- src/Compiler/SyntaxTree/ParseHelpers.fs | 3 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 24 +++++++++++--- src/Compiler/SyntaxTree/SyntaxTree.fsi | 14 +++++--- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 38 ++++++++++++++++++++++ src/Compiler/SyntaxTree/SyntaxTreeOps.fsi | 2 ++ src/Compiler/pars.fsy | 24 ++++++++------ src/Compiler/xlf/FSComp.txt.cs.xlf | 5 --- src/Compiler/xlf/FSComp.txt.de.xlf | 5 --- src/Compiler/xlf/FSComp.txt.es.xlf | 5 --- src/Compiler/xlf/FSComp.txt.fr.xlf | 5 --- src/Compiler/xlf/FSComp.txt.it.xlf | 5 --- src/Compiler/xlf/FSComp.txt.ja.xlf | 5 --- src/Compiler/xlf/FSComp.txt.ko.xlf | 5 --- src/Compiler/xlf/FSComp.txt.pl.xlf | 5 --- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 --- src/Compiler/xlf/FSComp.txt.ru.xlf | 5 --- src/Compiler/xlf/FSComp.txt.tr.xlf | 5 --- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 --- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 --- 23 files changed, 117 insertions(+), 131 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index f02ccdff9a4..df7ecb75205 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -4359,7 +4359,7 @@ module TcDeclarations = let rec postAutoProps memb = match memb with | SynMemberDefn.AutoProperty(ident = id) when String.IsNullOrEmpty(id.idText) -> [] - | SynMemberDefn.AutoProperty(attributes=Attributes attribs; isStatic=isStatic; ident=id; typeOpt=tyOpt; propKind=propKind; memberFlags=memberFlags; memberFlagsForSet=memberFlagsForSet; xmlDoc=xmlDoc; trivia = { GetSetKeywords = mGetSetOpt }; accessibility = access; getterAccessibility = getterAccess; setterAccessibility = setterAccess) -> + | SynMemberDefn.AutoProperty(attributes=Attributes attribs; isStatic=isStatic; ident=id; typeOpt=tyOpt; propKind=propKind; memberFlags=memberFlags; memberFlagsForSet=memberFlagsForSet; xmlDoc=xmlDoc; trivia = { GetSetKeywords = mGetSetOpt }; accessibility = access) -> let mMemberPortion = id.idRange // Only the keep the non-field-targeted attributes let attribs = attribs |> List.filter (fun a -> match a.Target with Some t when t.idText = "field" -> false | _ -> true) @@ -4373,40 +4373,7 @@ module TcDeclarations = | SynMemberKind.PropertySet, Some getSetKeywords -> errorR(Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSetNotJustSet(), getSetKeywords.Range)) | _ -> () - let getterAccess, setterAccess = - match propKind with - | SynMemberKind.PropertyGetSet -> - match access with - | Some _ -> - match getterAccess, setterAccess with - | None, None -> access, access - | Some x, _ - | _, Some x -> - errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) - None, None - | None -> - match getterAccess, setterAccess with - | Some x, _ - | _, Some x -> - checkLanguageFeatureAndRecover g.langVersion LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range - getterAccess, setterAccess - | _, _ -> None, None - | SynMemberKind.PropertySet -> - match access, setterAccess with - | Some _, Some x -> - errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) - None, None - | _, None -> None, access - | None, _ -> None, setterAccess - | SynMemberKind.Member - | SynMemberKind.PropertyGet - | _ -> - match access, getterAccess with - | Some _, Some x -> - errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) - None, None - | _, None -> access, None - | None, _ -> getterAccess, None + let getterAccess, setterAccess = getGetterSetterAccess access propKind g.langVersion [ match propKind with | SynMemberKind.Member diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index f7e048223bf..2796281317b 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -12507,8 +12507,22 @@ let TcAndPublishValSpec (cenv: cenv, env, containerInfo: ContainerInfo, declKind let valinfos, tpenv = TcValSpec cenv env declKind newOk containerInfo memFlagsOpt None tpenv synValSig attrs let denv = env.DisplayEnv + let viss = + match memFlagsOpt with + | Some ({MemberKind = SynMemberKind.PropertyGetSet as propKind}) -> + let getterAccess, setterAccess = getGetterSetterAccess vis propKind g.langVersion + [getterAccess; setterAccess] + | Some ({MemberKind = SynMemberKind.PropertyGet as propKind}) -> + let getterAccess, _ = getGetterSetterAccess vis propKind g.langVersion + [getterAccess] + | Some ({MemberKind = SynMemberKind.PropertySet as propKind}) -> + let _, setterAccess = getGetterSetterAccess vis propKind g.langVersion + [setterAccess] + | _ -> + [vis.SingleAccess()] + let valinfos = List.zip valinfos viss - (tpenv, valinfos) ||> List.mapFold (fun tpenv valSpecResult -> + (tpenv, valinfos) ||> List.mapFold (fun tpenv (valSpecResult, vis) -> let (ValSpecResult (altActualParent, memberInfoOpt, id, enclosingDeclaredTypars, declaredTypars, ty, prelimValReprInfo, declKind)) = valSpecResult diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 61e280428b2..fb3283b89e0 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1748,4 +1748,3 @@ featureReuseSameFieldsInStructUnions,"Share underlying fields in a [] di 3864,tooManyMethodsInDotNetTypeWritingAssembly,"The type '%s' has too many methods. Found: '%d', maximum: '%d'" 3865,parsOnlySimplePatternsAreAllowedInConstructors,"Only simple patterns are allowed in primary constructors" featureAllowAccessModifiersToAutoPropertiesGettersAndSetters,"Allow access modifiers to auto properties getters and setters" -3866,parsAccessModifiersBeforeGettersAndSettersNotAllowedInSigFile,"The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file." \ No newline at end of file diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index bb118ae2c76..eb2b5152872 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -332,10 +332,8 @@ module NavigationImpl = [ createMember (rcid, NavigationItemKind.Field, FSharpGlyph.Field, range, enclosingEntityKind, false, access) ] - | SynMemberDefn.AutoProperty( - ident = id; accessibility = access; getterAccessibility = getterAccessibility; setterAccessibility = setterAccessibility; propKind = propKind) -> - let getterAccessibility = getterAccessibility |> Option.orElse access - let setterAccessibility = setterAccessibility |> Option.orElse access + | SynMemberDefn.AutoProperty(ident = id; accessibility = access; propKind = propKind) -> + let getterAccessibility,setterAccessibility = access.GetSetAccessNoCheck() [ match propKind with @@ -348,7 +346,7 @@ module NavigationImpl = ] | SynMemberDefn.AbstractSlot(slotSig = SynValSig(ident = SynIdent(id, _); synType = ty; accessibility = access)) -> [ - createMember (id, NavigationItemKind.Method, FSharpGlyph.OverridenMethod, ty.Range, enclosingEntityKind, true, access) + createMember (id, NavigationItemKind.Method, FSharpGlyph.OverridenMethod, ty.Range, enclosingEntityKind, true, access.SingleAccess()) ] | SynMemberDefn.NestedType _ -> failwith "tycon as member????" //processTycon tycon | SynMemberDefn.Interface(members = Some(membs)) -> processMembers membs enclosingEntityKind |> snd @@ -574,10 +572,18 @@ module NavigationImpl = [ for memb in members do match memb with - | SynMemberSig.Member(memberSig = SynValSig.SynValSig(ident = SynIdent(id, _); accessibility = access; range = m)) -> - createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Class, false, access) + | SynMemberSig.Member(memberSig = SynValSig.SynValSig(ident = SynIdent(id, _); accessibility = access; range = m); flags = {MemberKind = propKind}) -> + let getterAccessibility,setterAccessibility = access.GetSetAccessNoCheck() + match propKind with + | SynMemberKind.PropertyGetSet -> + yield createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Class, false, getterAccessibility) + yield createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Class, false, setterAccessibility) + | SynMemberKind.PropertySet -> + yield createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Class, false, setterAccessibility) + | _ -> + yield createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Class, false, getterAccessibility) | SynMemberSig.ValField(SynField(idOpt = Some rcid; fieldType = ty; accessibility = access), _) -> - createMember (rcid, NavigationItemKind.Field, FSharpGlyph.Field, ty.Range, NavigationEntityKind.Class, false, access) + yield createMember (rcid, NavigationItemKind.Field, FSharpGlyph.Field, ty.Range, NavigationEntityKind.Class, false, access) | _ -> () ] @@ -587,7 +593,7 @@ module NavigationImpl = for decl in decls do match decl with | SynModuleSigDecl.Val(SynValSig.SynValSig(ident = SynIdent(id, _); accessibility = access; range = m), _) -> - createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Module, false, access) + createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Module, false, access.SingleAccess()) | _ -> () ] diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index b1d44984aaa..3f6c12dd217 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -1102,6 +1102,7 @@ let mkSynUnionCase attributes (access: SynAccess option) id kind mDecl (xmlDoc, let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDoc attribs flags rangeStart = let mWith, (getSet, getSetOpt, getterAccess, setterAccess) = accessors + let access = SynValSigAccess.GetSet(access, getterAccess, setterAccess) let memberRange = match getSetOpt with @@ -1135,8 +1136,6 @@ let mkAutoPropDefn mVal access ident typ mEquals (expr: SynExpr) accessors xmlDo memberFlagsForSet, xmlDoc, access, - getterAccess, - setterAccess, expr, memberRange, trivia diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index a4ba8c601f4..12a833abd0d 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1308,6 +1308,24 @@ type SynComponentInfo = match this with | SynComponentInfo(range = m) -> m +[] +type SynValSigAccess = + | Single of accessibility: SynAccess option + | GetSet of accessibility: SynAccess option * getterAccessibility: SynAccess option * setterAccessibility: SynAccess option + + member this.SingleAccess () = + match this with + | Single(access) + | GetSet(accessibility = access) -> access + + member this.GetSetAccessNoCheck () = + match this with + | SynValSigAccess.Single(access) -> access, access + | SynValSigAccess.GetSet(access, getterAccess, setterAccess) -> + let getterAccess = getterAccess |> Option.orElse access + let setterAccess = setterAccess |> Option.orElse access + getterAccess, setterAccess + [] type SynValSig = | SynValSig of @@ -1319,7 +1337,7 @@ type SynValSig = isInline: bool * isMutable: bool * xmlDoc: PreXmlDoc * - accessibility: SynAccess option * + accessibility: SynValSigAccess * synExpr: SynExpr option * range: range * trivia: SynValSigTrivia @@ -1462,9 +1480,7 @@ type SynMemberDefn = memberFlags: SynMemberFlags * memberFlagsForSet: SynMemberFlags * xmlDoc: PreXmlDoc * - accessibility: SynAccess option * - getterAccessibility: SynAccess option * - setterAccessibility: SynAccess option * + accessibility: SynValSigAccess * synExpr: SynExpr * range: range * trivia: SynMemberDefnAutoPropertyTrivia diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 2f1d1d5776c..a359a848613 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1477,6 +1477,14 @@ type SynComponentInfo = /// Gets the syntax range of this construct member Range: range +/// Represents two access +[] +type SynValSigAccess = + | Single of accessibility: SynAccess option + | GetSet of accessibility: SynAccess option * getterAccessibility: SynAccess option * setterAccessibility: SynAccess option + member SingleAccess: unit -> SynAccess option + member GetSetAccessNoCheck: unit -> SynAccess option * SynAccess option + /// Represents the syntax tree for a 'val' definition in an abstract slot or a signature file [] type SynValSig = @@ -1489,7 +1497,7 @@ type SynValSig = isInline: bool * isMutable: bool * xmlDoc: PreXmlDoc * - accessibility: SynAccess option * + accessibility: SynValSigAccess * synExpr: SynExpr option * range: range * trivia: SynValSigTrivia @@ -1655,9 +1663,7 @@ type SynMemberDefn = memberFlags: SynMemberFlags * memberFlagsForSet: SynMemberFlags * xmlDoc: PreXmlDoc * - accessibility: SynAccess option * - getterAccessibility: SynAccess option * - setterAccessibility: SynAccess option * + accessibility: SynValSigAccess * synExpr: SynExpr * range: range * trivia: SynMemberDefnAutoPropertyTrivia diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index a02591eb650..2a8ba04167f 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -1068,3 +1068,41 @@ let (|Get_OrSet_Ident|_|) (ident: Ident) = if ident.idText.StartsWithOrdinal("get_") then ValueSome() elif ident.idText.StartsWithOrdinal("set_") then ValueSome() else ValueNone + +let getGetterSetterAccess synValSigAccess memberKind (langVersion: Features.LanguageVersion) = + match synValSigAccess with + | SynValSigAccess.Single(access) -> access, access + | SynValSigAccess.GetSet(access, getterAccess, setterAccess) -> + match memberKind with + | SynMemberKind.PropertyGetSet -> + match access with + | Some _ -> + match getterAccess, setterAccess with + | None, None -> access, access + | Some x, _ + | _, Some x -> + errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + None, None + | None -> + match getterAccess, setterAccess with + | Some x, _ + | _, Some x -> + checkLanguageFeatureAndRecover langVersion Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range + getterAccess, setterAccess + | _, _ -> None, None + | SynMemberKind.PropertySet -> + match access, setterAccess with + | Some _, Some x -> + errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + None, None + | _, None -> None, access + | None, _ -> None, setterAccess + | SynMemberKind.Member + | SynMemberKind.PropertyGet + | _ -> + match access, getterAccess with + | Some _, Some x -> + errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + None, None + | _, None -> access, None + | None, _ -> getterAccess, None diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi index 6136886a3cc..51638c1bbd6 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi @@ -359,3 +359,5 @@ val (|TypesForTypar|): t: SynType -> SynType list /// Generated get_XYZ or set_XYZ ident text [] val (|Get_OrSet_Ident|_|): Ident -> unit voption + +val getGetterSetterAccess: SynValSigAccess -> SynMemberKind -> Features.LanguageVersion -> SynAccess option * SynAccess option diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index b8871f5a270..547136f4efe 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -729,6 +729,7 @@ valSpfn: | opt_attributes opt_access VAL opt_attributes opt_inline opt_mutable opt_access nameop opt_explicitValTyparDecls COLON topTypeWithTypeConstraints optLiteralValueSpfn { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) let attr1, attr2, isInline, isMutable, vis2, id, doc, explicitValTyparDecls, (ty, arity), (mEquals, konst: SynExpr option) = ($1), ($4), (Option.isSome $5), (Option.isSome $6), ($7), ($8), grabXmlDoc(parseState, $1, 1), ($9), ($11), ($12) + let vis2 = SynValSigAccess.Single(vis2) if not (isNil attr2) then errorR(Deprecated(FSComp.SR.parsAttributesMustComeBeforeVal(), rhs parseState 4)) let m = rhs2 parseState 1 11 @@ -874,7 +875,9 @@ tyconSpfnRhs: { let m = lhs parseState let ty, arity = $3 let flags = AbstractMemberFlags true SynMemberKind.Member - let valSig = SynValSig([], (SynIdent(mkSynId m "Invoke", None)), inferredTyparDecls, ty, arity, false, false, PreXmlDoc.Empty, None, None, m, SynValSigTrivia.Zero) + let vis2 = SynValSigAccess.Single(None) + + let valSig = SynValSig([], (SynIdent(mkSynId m "Invoke", None)), inferredTyparDecls, ty, arity, false, false, PreXmlDoc.Empty, vis2, None, m, SynValSigTrivia.Zero) let invoke = SynMemberSig.Member(valSig, flags, m, SynMemberSigMemberTrivia.Zero) (fun leadingKeyword nameRange nameInfo mEquals augmentation -> if not (isNil augmentation) then raiseParseErrorAt m (FSComp.SR.parsAugmentationsIllegalOnDelegateType()) @@ -950,12 +953,10 @@ classMemberSpfn: { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) let isInline, doc, vis2, id, explicitValTyparDecls, (ty, arity), (mEquals, optLiteralValue) = (Option.isSome $4), grabXmlDoc(parseState, $1, 1), $5, $6, $7, $9, $11 let mWith, (getSet, getSetRangeOpt, getterAccess, setterAccess) = $10 - match getterAccess with - | Some(x: SynAccess) -> warning(Error(FSComp.SR.parsAccessModifiersBeforeGettersAndSettersNotAllowedInSigFile(), x.Range)) - | _ -> () - match setterAccess with - | Some(x: SynAccess) -> warning(Error(FSComp.SR.parsAccessModifiersBeforeGettersAndSettersNotAllowedInSigFile(), x.Range)) - | _ -> () + let vis2 = + match getterAccess, setterAccess with + | None, None -> SynValSigAccess.Single(vis2) + | _ -> SynValSigAccess.GetSet(vis2, getterAccess, setterAccess) let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet let mWhole = @@ -1017,11 +1018,12 @@ classMemberSpfn: | opt_attributes opt_access NEW COLON topTypeWithTypeConstraints { let vis, doc, (ty, valSynInfo) = $2, grabXmlDoc(parseState, $1, 1), $5 + let vis2 = SynValSigAccess.Single(vis) let mNew = rhs parseState 3 let m = unionRanges (rhs parseState 1) ty.Range |> unionRangeWithXmlDoc doc let isInline = false let trivia: SynValSigTrivia = { LeadingKeyword = SynLeadingKeyword.New mNew; InlineKeyword = None; WithKeyword = None; EqualsRange = None } - let valSpfn = SynValSig ($1, (SynIdent(mkSynId (rhs parseState 3) "new", None)), noInferredTypars, ty, valSynInfo, isInline, false, doc, vis, None, m, trivia) + let valSpfn = SynValSig ($1, (SynIdent(mkSynId (rhs parseState 3) "new", None)), noInferredTypars, ty, valSynInfo, isInline, false, doc, vis2, None, m, trivia) SynMemberSig.Member(valSpfn, CtorMemberFlags, m, SynMemberSigMemberTrivia.Zero) } @@ -1766,7 +1768,8 @@ tyconDefnRhs: { let m = lhs parseState let ty, arity = $3 (fun nameRange augmentation -> - let valSig = SynValSig([], (SynIdent(mkSynId m "Invoke", None)), inferredTyparDecls, ty, arity, false, false, PreXmlDoc.Empty, None, None, m, SynValSigTrivia.Zero) + let vis2 = SynValSigAccess.Single(None) + let valSig = SynValSig([], (SynIdent(mkSynId m "Invoke", None)), inferredTyparDecls, ty, arity, false, false, PreXmlDoc.Empty, vis2, None, m, SynValSigTrivia.Zero) let flags = AbstractMemberFlags true SynMemberKind.Member let invoke = SynMemberDefn.AbstractSlot(valSig, flags, m, SynMemberDefnAbstractSlotTrivia.Zero) if not (isNil augmentation) then raiseParseErrorAt m (FSComp.SR.parsAugmentationsIllegalOnDelegateType()) @@ -2053,7 +2056,8 @@ classDefnMember: then errorR(Error(FSComp.SR.parsAccessibilityModsIllegalForAbstract(), mWhole)) let mkFlags, leadingKeyword = $3 let trivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $4; WithKeyword = mWith; EqualsRange = None } - let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, None, None, mWhole, trivia) + let vis2 = SynValSigAccess.Single(None) + let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, vis2, None, mWhole, trivia) let trivia: SynMemberDefnAbstractSlotTrivia = { GetSetKeywords = getSetRangeOpt } [ SynMemberDefn.AbstractSlot(valSpfn, mkFlags (getSetAdjuster arity), mWhole, trivia) ] } diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 509c8bd4ad7..9199899ff46 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -912,11 +912,6 @@ Funkce správy balíčků vyžaduje jazykovou verzi 5.0 nebo vyšší. - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. Syntaxi průniku omezení lze použít pouze s flexibilními typy, například „#IDisposable a #ISomeInterface“. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 2635ea818f1..b2fd21cb222 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -912,11 +912,6 @@ Für das „Paketverwaltungsfeature“ ist Sprachversion 5.0 oder höher erforderlich - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. Die Einschränkungsüberschneidungssyntax kann nur mit flexiblen Typen verwendet werden, z. B. "#IDisposable & #ISomeInterface". diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 3c81bed6124..3992fb1bfbd 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -912,11 +912,6 @@ La característica de "administración de paquetes" requiere la versión de lenguaje 5.0 o superior - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. La sintaxis de intersección de restricciones solo se puede usar con tipos flexibles, por ejemplo, "#IDisposable &#ISomeInterface". diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 5162b04d3d8..8882231a7aa 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -912,11 +912,6 @@ La fonction « gestion des paquets » nécessite une version de langue 5.0 ou supérieure. - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. La syntaxe d'intersection de contraintes ne peut être utilisée qu'avec des types flexibles, par ex. '#IDisposable et #ISomeInterface'. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 4050b14cf7f..1352c0a41af 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -912,11 +912,6 @@ La funzionalità 'gestione pacchetti' richiede la versione del linguaggio 5.0 o superiore - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. La sintassi dell'intersezione dei vincoli può essere usata solo con tipi flessibili, ad esempio '#IDisposable & #ISomeInterface'. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 2f30491d680..3ae167f00bb 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -912,11 +912,6 @@ 'package management' (パッケージ管理) 機能には、言語バージョン 5.0 以降が必要です - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. 制約交差構文は、"#IDisposable & #ISomeInterface" など、柔軟な型でのみ使用できます。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 9340410bcba..aaf1eed7d34 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -912,11 +912,6 @@ '패키지 관리' 기능을 사용하려면 언어 버전 5.0 이상이 필요합니다. - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. 제약 조건 교차 구문은 유연한 형식(예: '#IDisposable &#ISomeInterface')에서만 사용할 수 있습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 5452bcebf00..78842874e50 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -912,11 +912,6 @@ Funkcja „Zarządzanie pakietami” wymaga języka w wersji 5.0 lub nowszej - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. Składnia przecięcia ograniczenia może być używana tylko z typami elastycznymi, np. „#IDisposable &#ISomeInterface”. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index f90d3d8fa12..9f4b454a230 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -912,11 +912,6 @@ O recurso 'gerenciamento de pacotes' requer a versão 5.0 ou superior do idioma - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. A sintaxe de interseção de restrição só pode ser usada com tipos flexíveis, por exemplo, "#IDisposable & #ISomeInterface". diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index f4a2e807c60..0492c483451 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -912,11 +912,6 @@ Для функции управления пакетами требуется версия языка 5.0 или более поздняя - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. Синтаксис пересечения ограничений можно использовать только с гибкими типами, например. "#IDisposable & #ISomeInterface". diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 940de471b10..ae24920c309 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -912,11 +912,6 @@ ‘Paket yönetimi’ özelliği, dil sürümü 5.0 veya üstünü gerektirir - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. Kısıtlama kesişimi söz dizimi yalnızca esnek türlerle kullanılabilir. Ör. '#IDisposable & #ISomeInterface'. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 30e6d6073c0..ac949eea3a5 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -912,11 +912,6 @@ “包管理”功能需要语言版本 5.0 或更高版本 - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. 约束交集语法只能与灵活类型一起使用,例如 "#IDisposable & #ISomeInterface"。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 8d79311a0dc..e1e47df5751 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -912,11 +912,6 @@ 「套件管理」功能需要語言版本 5.0 或更新版本 - - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file. - - Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'. 條件約束交集語法只能搭配彈性類型使用,例如「#IDisposable 與 #ISomeInterface'」。 From 25b75f642a4cbbfab1dc7425e64dd39d61d3cef9 Mon Sep 17 00:00:00 2001 From: ijklam Date: Tue, 12 Mar 2024 15:07:48 +0800 Subject: [PATCH 20/43] update test --- .../AutoPropsWithModifierBeforeGetSet.fs | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index 8e1703df5a2..960d7f2bd7e 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -125,19 +125,14 @@ type A = new: unit -> A member internal B: int member internal C: int with get, set - // will warning member D: int with internal get, private set abstract E: int with get, set - // will warning abstract F: int with get, private set""" |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ - (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file.") - (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file.") - (Warning 3866, Line 11, Col 31, Line 11, Col 38, "The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file.") - (Error 240, Line 1, Col 1, Line 11, Col 42, "The signature file 'Program' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match.") + (Error 240, Line 1, Col 1, Line 9, Col 42, "The signature file 'Program' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match.") ] [] @@ -148,30 +143,21 @@ let ``Signature And Implement File Test`` () = type A() = member val B: int = 0 with internal get, internal set member val C: int = 0 with internal get, internal set - member val D: int = 0 with internal get, private set""" + member val D: int = 0 with internal get, private set + member val E: int = 0 with internal get, private set""" Fsi """module Program type A = new: unit -> A member internal B: int - member internal C: int with get, set - // will warning - member D: int with internal get, private set""" + member internal C: int with get, set + member D: int with internal get, private set + member E: int with get, set""" |> withAdditionalSourceFile encodeFs |> withLangVersionPreview |> compile |> shouldFail |> withDiagnostics [ - (Warning 3866, Line 8, Col 24, Line 8, Col 32, "The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file.") - (Warning 3866, Line 8, Col 38, Line 8, Col 45, "The modifier will be ignored because access modifiers before getters and setters are not allowed in signature file.") - (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains - member private A.D: int with set -but its signature specifies - member A.D: int with set -The accessibility specified in the signature is more than that specified in the implementation") - (Error 0034, Line 6, Col 16, Line 6, Col 17, "Module 'Program' contains - member internal A.D: int -but its signature specifies - member A.D: int -The accessibility specified in the signature is more than that specified in the implementation") + (Error 0034, Line 7, Col 16, Line 7, Col 17, "Module 'Program' contains member private A.E: int with set but its signature specifies member A.E: int with set The accessibility specified in the signature is more than that specified in the implementation") + (Error 0034, Line 7, Col 16, Line 7, Col 17, "Module 'Program' contains member internal A.E: int but its signature specifies member A.E: int t The accessibility specified in the signature is more than that specified in the implementation") ] From eba76af3c622579bbaaf72d75957e4e91b238ef3 Mon Sep 17 00:00:00 2001 From: ijklam <43789618+Tangent-90@users.noreply.github.com> Date: Tue, 12 Mar 2024 15:13:13 +0800 Subject: [PATCH 21/43] Update preview.md --- docs/release-notes/.Language/preview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 0e34b389ef0..d5d6353eb3a 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -5,7 +5,7 @@ * Bidirectional F#/C# interop for 'unmanaged' constraint. ([PR #12154](https://github.com/dotnet/fsharp/pull/12154)) * Make `.Is*` discriminated union properties visible. ([Language suggestion #222](https://github.com/fsharp/fslang-suggestions/issues/222), [PR #16341](https://github.com/dotnet/fsharp/pull/16341)) * Allow returning bool instead of unit option for partial active patterns. ([Language suggestion #1041](https://github.com/fsharp/fslang-suggestions/issues/1041), [PR #16473](https://github.com/dotnet/fsharp/pull/16473)) -* Allow access modifies to auto properties getters and setters ([PR 16687](https://github.com/dotnet/fsharp/pull/16687), [Language suggestion #430](https://github.com/fsharp/fslang-suggestions/issues/430)) +* Allow access modifies to auto properties getters and setters ([PR 16687](https://github.com/dotnet/fsharp/pull/16687), [PR 16861](https://github.com/dotnet/fsharp/pull/16861), [Language suggestion #430](https://github.com/fsharp/fslang-suggestions/issues/430)) ### Fixed From a6d5a6d879b67c975ac459f75151cb381bc0ecfe Mon Sep 17 00:00:00 2001 From: ijklam Date: Tue, 12 Mar 2024 17:46:36 +0800 Subject: [PATCH 22/43] fix support for tooling --- src/Compiler/Checking/NicePrint.fs | 77 ++++++++++++++++-------------- src/Compiler/Checking/infos.fs | 24 ++++++++++ src/Compiler/Checking/infos.fsi | 4 ++ src/Compiler/Symbols/Symbols.fs | 48 +++++++++++++------ 4 files changed, 102 insertions(+), 51 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index a09328222c4..7ad99c3c507 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1259,7 +1259,7 @@ module PrintTastMemberOrVals = else nameL - let layoutMemberName (denv: DisplayEnv) (vref: ValRef) niceMethodTypars argInfos tagFunction name = + let layoutMemberName (denv: DisplayEnv) (vref: ValRef) niceMethodTypars argInfos tagFunction name withAccessibility = let nameL = ConvertValLogicalNameToDisplayLayout vref.IsBaseVal (tagFunction >> mkNav vref.DefinitionRange >> wordL) name let nameL = if denv.showMemberContainers then @@ -1281,8 +1281,8 @@ module PrintTastMemberOrVals = layoutTyparDecls denv nameL true niceMethodTypars else nameL - let nameL = layoutAccessibility denv vref.Accessibility nameL - nameL + if withAccessibility then layoutAccessibility denv vref.Accessibility nameL + else nameL let prettyLayoutOfMemberShortOption denv typarInst (v: Val) short = let vref = mkLocalValRef v @@ -1303,7 +1303,7 @@ module PrintTastMemberOrVals = let resL = if short then tauL else - let nameL = layoutMemberName denv vref niceMethodTypars argInfos tagMember vref.DisplayNameCoreMangled + let nameL = layoutMemberName denv vref niceMethodTypars argInfos tagMember vref.DisplayNameCoreMangled true let nameL = if short then nameL else mkInlineL denv vref.Deref nameL stat --- ((nameL |> addColonL) ^^ tauL) prettyTyparInst, resL @@ -1325,11 +1325,11 @@ module PrintTastMemberOrVals = if isNil argInfos then // use error recovery because intellisense on an incomplete file will show this errorR(Error(FSComp.SR.tastInvalidFormForPropertyGetter(), vref.Id.idRange)) - let nameL = layoutMemberName denv vref [] argInfos tagProperty vref.DisplayNameCoreMangled + let nameL = layoutMemberName denv vref [] argInfos tagProperty vref.DisplayNameCoreMangled false let nameL = if short then nameL else mkInlineL denv vref.Deref nameL let resL = - if short then nameL --- (WordL.keywordWith ^^ WordL.keywordGet) - else stat --- nameL --- (WordL.keywordWith ^^ WordL.keywordGet) + if short then nameL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet) + else stat --- nameL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet) emptyTyparInst, resL else let argInfos = @@ -1340,20 +1340,20 @@ module PrintTastMemberOrVals = let resL = if short then if isNil argInfos then tauL - else tauL --- (WordL.keywordWith ^^ WordL.keywordGet) + else tauL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet) else - let nameL = layoutMemberName denv vref niceMethodTypars argInfos tagProperty vref.DisplayNameCoreMangled + let nameL = layoutMemberName denv vref niceMethodTypars argInfos tagProperty vref.DisplayNameCoreMangled false let nameL = if short then nameL else mkInlineL denv vref.Deref nameL - stat --- ((nameL |> addColonL) ^^ (if isNil argInfos then tauL else tauL --- (WordL.keywordWith ^^ WordL.keywordGet))) + stat --- ((nameL |> addColonL) ^^ (if isNil argInfos then tauL else tauL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet))) prettyTyparInst, resL | SynMemberKind.PropertySet -> if argInfos.Length <> 1 || isNil argInfos.Head then // use error recovery because intellisense on an incomplete file will show this errorR(Error(FSComp.SR.tastInvalidFormForPropertySetter(), vref.Id.idRange)) - let nameL = layoutMemberName denv vref [] argInfos tagProperty vref.DisplayNameCoreMangled + let nameL = layoutMemberName denv vref [] argInfos tagProperty vref.DisplayNameCoreMangled false let nameL = if short then nameL else mkInlineL denv vref.Deref nameL - let resL = stat --- nameL --- (WordL.keywordWith ^^ WordL.keywordSet) + let resL = stat --- nameL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordSet) emptyTyparInst, resL else let curriedArgInfos = argInfos @@ -1363,9 +1363,9 @@ module PrintTastMemberOrVals = if short then (tauL --- (WordL.keywordWith ^^ WordL.keywordSet)) else - let nameL = layoutMemberName denv vref niceMethodTypars curriedArgInfos tagProperty vref.DisplayNameCoreMangled + let nameL = layoutMemberName denv vref niceMethodTypars curriedArgInfos tagProperty vref.DisplayNameCoreMangled false let nameL = if short then nameL else mkInlineL denv vref.Deref nameL - stat --- ((nameL |> addColonL) ^^ (tauL --- (WordL.keywordWith ^^ WordL.keywordSet))) + stat --- ((nameL |> addColonL) ^^ (tauL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordSet))) prettyTyparInst, resL prettyTyparInst, memberL @@ -1673,14 +1673,17 @@ module InfoMemberPrinting = let retTy = if pinfo.IsIndexer then mkFunTy g (mkRefTupledTy g (pinfo.GetParamTypes(amap, m))) retTy else retTy let retTy, _ = PrettyTypes.PrettifyType g retTy let nameL = ConvertValLogicalNameToDisplayLayout false (tagProperty >> tagNavArbValRef pinfo.ArbitraryValRef >> wordL) pinfo.PropertyName + let getterAccess, setterAccess = + PrintTypes.layoutAccessibilityCore denv (Option.defaultValue taccessPublic pinfo.GetterAccessibility), + PrintTypes.layoutAccessibilityCore denv (Option.defaultValue taccessPublic pinfo.SetterAccessibility) let getterSetter = match pinfo.HasGetter, pinfo.HasSetter with | true, false -> - WordL.keywordWith ^^ WordL.keywordGet + WordL.keywordWith ^^ getterAccess ^^ WordL.keywordGet | false, true -> - WordL.keywordWith ^^ WordL.keywordSet + WordL.keywordWith ^^ setterAccess ^^ WordL.keywordSet | true, true -> - WordL.keywordWith ^^ wordL (tagText "get, set") + WordL.keywordWith ^^ getterAccess ^^ WordL.keywordGet ^^ RightL.comma ++ setterAccess ^^ WordL.keywordSet | false, false -> emptyL @@ -1816,28 +1819,30 @@ module TastDefinitionPrinting = let layoutPropInfo denv (infoReader: InfoReader) m (pinfo: PropInfo) : Layout list = let amap = infoReader.amap - - let isPublicGetterSetter (getter: MethInfo) (setter: MethInfo) = - let isPublicAccess access = access = TAccess [] - match getter.ArbitraryValRef, setter.ArbitraryValRef with - | Some gRef, Some sRef -> isPublicAccess gRef.Accessibility && isPublicAccess sRef.Accessibility - | _ -> false match pinfo.ArbitraryValRef with | Some vref -> - match pinfo with - | DifferentGetterAndSetter(getValRef, setValRef) -> - let getSuffix = if pinfo.IsIndexer then emptyL else WordL.keywordWith ^^ WordL.keywordGet - [ - PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader getValRef ^^ getSuffix - PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader setValRef - ] - | _ -> - let propL = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader vref - if pinfo.HasGetter && pinfo.HasSetter && not pinfo.IsIndexer && isPublicGetterSetter pinfo.GetterMethod pinfo.SetterMethod then - [ propL ^^ WordL.keywordWith ^^ wordL (tagText "get, set") ] - else - [ propL ] + let propL = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader (vref) + if pinfo.HasGetter && pinfo.HasSetter then + let getterAccess, setterAccess = + pinfo.GetterMethod.ArbitraryValRef |> Option.map _.Accessibility |> Option.defaultValue taccessPublic, + pinfo.SetterMethod.ArbitraryValRef |> Option.map _.Accessibility |> Option.defaultValue taccessPublic + let getSet = + WordL.keywordWith ^^ layoutAccessibilityCore denv getterAccess ^^ WordL.keywordGet ^^ RightL.comma --- layoutAccessibilityCore denv setterAccess ^^ WordL.keywordSet + let propL = + if pinfo.IsIndexer then + let rec replaceWithTo newLayout layout = + match layout with + | Node(Leaf (text = text), _, _) when text.Text = "with" -> newLayout + | Node(l, r, i) -> Node(l, replaceWithTo newLayout r, i) + | Attr(text, attr, l) -> Attr(text, attr, replaceWithTo newLayout l) + | Leaf _ + | ObjLeaf _ -> layout + replaceWithTo getSet propL + else propL --- getSet + [ propL ] + else + [ propL ] | None -> let modifierAndMember = diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index c90d49f3dcc..4f23a699db1 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -1769,6 +1769,30 @@ type PropInfo = | ProvidedProp(_, pi, m) -> pi.PUntaint((fun pi -> pi.CanWrite), m) #endif + + member x.GetterAccessibility = + match x with + | ILProp ilpinfo -> if ilpinfo.HasGetter then Some taccessPublic else None + + | FSProp(_, _, Some getter, _) -> Some getter.Accessibility + | FSProp _ -> None + +#if !NO_TYPEPROVIDERS + | ProvidedProp(_, pi, m) -> pi.PUntaint((fun pi -> if pi.CanWrite then Some taccessPublic else None), m) +#endif + + member x.SetterAccessibility = + match x with + | ILProp ilpinfo -> if ilpinfo.HasSetter then Some taccessPublic else None + + | FSProp(_, _, _, Some setter) -> Some setter.Accessibility + | FSProp _ -> None + +#if !NO_TYPEPROVIDERS + | ProvidedProp(_, pi, m) -> pi.PUntaint((fun pi -> if pi.CanWrite then Some taccessPublic else None), m) +#endif + + member x.IsSetterInitOnly = match x with | ILProp ilpinfo -> ilpinfo.IsSetterInitOnly diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index a2b178d92ac..68800a22eec 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -815,6 +815,10 @@ type PropInfo = /// Indicates if this property has an associated setter method. member HasSetter: bool + + member GetterAccessibility: Accessibility option + + member SetterAccessibility: Accessibility option /// Indidcates whether IL property has an init-only setter (i.e. has the `System.Runtime.CompilerServices.IsExternalInit` modifer) member IsSetterInitOnly: bool diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 19fbfe9306b..375962a2e9b 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -2382,21 +2382,39 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = | FSMeth(valRef = vref) -> NicePrint.stringValOrMember displayEnv cenv.infoReader vref | _ -> NicePrint.stringOfMethInfoFSharpStyle cenv.infoReader m displayEnv methInfo - let stringValOfPropInfo (p: PropInfo) = - match p with - | DifferentGetterAndSetter(getValRef, setValRef) -> - let g = NicePrint.stringValOrMember displayEnv cenv.infoReader getValRef - let s = NicePrint.stringValOrMember displayEnv cenv.infoReader setValRef - $"{g}\n{s}" - | _ -> - let t = p.GetPropertyType(cenv.amap, m ) |> NicePrint.layoutType displayEnv |> LayoutRender.showL - let withGetSet = - if p.HasGetter && p.HasSetter then "with get, set" - elif p.HasGetter then "with get" - elif p.HasSetter then "with set" - else "" - - $"member %s{p.DisplayName}: %s{t} %s{withGetSet}" + let stringValOfPropInfo (p: PropInfo) = + let layoutAccessibilityCore (denv: DisplayEnv) accessibility = + let isInternalCompPath x = + match x with + | CompPath(ILScopeRef.Local, _, []) -> true + | _ -> false + let (|Public|Internal|Private|) (TAccess p) = + match p with + | [] -> Public + | _ when List.forall isInternalCompPath p -> Internal + | _ -> Private + match denv.contextAccessibility, accessibility with + | Public, Internal -> "internal " + | Public, Private -> "private " + | Internal, Private -> "private " + | _ -> String.Empty + + let getterAccess, setterAccess = + layoutAccessibilityCore displayEnv (Option.defaultValue taccessPublic p.GetterAccessibility), + layoutAccessibilityCore displayEnv (Option.defaultValue taccessPublic p.SetterAccessibility) + let t = p.GetPropertyType(cenv.amap, m ) |> NicePrint.layoutType displayEnv |> LayoutRender.showL + let withGetSet = + match p.HasGetter, p.HasSetter with + | true, false -> + $"with %s{getterAccess}get" + | false, true -> + $"with %s{setterAccess}set" + | true, true -> + $"with %s{getterAccess}get, %s{setterAccess}set" + | false, false -> + String.Empty + + $"member %s{p.DisplayName}: %s{t} %s{withGetSet}" match d with | E _ -> None From 6d274747e0d32732a1668e575c4c67cb3e6e25d7 Mon Sep 17 00:00:00 2001 From: ijklam Date: Tue, 12 Mar 2024 17:48:21 +0800 Subject: [PATCH 23/43] fix --- src/Compiler/Checking/CheckExpressions.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 2796281317b..6b182010dc6 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -12511,15 +12511,15 @@ let TcAndPublishValSpec (cenv: cenv, env, containerInfo: ContainerInfo, declKind match memFlagsOpt with | Some ({MemberKind = SynMemberKind.PropertyGetSet as propKind}) -> let getterAccess, setterAccess = getGetterSetterAccess vis propKind g.langVersion - [getterAccess; setterAccess] + List.init valinfos.Length (fun i -> if i = 0 then getterAccess else setterAccess) | Some ({MemberKind = SynMemberKind.PropertyGet as propKind}) -> let getterAccess, _ = getGetterSetterAccess vis propKind g.langVersion - [getterAccess] + List.init valinfos.Length (fun _ -> getterAccess) | Some ({MemberKind = SynMemberKind.PropertySet as propKind}) -> let _, setterAccess = getGetterSetterAccess vis propKind g.langVersion - [setterAccess] + List.init valinfos.Length (fun _ -> setterAccess) | _ -> - [vis.SingleAccess()] + List.init valinfos.Length (fun _ -> vis.SingleAccess()) let valinfos = List.zip valinfos viss (tpenv, valinfos) ||> List.mapFold (fun tpenv (valSpecResult, vis) -> From 85f83c004087b418829f368c76de6dd67871a7a2 Mon Sep 17 00:00:00 2001 From: ijklam Date: Tue, 12 Mar 2024 19:13:11 +0800 Subject: [PATCH 24/43] format fix sig file generate --- src/Compiler/Checking/NicePrint.fs | 29 ++++++++++--------- src/Compiler/Checking/infos.fsi | 4 +-- src/Compiler/Service/ServiceNavigation.fs | 10 +++---- src/Compiler/SyntaxTree/SyntaxTree.fs | 14 ++++----- src/Compiler/SyntaxTree/SyntaxTree.fsi | 6 +++- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 18 +++++++----- src/Compiler/SyntaxTree/SyntaxTreeOps.fsi | 3 +- .../AutoPropsWithModifierBeforeGetSet.fs | 12 ++++++-- 8 files changed, 57 insertions(+), 39 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 7ad99c3c507..4c2f244a39d 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1339,12 +1339,11 @@ module PrintTastMemberOrVals = let prettyTyparInst, niceMethodTypars,tauL = prettyLayoutOfMemberType denv vref typarInst argInfos retTy let resL = if short then - if isNil argInfos then tauL - else tauL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet) + tauL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet) else let nameL = layoutMemberName denv vref niceMethodTypars argInfos tagProperty vref.DisplayNameCoreMangled false let nameL = if short then nameL else mkInlineL denv vref.Deref nameL - stat --- ((nameL |> addColonL) ^^ (if isNil argInfos then tauL else tauL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet))) + stat --- ((nameL |> addColonL) ^^ (tauL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet))) prettyTyparInst, resL | SynMemberKind.PropertySet -> @@ -1822,7 +1821,11 @@ module TastDefinitionPrinting = match pinfo.ArbitraryValRef with | Some vref -> - let propL = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader (vref) + let vref = + if pinfo.HasGetter then pinfo.GetterMethod.ArbitraryValRef |> Option.defaultValue vref + elif pinfo.HasSetter then pinfo.SetterMethod.ArbitraryValRef |> Option.defaultValue vref + else vref + let propL = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader vref if pinfo.HasGetter && pinfo.HasSetter then let getterAccess, setterAccess = pinfo.GetterMethod.ArbitraryValRef |> Option.map _.Accessibility |> Option.defaultValue taccessPublic, @@ -1830,16 +1833,14 @@ module TastDefinitionPrinting = let getSet = WordL.keywordWith ^^ layoutAccessibilityCore denv getterAccess ^^ WordL.keywordGet ^^ RightL.comma --- layoutAccessibilityCore denv setterAccess ^^ WordL.keywordSet let propL = - if pinfo.IsIndexer then - let rec replaceWithTo newLayout layout = - match layout with - | Node(Leaf (text = text), _, _) when text.Text = "with" -> newLayout - | Node(l, r, i) -> Node(l, replaceWithTo newLayout r, i) - | Attr(text, attr, l) -> Attr(text, attr, replaceWithTo newLayout l) - | Leaf _ - | ObjLeaf _ -> layout - replaceWithTo getSet propL - else propL --- getSet + let rec ``replace 'with'`` layout newLayout = + match layout with + | Node(Leaf (text = text), _, _) when text.Text = "with" -> newLayout + | Node(l, r, i) -> Node(l, ``replace 'with'`` r newLayout , i) + | Attr(text, attr, l) -> Attr(text, attr, ``replace 'with'`` l newLayout ) + | Leaf _ + | ObjLeaf _ -> layout + ``replace 'with'`` propL getSet [ propL ] else [ propL ] diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index 68800a22eec..4164648f888 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -815,9 +815,9 @@ type PropInfo = /// Indicates if this property has an associated setter method. member HasSetter: bool - + member GetterAccessibility: Accessibility option - + member SetterAccessibility: Accessibility option /// Indidcates whether IL property has an init-only setter (i.e. has the `System.Runtime.CompilerServices.IsExternalInit` modifer) diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index eb2b5152872..48f7d6dc01c 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -333,7 +333,7 @@ module NavigationImpl = createMember (rcid, NavigationItemKind.Field, FSharpGlyph.Field, range, enclosingEntityKind, false, access) ] | SynMemberDefn.AutoProperty(ident = id; accessibility = access; propKind = propKind) -> - let getterAccessibility,setterAccessibility = access.GetSetAccessNoCheck() + let getterAccessibility, setterAccessibility = access.GetSetAccessNoCheck() [ match propKind with @@ -572,16 +572,16 @@ module NavigationImpl = [ for memb in members do match memb with - | SynMemberSig.Member(memberSig = SynValSig.SynValSig(ident = SynIdent(id, _); accessibility = access; range = m); flags = {MemberKind = propKind}) -> - let getterAccessibility,setterAccessibility = access.GetSetAccessNoCheck() + | SynMemberSig.Member(memberSig = SynValSig.SynValSig(ident = SynIdent(id, _); accessibility = access; range = m); flags = { MemberKind = propKind }) -> + let getterAccessibility, setterAccessibility = access.GetSetAccessNoCheck() + match propKind with | SynMemberKind.PropertyGetSet -> yield createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Class, false, getterAccessibility) yield createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Class, false, setterAccessibility) | SynMemberKind.PropertySet -> yield createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Class, false, setterAccessibility) - | _ -> - yield createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Class, false, getterAccessibility) + | _ -> yield createMember (id, NavigationItemKind.Method, FSharpGlyph.Method, m, NavigationEntityKind.Class, false, getterAccessibility) | SynMemberSig.ValField(SynField(idOpt = Some rcid; fieldType = ty; accessibility = access), _) -> yield createMember (rcid, NavigationItemKind.Field, FSharpGlyph.Field, ty.Range, NavigationEntityKind.Class, false, access) | _ -> () diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 12a833abd0d..9ccb804bc77 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1312,19 +1312,19 @@ type SynComponentInfo = type SynValSigAccess = | Single of accessibility: SynAccess option | GetSet of accessibility: SynAccess option * getterAccessibility: SynAccess option * setterAccessibility: SynAccess option - - member this.SingleAccess () = + + member this.SingleAccess() = match this with | Single(access) | GetSet(accessibility = access) -> access - - member this.GetSetAccessNoCheck () = + + member this.GetSetAccessNoCheck() = match this with | SynValSigAccess.Single(access) -> access, access | SynValSigAccess.GetSet(access, getterAccess, setterAccess) -> - let getterAccess = getterAccess |> Option.orElse access - let setterAccess = setterAccess |> Option.orElse access - getterAccess, setterAccess + let getterAccess = getterAccess |> Option.orElse access + let setterAccess = setterAccess |> Option.orElse access + getterAccess, setterAccess [] type SynValSig = diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index a359a848613..a6ecb6ec624 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1481,7 +1481,11 @@ type SynComponentInfo = [] type SynValSigAccess = | Single of accessibility: SynAccess option - | GetSet of accessibility: SynAccess option * getterAccessibility: SynAccess option * setterAccessibility: SynAccess option + | GetSet of + accessibility: SynAccess option * + getterAccessibility: SynAccess option * + setterAccessibility: SynAccess option + member SingleAccess: unit -> SynAccess option member GetSetAccessNoCheck: unit -> SynAccess option * SynAccess option diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 2a8ba04167f..bb1167622da 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -1080,20 +1080,24 @@ let getGetterSetterAccess synValSigAccess memberKind (langVersion: Features.Lang match getterAccess, setterAccess with | None, None -> access, access | Some x, _ - | _, Some x -> - errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + | _, Some x -> + errorR (Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet (), x.Range)) None, None | None -> match getterAccess, setterAccess with | Some x, _ | _, Some x -> - checkLanguageFeatureAndRecover langVersion Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters x.Range + checkLanguageFeatureAndRecover + langVersion + Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters + x.Range + getterAccess, setterAccess | _, _ -> None, None | SynMemberKind.PropertySet -> match access, setterAccess with - | Some _, Some x -> - errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + | Some _, Some x -> + errorR (Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet (), x.Range)) None, None | _, None -> None, access | None, _ -> None, setterAccess @@ -1101,8 +1105,8 @@ let getGetterSetterAccess synValSigAccess memberKind (langVersion: Features.Lang | SynMemberKind.PropertyGet | _ -> match access, getterAccess with - | Some _, Some x -> - errorR(Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet(), x.Range)) + | Some _, Some x -> + errorR (Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet (), x.Range)) None, None | _, None -> access, None | None, _ -> getterAccess, None diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi index 51638c1bbd6..75131c7c09e 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi @@ -360,4 +360,5 @@ val (|TypesForTypar|): t: SynType -> SynType list [] val (|Get_OrSet_Ident|_|): Ident -> unit voption -val getGetterSetterAccess: SynValSigAccess -> SynMemberKind -> Features.LanguageVersion -> SynAccess option * SynAccess option +val getGetterSetterAccess: + SynValSigAccess -> SynMemberKind -> Features.LanguageVersion -> SynAccess option * SynAccess option diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index 960d7f2bd7e..a1173219595 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -158,6 +158,14 @@ type A = |> compile |> shouldFail |> withDiagnostics [ - (Error 0034, Line 7, Col 16, Line 7, Col 17, "Module 'Program' contains member private A.E: int with set but its signature specifies member A.E: int with set The accessibility specified in the signature is more than that specified in the implementation") - (Error 0034, Line 7, Col 16, Line 7, Col 17, "Module 'Program' contains member internal A.E: int but its signature specifies member A.E: int t The accessibility specified in the signature is more than that specified in the implementation") + (Error 0034, Line 7, Col 16, Line 7, Col 17, "Module 'Program' contains + member private A.E: int with set +but its signature specifies + member A.E: int with set +The accessibility specified in the signature is more than that specified in the implementation") + (Error 0034, Line 7, Col 16, Line 7, Col 17, "Module 'Program' contains + member internal A.E: int +but its signature specifies + member A.E: int with get +The accessibility specified in the signature is more than that specified in the implementation") ] From 5d2ae12f2bf92824404b897d2f001f53cb2d13fb Mon Sep 17 00:00:00 2001 From: ijklam Date: Thu, 14 Mar 2024 19:53:43 +0800 Subject: [PATCH 25/43] put tooling new feature under langFeature flag --- src/Compiler/Checking/NicePrint.fs | 89 ++++++++++++++++++++---------- src/Compiler/Checking/infos.fs | 16 ++++-- src/Compiler/Checking/infos.fsi | 2 + src/Compiler/Symbols/Symbols.fs | 84 +++++++++++++++++----------- 4 files changed, 124 insertions(+), 67 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 4c2f244a39d..043d3204772 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -492,7 +492,7 @@ module PrintTypes = | Const.Zero -> tagKeyword(if isRefTy g ty then "null" else "default") wordL str - let layoutAccessibilityCore (denv: DisplayEnv) accessibility = + let layoutAccessibilityCoreWithProtect (denv: DisplayEnv) isProtect accessibility = let isInternalCompPath x = match x with | CompPath(ILScopeRef.Local, _, []) -> true @@ -503,11 +503,15 @@ module PrintTypes = | _ when List.forall isInternalCompPath p -> Internal | _ -> Private match denv.contextAccessibility, accessibility with + | _ when isProtect -> wordL (tagKeyword "protect") | Public, Internal -> WordL.keywordInternal | Public, Private -> WordL.keywordPrivate | Internal, Private -> WordL.keywordPrivate | _ -> emptyL - + + let layoutAccessibilityCore (denv: DisplayEnv) accessibility = + layoutAccessibilityCoreWithProtect denv false accessibility + let layoutAccessibility (denv: DisplayEnv) accessibility itemL = layoutAccessibilityCore denv accessibility ++ itemL @@ -1322,14 +1326,19 @@ module PrintTastMemberOrVals = emptyTyparInst, stat | SynMemberKind.PropertyGet -> + let prefixAccessModifier, withGet = + if denv.g.langVersion.SupportsFeature Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters then + false, WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ wordL (tagText "get") + else + true, WordL.keywordWith ^^ wordL (tagText "get") if isNil argInfos then // use error recovery because intellisense on an incomplete file will show this errorR(Error(FSComp.SR.tastInvalidFormForPropertyGetter(), vref.Id.idRange)) - let nameL = layoutMemberName denv vref [] argInfos tagProperty vref.DisplayNameCoreMangled false + let nameL = layoutMemberName denv vref [] argInfos tagProperty vref.DisplayNameCoreMangled prefixAccessModifier let nameL = if short then nameL else mkInlineL denv vref.Deref nameL let resL = - if short then nameL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet) - else stat --- nameL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet) + if short then nameL --- withGet + else stat --- nameL --- withGet emptyTyparInst, resL else let argInfos = @@ -1339,20 +1348,25 @@ module PrintTastMemberOrVals = let prettyTyparInst, niceMethodTypars,tauL = prettyLayoutOfMemberType denv vref typarInst argInfos retTy let resL = if short then - tauL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet) + tauL --- withGet else - let nameL = layoutMemberName denv vref niceMethodTypars argInfos tagProperty vref.DisplayNameCoreMangled false + let nameL = layoutMemberName denv vref niceMethodTypars argInfos tagProperty vref.DisplayNameCoreMangled prefixAccessModifier let nameL = if short then nameL else mkInlineL denv vref.Deref nameL - stat --- ((nameL |> addColonL) ^^ (tauL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordGet))) + stat --- ((nameL |> addColonL) ^^ (tauL --- withGet)) prettyTyparInst, resL | SynMemberKind.PropertySet -> + let prefixAccessModifier, withSet = + if denv.g.langVersion.SupportsFeature Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters then + false, WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ wordL (tagText "set") + else + true, WordL.keywordWith ^^ wordL (tagText "set") if argInfos.Length <> 1 || isNil argInfos.Head then // use error recovery because intellisense on an incomplete file will show this errorR(Error(FSComp.SR.tastInvalidFormForPropertySetter(), vref.Id.idRange)) - let nameL = layoutMemberName denv vref [] argInfos tagProperty vref.DisplayNameCoreMangled false + let nameL = layoutMemberName denv vref [] argInfos tagProperty vref.DisplayNameCoreMangled prefixAccessModifier let nameL = if short then nameL else mkInlineL denv vref.Deref nameL - let resL = stat --- nameL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordSet) + let resL = stat --- nameL --- withSet emptyTyparInst, resL else let curriedArgInfos = argInfos @@ -1360,11 +1374,11 @@ module PrintTastMemberOrVals = let prettyTyparInst, niceMethodTypars, tauL = prettyLayoutOfMemberType denv vref typarInst (if isNil argInfos then [] else [argInfos]) (fst valueInfo) let resL = if short then - (tauL --- (WordL.keywordWith ^^ WordL.keywordSet)) + (tauL --- withSet) else - let nameL = layoutMemberName denv vref niceMethodTypars curriedArgInfos tagProperty vref.DisplayNameCoreMangled false + let nameL = layoutMemberName denv vref niceMethodTypars curriedArgInfos tagProperty vref.DisplayNameCoreMangled prefixAccessModifier let nameL = if short then nameL else mkInlineL denv vref.Deref nameL - stat --- ((nameL |> addColonL) ^^ (tauL --- (WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ WordL.keywordSet))) + stat --- ((nameL |> addColonL) ^^ (tauL --- withSet)) prettyTyparInst, resL prettyTyparInst, memberL @@ -1672,17 +1686,18 @@ module InfoMemberPrinting = let retTy = if pinfo.IsIndexer then mkFunTy g (mkRefTupledTy g (pinfo.GetParamTypes(amap, m))) retTy else retTy let retTy, _ = PrettyTypes.PrettifyType g retTy let nameL = ConvertValLogicalNameToDisplayLayout false (tagProperty >> tagNavArbValRef pinfo.ArbitraryValRef >> wordL) pinfo.PropertyName + let struct(isGetterProtect, isSetterProtect) = pinfo.IsProtectedAccessibility let getterAccess, setterAccess = - PrintTypes.layoutAccessibilityCore denv (Option.defaultValue taccessPublic pinfo.GetterAccessibility), - PrintTypes.layoutAccessibilityCore denv (Option.defaultValue taccessPublic pinfo.SetterAccessibility) + PrintTypes.layoutAccessibilityCoreWithProtect denv isGetterProtect (Option.defaultValue taccessPublic pinfo.GetterAccessibility), + PrintTypes.layoutAccessibilityCoreWithProtect denv isSetterProtect (Option.defaultValue taccessPublic pinfo.SetterAccessibility) let getterSetter = match pinfo.HasGetter, pinfo.HasSetter with | true, false -> - WordL.keywordWith ^^ getterAccess ^^ WordL.keywordGet + WordL.keywordWith ^^ getterAccess ^^ wordL (tagText "get") | false, true -> - WordL.keywordWith ^^ setterAccess ^^ WordL.keywordSet + WordL.keywordWith ^^ setterAccess ^^ wordL (tagText "set") | true, true -> - WordL.keywordWith ^^ getterAccess ^^ WordL.keywordGet ^^ RightL.comma ++ setterAccess ^^ WordL.keywordSet + WordL.keywordWith ^^ getterAccess ^^ wordL (tagText "get") ^^ RightL.comma ++ setterAccess ^^ wordL (tagText "set") | false, false -> emptyL @@ -1819,27 +1834,41 @@ module TastDefinitionPrinting = let layoutPropInfo denv (infoReader: InfoReader) m (pinfo: PropInfo) : Layout list = let amap = infoReader.amap + let rec ``replace 'with'`` layout newLayout = + match layout with + | Node(Leaf (text = text), _, _) when text.Text = "with" -> newLayout + | Node(l, r, i) -> Node(l, ``replace 'with'`` r newLayout , i) + | Attr(text, attr, l) -> Attr(text, attr, ``replace 'with'`` l newLayout ) + | Leaf _ + | ObjLeaf _ -> layout + + let supportAccessModifiersBeforeGetSet = + denv.g.langVersion.SupportsFeature Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters + match pinfo.ArbitraryValRef with + | Some vref when not supportAccessModifiersBeforeGetSet -> + match pinfo with + | DifferentGetterAndSetter(getValRef, setValRef) -> + [ + PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader getValRef + PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader setValRef + ] + | _ -> + let propL = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader vref + if pinfo.HasGetter && pinfo.HasSetter then + [ ``replace 'with'`` propL (WordL.keywordWith ^^ wordL (tagText "get, set")) ] + else + [ propL ] + | Some vref -> - let vref = - if pinfo.HasGetter then pinfo.GetterMethod.ArbitraryValRef |> Option.defaultValue vref - elif pinfo.HasSetter then pinfo.SetterMethod.ArbitraryValRef |> Option.defaultValue vref - else vref let propL = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader vref if pinfo.HasGetter && pinfo.HasSetter then let getterAccess, setterAccess = pinfo.GetterMethod.ArbitraryValRef |> Option.map _.Accessibility |> Option.defaultValue taccessPublic, pinfo.SetterMethod.ArbitraryValRef |> Option.map _.Accessibility |> Option.defaultValue taccessPublic let getSet = - WordL.keywordWith ^^ layoutAccessibilityCore denv getterAccess ^^ WordL.keywordGet ^^ RightL.comma --- layoutAccessibilityCore denv setterAccess ^^ WordL.keywordSet + WordL.keywordWith ^^ layoutAccessibilityCore denv getterAccess ^^ wordL (tagText "get") ^^ RightL.comma --- layoutAccessibilityCore denv setterAccess ^^ wordL (tagText "set") let propL = - let rec ``replace 'with'`` layout newLayout = - match layout with - | Node(Leaf (text = text), _, _) when text.Text = "with" -> newLayout - | Node(l, r, i) -> Node(l, ``replace 'with'`` r newLayout , i) - | Attr(text, attr, l) -> Attr(text, attr, ``replace 'with'`` l newLayout ) - | Leaf _ - | ObjLeaf _ -> layout ``replace 'with'`` propL getSet [ propL ] else diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 4f23a699db1..06d7b29df77 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -1769,10 +1769,10 @@ type PropInfo = | ProvidedProp(_, pi, m) -> pi.PUntaint((fun pi -> pi.CanWrite), m) #endif - member x.GetterAccessibility = match x with - | ILProp ilpinfo -> if ilpinfo.HasGetter then Some taccessPublic else None + | ILProp ilpinfo when ilpinfo.HasGetter -> Some taccessPublic + | ILProp _ -> None | FSProp(_, _, Some getter, _) -> Some getter.Accessibility | FSProp _ -> None @@ -1783,7 +1783,8 @@ type PropInfo = member x.SetterAccessibility = match x with - | ILProp ilpinfo -> if ilpinfo.HasSetter then Some taccessPublic else None + | ILProp ilpinfo when ilpinfo.HasSetter -> Some taccessPublic + | ILProp _ -> None | FSProp(_, _, _, Some setter) -> Some setter.Accessibility | FSProp _ -> None @@ -1792,7 +1793,14 @@ type PropInfo = | ProvidedProp(_, pi, m) -> pi.PUntaint((fun pi -> if pi.CanWrite then Some taccessPublic else None), m) #endif - + member x.IsProtectedAccessibility = + match x with + | ILProp ilpinfo when ilpinfo.HasGetter && ilpinfo.HasSetter -> + struct(ilpinfo.GetterMethod.IsProtectedAccessibility, ilpinfo.SetterMethod.IsProtectedAccessibility) + | ILProp ilpinfo when ilpinfo.HasGetter -> struct(ilpinfo.GetterMethod.IsProtectedAccessibility, false) + | ILProp ilpinfo when ilpinfo.HasSetter -> struct(false, ilpinfo.SetterMethod.IsProtectedAccessibility) + | _ -> struct(false, false) + member x.IsSetterInitOnly = match x with | ILProp ilpinfo -> ilpinfo.IsSetterInitOnly diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index 4164648f888..04dc77c0df0 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -820,6 +820,8 @@ type PropInfo = member SetterAccessibility: Accessibility option + member IsProtectedAccessibility: struct(bool * bool) + /// Indidcates whether IL property has an init-only setter (i.e. has the `System.Runtime.CompilerServices.IsExternalInit` modifer) member IsSetterInitOnly: bool diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 375962a2e9b..64f9b051b7a 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -2382,39 +2382,57 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = | FSMeth(valRef = vref) -> NicePrint.stringValOrMember displayEnv cenv.infoReader vref | _ -> NicePrint.stringOfMethInfoFSharpStyle cenv.infoReader m displayEnv methInfo - let stringValOfPropInfo (p: PropInfo) = - let layoutAccessibilityCore (denv: DisplayEnv) accessibility = - let isInternalCompPath x = - match x with - | CompPath(ILScopeRef.Local, _, []) -> true - | _ -> false - let (|Public|Internal|Private|) (TAccess p) = - match p with - | [] -> Public - | _ when List.forall isInternalCompPath p -> Internal - | _ -> Private - match denv.contextAccessibility, accessibility with - | Public, Internal -> "internal " - | Public, Private -> "private " - | Internal, Private -> "private " - | _ -> String.Empty - - let getterAccess, setterAccess = - layoutAccessibilityCore displayEnv (Option.defaultValue taccessPublic p.GetterAccessibility), - layoutAccessibilityCore displayEnv (Option.defaultValue taccessPublic p.SetterAccessibility) - let t = p.GetPropertyType(cenv.amap, m ) |> NicePrint.layoutType displayEnv |> LayoutRender.showL - let withGetSet = - match p.HasGetter, p.HasSetter with - | true, false -> - $"with %s{getterAccess}get" - | false, true -> - $"with %s{setterAccess}set" - | true, true -> - $"with %s{getterAccess}get, %s{setterAccess}set" - | false, false -> - String.Empty - - $"member %s{p.DisplayName}: %s{t} %s{withGetSet}" + let stringValOfPropInfo (p: PropInfo) = + let supportAccessModifiersBeforeGetSet = + cenv.g.langVersion.SupportsFeature Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters + if not supportAccessModifiersBeforeGetSet then + match p with + | DifferentGetterAndSetter(getValRef, setValRef) -> + let g = NicePrint.stringValOrMember displayEnv cenv.infoReader getValRef + let s = NicePrint.stringValOrMember displayEnv cenv.infoReader setValRef + $"{g}\n{s}" + | _ -> + let t = p.GetPropertyType(cenv.amap, m) |> NicePrint.layoutType displayEnv |> LayoutRender.showL + let withGetSet = + if p.HasGetter && p.HasSetter then "with get, set" + elif p.HasGetter then "with get" + elif p.HasSetter then "with set" + else "" + + $"member %s{p.DisplayName}: %s{t} %s{withGetSet}" + else + let layoutAccessibilityCore (denv: DisplayEnv) accessibility = + let isInternalCompPath x = + match x with + | CompPath(ILScopeRef.Local, _, []) -> true + | _ -> false + let (|Public|Internal|Private|) (TAccess p) = + match p with + | [] -> Public + | _ when List.forall isInternalCompPath p -> Internal + | _ -> Private + match denv.contextAccessibility, accessibility with + | Public, Internal -> "internal " + | Public, Private -> "private " + | Internal, Private -> "private " + | _ -> String.Empty + + let getterAccess, setterAccess = + layoutAccessibilityCore displayEnv (Option.defaultValue taccessPublic p.GetterAccessibility), + layoutAccessibilityCore displayEnv (Option.defaultValue taccessPublic p.SetterAccessibility) + let t = p.GetPropertyType(cenv.amap, m) |> NicePrint.layoutType displayEnv |> LayoutRender.showL + let withGetSet = + match p.HasGetter, p.HasSetter with + | true, false -> + $"with %s{getterAccess}get" + | false, true -> + $"with %s{setterAccess}set" + | true, true -> + $"with %s{getterAccess}get, %s{setterAccess}set" + | false, false -> + String.Empty + + $"member %s{p.DisplayName}: %s{t} %s{withGetSet}" match d with | E _ -> None From 39d045b281260c5ba8cecf7359e782090c1ae688 Mon Sep 17 00:00:00 2001 From: ijklam Date: Thu, 14 Mar 2024 19:59:52 +0800 Subject: [PATCH 26/43] format --- src/Compiler/Checking/infos.fsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index 04dc77c0df0..9df41d768e9 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -820,7 +820,7 @@ type PropInfo = member SetterAccessibility: Accessibility option - member IsProtectedAccessibility: struct(bool * bool) + member IsProtectedAccessibility: struct (bool * bool) /// Indidcates whether IL property has an init-only setter (i.e. has the `System.Runtime.CompilerServices.IsExternalInit` modifer) member IsSetterInitOnly: bool From bfde90ffa757f6b67b5f67f14e065a61a6572dc0 Mon Sep 17 00:00:00 2001 From: ijklam Date: Thu, 14 Mar 2024 20:04:44 +0800 Subject: [PATCH 27/43] fix typo --- src/Compiler/Checking/NicePrint.fs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 043d3204772..46e71426530 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -492,7 +492,7 @@ module PrintTypes = | Const.Zero -> tagKeyword(if isRefTy g ty then "null" else "default") wordL str - let layoutAccessibilityCoreWithProtect (denv: DisplayEnv) isProtect accessibility = + let layoutAccessibilityCoreWithProtected (denv: DisplayEnv) isProtected accessibility = let isInternalCompPath x = match x with | CompPath(ILScopeRef.Local, _, []) -> true @@ -503,14 +503,14 @@ module PrintTypes = | _ when List.forall isInternalCompPath p -> Internal | _ -> Private match denv.contextAccessibility, accessibility with - | _ when isProtect -> wordL (tagKeyword "protect") + | _ when isProtected -> wordL (tagKeyword "protected") | Public, Internal -> WordL.keywordInternal | Public, Private -> WordL.keywordPrivate | Internal, Private -> WordL.keywordPrivate | _ -> emptyL let layoutAccessibilityCore (denv: DisplayEnv) accessibility = - layoutAccessibilityCoreWithProtect denv false accessibility + layoutAccessibilityCoreWithProtected denv false accessibility let layoutAccessibility (denv: DisplayEnv) accessibility itemL = layoutAccessibilityCore denv accessibility ++ itemL @@ -1688,8 +1688,8 @@ module InfoMemberPrinting = let nameL = ConvertValLogicalNameToDisplayLayout false (tagProperty >> tagNavArbValRef pinfo.ArbitraryValRef >> wordL) pinfo.PropertyName let struct(isGetterProtect, isSetterProtect) = pinfo.IsProtectedAccessibility let getterAccess, setterAccess = - PrintTypes.layoutAccessibilityCoreWithProtect denv isGetterProtect (Option.defaultValue taccessPublic pinfo.GetterAccessibility), - PrintTypes.layoutAccessibilityCoreWithProtect denv isSetterProtect (Option.defaultValue taccessPublic pinfo.SetterAccessibility) + PrintTypes.layoutAccessibilityCoreWithProtected denv isGetterProtect (Option.defaultValue taccessPublic pinfo.GetterAccessibility), + PrintTypes.layoutAccessibilityCoreWithProtected denv isSetterProtect (Option.defaultValue taccessPublic pinfo.SetterAccessibility) let getterSetter = match pinfo.HasGetter, pinfo.HasSetter with | true, false -> From 4a2a75455df2c8e746ceef5dcf65316e5d09768c Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 7 Apr 2024 20:40:55 +0800 Subject: [PATCH 28/43] fix test; format --- src/Compiler/Checking/NicePrint.fs | 6 ++++-- src/Compiler/Facilities/LanguageFeatures.fs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 46e71426530..2cdf4307506 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1688,8 +1688,10 @@ module InfoMemberPrinting = let nameL = ConvertValLogicalNameToDisplayLayout false (tagProperty >> tagNavArbValRef pinfo.ArbitraryValRef >> wordL) pinfo.PropertyName let struct(isGetterProtect, isSetterProtect) = pinfo.IsProtectedAccessibility let getterAccess, setterAccess = - PrintTypes.layoutAccessibilityCoreWithProtected denv isGetterProtect (Option.defaultValue taccessPublic pinfo.GetterAccessibility), - PrintTypes.layoutAccessibilityCoreWithProtected denv isSetterProtect (Option.defaultValue taccessPublic pinfo.SetterAccessibility) + if denv.g.langVersion.SupportsFeature Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters then + PrintTypes.layoutAccessibilityCoreWithProtected denv isGetterProtect (Option.defaultValue taccessPublic pinfo.GetterAccessibility), + PrintTypes.layoutAccessibilityCoreWithProtected denv isSetterProtect (Option.defaultValue taccessPublic pinfo.SetterAccessibility) + else emptyL, emptyL let getterSetter = match pinfo.HasGetter, pinfo.HasSetter with | true, false -> diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index f7b99a8ac7d..d81ab03646b 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -353,6 +353,7 @@ type LanguageVersion(versionText) = | LanguageFeature.LowerIntegralRangesToFastLoops -> FSComp.SR.featureLowerIntegralRangesToFastLoops () | LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters -> FSComp.SR.featureAllowAccessModifiersToAutoPropertiesGettersAndSetters () + /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = match features.TryGetValue feature with From 14bfbadbaaa42d5ed9c0be46b6a8951e2e6d7159 Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 7 Apr 2024 21:29:25 +0800 Subject: [PATCH 29/43] fix test --- src/Compiler/Checking/NicePrint.fs | 38 +++++++++++-------- .../AutoPropsWithModifierBeforeGetSet.fs | 2 +- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 2cdf4307506..d5447596208 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1299,6 +1299,8 @@ module PrintTastMemberOrVals = for _,info in argInfo do info.Attribs <- [] info.Name <- None + let supportAccessModifiersBeforeGetSet = + denv.g.langVersion.SupportsFeature Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters let prettyTyparInst, memberL = match membInfo.MemberFlags.MemberKind with @@ -1327,7 +1329,7 @@ module PrintTastMemberOrVals = | SynMemberKind.PropertyGet -> let prefixAccessModifier, withGet = - if denv.g.langVersion.SupportsFeature Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters then + if supportAccessModifiersBeforeGetSet then false, WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ wordL (tagText "get") else true, WordL.keywordWith ^^ wordL (tagText "get") @@ -1352,12 +1354,12 @@ module PrintTastMemberOrVals = else let nameL = layoutMemberName denv vref niceMethodTypars argInfos tagProperty vref.DisplayNameCoreMangled prefixAccessModifier let nameL = if short then nameL else mkInlineL denv vref.Deref nameL - stat --- ((nameL |> addColonL) ^^ (tauL --- withGet)) + stat --- ((nameL |> addColonL) ^^ (if isNil argInfos && not supportAccessModifiersBeforeGetSet then tauL else tauL --- withGet)) prettyTyparInst, resL | SynMemberKind.PropertySet -> let prefixAccessModifier, withSet = - if denv.g.langVersion.SupportsFeature Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters then + if supportAccessModifiersBeforeGetSet then false, WordL.keywordWith ^^ layoutAccessibilityCore denv vref.Accessibility ^^ wordL (tagText "set") else true, WordL.keywordWith ^^ wordL (tagText "set") @@ -1835,14 +1837,6 @@ module TastDefinitionPrinting = let layoutPropInfo denv (infoReader: InfoReader) m (pinfo: PropInfo) : Layout list = let amap = infoReader.amap - - let rec ``replace 'with'`` layout newLayout = - match layout with - | Node(Leaf (text = text), _, _) when text.Text = "with" -> newLayout - | Node(l, r, i) -> Node(l, ``replace 'with'`` r newLayout , i) - | Attr(text, attr, l) -> Attr(text, attr, ``replace 'with'`` l newLayout ) - | Leaf _ - | ObjLeaf _ -> layout let supportAccessModifiersBeforeGetSet = denv.g.langVersion.SupportsFeature Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters @@ -1856,23 +1850,35 @@ module TastDefinitionPrinting = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader setValRef ] | _ -> + let isPublicGetterSetter (getter: MethInfo) (setter: MethInfo) = + let isPublicAccess access = access = TAccess [] + match getter.ArbitraryValRef, setter.ArbitraryValRef with + | Some gRef, Some sRef -> isPublicAccess gRef.Accessibility && isPublicAccess sRef.Accessibility + | _ -> false + let propL = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader vref - if pinfo.HasGetter && pinfo.HasSetter then - [ ``replace 'with'`` propL (WordL.keywordWith ^^ wordL (tagText "get, set")) ] + if pinfo.HasGetter && pinfo.HasSetter && not pinfo.IsIndexer && isPublicGetterSetter pinfo.GetterMethod pinfo.SetterMethod then + [ propL ^^ WordL.keywordWith ^^ wordL (tagText "get, set") ] else [ propL ] | Some vref -> let propL = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader vref if pinfo.HasGetter && pinfo.HasSetter then + let rec ``replace 'with'`` layout newLayout = + match layout with + | Node(Leaf (text = text), _, _) when text.Text = "with" -> newLayout + | Node(l, r, i) -> Node(l, ``replace 'with'`` r newLayout , i) + | Attr(text, attr, l) -> Attr(text, attr, ``replace 'with'`` l newLayout ) + | Leaf _ + | ObjLeaf _ -> layout + let getterAccess, setterAccess = pinfo.GetterMethod.ArbitraryValRef |> Option.map _.Accessibility |> Option.defaultValue taccessPublic, pinfo.SetterMethod.ArbitraryValRef |> Option.map _.Accessibility |> Option.defaultValue taccessPublic let getSet = WordL.keywordWith ^^ layoutAccessibilityCore denv getterAccess ^^ wordL (tagText "get") ^^ RightL.comma --- layoutAccessibilityCore denv setterAccess ^^ wordL (tagText "set") - let propL = - ``replace 'with'`` propL getSet - [ propL ] + [ ``replace 'with'`` propL getSet ] else [ propL ] | None -> diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index a1173219595..f96c561b3de 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -159,7 +159,7 @@ type A = |> shouldFail |> withDiagnostics [ (Error 0034, Line 7, Col 16, Line 7, Col 17, "Module 'Program' contains - member private A.E: int with set + member A.E: int with private set but its signature specifies member A.E: int with set The accessibility specified in the signature is more than that specified in the implementation") From dd957eec5ddb87d64ca4a415e3c021662f5a7d1e Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 7 Apr 2024 22:18:34 +0800 Subject: [PATCH 30/43] fix test --- src/Compiler/Checking/NicePrint.fs | 3 ++- .../MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index d5447596208..764110bd167 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1845,8 +1845,9 @@ module TastDefinitionPrinting = | Some vref when not supportAccessModifiersBeforeGetSet -> match pinfo with | DifferentGetterAndSetter(getValRef, setValRef) -> + let getSuffix = if pinfo.IsIndexer then emptyL else WordL.keywordWith ^^ WordL.keywordGet [ - PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader getValRef + PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader getValRef ^^ getSuffix PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader setValRef ] | _ -> diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index f96c561b3de..affe34719c3 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -164,7 +164,7 @@ but its signature specifies member A.E: int with set The accessibility specified in the signature is more than that specified in the implementation") (Error 0034, Line 7, Col 16, Line 7, Col 17, "Module 'Program' contains - member internal A.E: int + member A.E: int internal get but its signature specifies member A.E: int with get The accessibility specified in the signature is more than that specified in the implementation") From fd2caaa5571e5e48ad1fd5ab1fb1cde495d710bc Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 7 Apr 2024 22:33:28 +0800 Subject: [PATCH 31/43] add test --- .../property_access_modifiers.fsx | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/FSharp.Compiler.ComponentTests/Signatures/TestCasesForGenerationRoundTrip/property_access_modifiers.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/TestCasesForGenerationRoundTrip/property_access_modifiers.fsx b/tests/FSharp.Compiler.ComponentTests/Signatures/TestCasesForGenerationRoundTrip/property_access_modifiers.fsx new file mode 100644 index 00000000000..3da3294648b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/TestCasesForGenerationRoundTrip/property_access_modifiers.fsx @@ -0,0 +1,49 @@ +type A() = + static member StaticProperty1 with get() = 0 and set (_: int) = () + static member StaticProperty_public2 with public get() = 0 and set (_: int) = () + static member StaticProperty_public3 with get() = 0 and public set (_: int) = () + static member StaticProperty_public4 with public get() = 0 and public set (_: int) = () + static member StaticProperty_internal2 with internal get() = 0 and set (_: int) = () + static member StaticProperty_internal3 with get() = 0 and internal set (_: int) = () + static member StaticProperty_internal4 with internal get() = 0 and internal set (_: int) = () + static member StaticProperty_private2 with private get() = 0 and set (_: int) = () + static member StaticProperty_private3 with internal get() = 0 and private set (_: int) = () + static member StaticProperty_private4 with private get() = 0 and private set (_: int) = () + + member _.InstanceProperty1 with get() = 0 and set (_: int) = () + member _.InstanceProperty_public2 with public get() = 0 and set (_: int) = () + member _.InstanceProperty_public3 with get() = 0 and public set (_: int) = () + member _.InstanceProperty_public4 with public get() = 0 and public set (_: int) = () + member _.InstanceProperty_internal2 with internal get() = 0 and set (_: int) = () + member _.InstanceProperty_internal3 with get() = 0 and internal set (_: int) = () + member _.InstanceProperty_internal4 with internal get() = 0 and internal set (_: int) = () + member _.InstanceProperty_private2 with private get() = 0 and set (_: int) = () + member _.InstanceProperty_private3 with internal get() = 0 and private set (_: int) = () + member _.InstanceProperty_private4 with private get() = 0 and private set (_: int) = () + + static member StaticIndexer1 with get (_: int) = 0 and set (_: int) (_: int) = () + static member StaticIndexer_public2 with public get (_: int) = 0 and set (_: int) (_: int) = () + static member StaticIndexer_public3 with get (_: int) = 0 and public set (_: int) (_: int) = () + static member StaticIndexer_public4 with public get (_: int) = 0 and public set (_: int) (_: int) = () + static member StaticIndexer_internal2 with internal get (_: int) = 0 and set (_: int) (_: int) = () + static member StaticIndexer_internal3 with get (_: int) = 0 and internal set (_: int) (_: int) = () + static member StaticIndexer_internal4 with internal get (_: int) = 0 and internal set (_: int) (_: int) = () + static member StaticIndexer_private2 with private get (_: int) = 0 and set (_: int) (_: int) = () + static member StaticIndexer_private3 with internal get (_: int) = 0 and private set (_: int) (_: int) = () + static member StaticIndexer_private4 with private get (_: int) = 0 and private set (_: int) (_: int) = () + + member _.InstanceIndexer1 with get (_: int) = 0 and set (_: int) (_: int) = () + member _.InstanceIndexer_public2 with public get (_: int) = 0 and set (_: int) (_: int) = () + member _.InstanceIndexer_public3 with get (_: int) = 0 and public set (_: int) (_: int) = () + member _.InstanceIndexer_public4 with public get (_: int) = 0 and public set (_: int) (_: int) = () + member _.InstanceIndexer_internal2 with internal get (_: int) = 0 and set (_: int) (_: int) = () + member _.InstanceIndexer_internal3 with get (_: int) = 0 and internal set (_: int) (_: int) = () + member _.InstanceIndexer_internal4 with internal get (_: int) = 0 and internal set (_: int) (_: int) = () + member _.InstanceIndexer_private2 with private get (_: int) = 0 and set (_: int) (_: int) = () + member _.InstanceIndexer_private3 with internal get (_: int) = 0 and private set (_: int) (_: int) = () + member _.InstanceIndexer_private4 with private get (_: int) = 0 and private set (_: int) (_: int) = () + + abstract member AbstractProperty: int with get, set + default this.AbstractProperty with get () = 0 and set (_: int) = () + abstract member AbstractIndexer: int -> int with get, set + default this.AbstractIndexer with get (_: int) = 0 and set (_: int) (_: int) = () From 316a9ea4cae484fe4fd5013617d6b1b28bfeb184 Mon Sep 17 00:00:00 2001 From: ijklam Date: Sun, 7 Apr 2024 23:06:02 +0800 Subject: [PATCH 32/43] typo --- .../MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index affe34719c3..b687139a1c5 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -164,7 +164,7 @@ but its signature specifies member A.E: int with set The accessibility specified in the signature is more than that specified in the implementation") (Error 0034, Line 7, Col 16, Line 7, Col 17, "Module 'Program' contains - member A.E: int internal get + member A.E: int with internal get but its signature specifies member A.E: int with get The accessibility specified in the signature is more than that specified in the implementation") From f027ffe6a52905ea26e5638a60dcb30559f03162 Mon Sep 17 00:00:00 2001 From: ijklam Date: Mon, 8 Apr 2024 11:31:14 +0800 Subject: [PATCH 33/43] update baseline --- ...vice.SurfaceArea.netstandard20.release.bsl | 40 ++++++++++++++----- ...ckCommentInSourceCodeSignatureFile.fsi.bsl | 14 +++---- ...ommentAfterSourceCodeSignatureFile.fsi.bsl | 14 +++---- .../CommentOnSingleLineSignatureFile.fsi.bsl | 14 +++---- ...reNotReportedAsTriviaSignatureFile.fsi.bsl | 4 +- ...reNotReportedAsTriviaSignatureFile.fsi.bsl | 3 +- .../NestedIfElseEndifSignatureFile.fsi.bsl | 4 +- ...ithComplexExpressionsSignatureFile.fsi.bsl | 4 +- .../SingleIfElseEndifSignatureFile.fsi.bsl | 4 +- .../SingleIfEndifSignatureFile.fsi.bsl | 4 +- .../Expression/SynExprObjWithSetter.fs.bsl | 2 +- .../LeadingKeyword/AbstractKeyword.fs.bsl | 2 +- .../AbstractMemberKeyword.fs.bsl | 2 +- .../LeadingKeyword/DefaultKeyword.fsi.bsl | 2 +- .../LeadingKeyword/DefaultValKeyword.fs.bsl | 4 +- .../LeadingKeyword/MemberValKeyword.fs.bsl | 4 +- .../LeadingKeyword/OverrideValKeyword.fs.bsl | 4 +- .../StaticAbstractKeyword.fs.bsl | 2 +- .../StaticAbstractMemberKeyword.fs.bsl | 2 +- .../StaticMemberValKeyword.fs.bsl | 4 +- .../Member/Abstract - Property 01.fs.bsl | 2 +- .../Member/Abstract - Property 02.fs.bsl | 2 +- .../Member/Abstract - Property 03.fs.bsl | 2 +- .../Member/Abstract - Property 04.fs.bsl | 2 +- .../Member/Abstract - Property 05.fs.bsl | 4 +- .../SyntaxTree/Member/Auto property 01.fs.bsl | 4 +- .../SyntaxTree/Member/Auto property 02.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 03.fs.bsl | 6 +-- .../SyntaxTree/Member/Auto property 04.fs.bsl | 6 +-- .../SyntaxTree/Member/Auto property 05.fs.bsl | 6 +-- .../SyntaxTree/Member/Auto property 06.fs.bsl | 4 +- .../SyntaxTree/Member/Auto property 07.fs.bsl | 4 +- .../SyntaxTree/Member/Auto property 08.fs.bsl | 4 +- .../SyntaxTree/Member/Auto property 09.fs.bsl | 4 +- .../SyntaxTree/Member/Auto property 10.fs.bsl | 4 +- .../SyntaxTree/Member/Auto property 11.fs.bsl | 4 +- .../SyntaxTree/Member/Auto property 12.fs.bsl | 4 +- .../SyntaxTree/Member/Auto property 13.fs.bsl | 4 +- .../SyntaxTree/Member/Auto property 14.fs.bsl | 5 ++- .../SyntaxTree/Member/Auto property 15.fs.bsl | 6 ++- .../data/SyntaxTree/Member/Inherit 07.fsi.bsl | 2 +- .../Member/SignatureMemberWithGet.fsi.bsl | 2 +- .../Member/SignatureMemberWithSet.fsi.bsl | 2 +- .../Member/SignatureMemberWithSetget.fsi.bsl | 2 +- ...lotContainsTheRangeOfTheWithKeyword.fs.bsl | 2 +- ...ertyContainsTheRangeOfTheEqualsSign.fs.bsl | 2 +- ...rtyContainsTheRangeOfTheWithKeyword.fs.bsl | 4 +- ...erDefnAbstractSlotHasCorrectKeyword.fs.bsl | 4 +- ...erDefnAutoPropertyHasCorrectKeyword.fs.bsl | 16 ++++---- ...nMemberSigMemberHasCorrectKeywords.fsi.bsl | 12 +++--- .../SyntaxTree/ModuleMember/Val 01.fsi.bsl | 11 ++--- ...leRangeShouldStartAtFirstAttribute.fsi.bsl | 11 ++--- .../ModuleShouldContainModuleKeyword.fsi.bsl | 11 ++--- .../Namespace - Keyword 01.fsi.bsl | 10 ++--- .../Nested module 01.fsi.bsl | 24 ++++++----- ...leteNestedModuleSigShouldBePresent.fsi.bsl | 11 ++--- .../NestedModuleWithBeginEndAndDecls.fsi.bsl | 10 ++--- ...udedInSynModuleSigDeclNestedModule.fsi.bsl | 10 ++--- ...alSignShouldBePresentSignatureFile.fsi.bsl | 16 ++++---- ...ShouldEndAtTheLastSynModuleSigDecl.fsi.bsl | 18 ++++----- .../OperatorNameInSynValSig.fsi.bsl | 11 ++--- .../OperatorNameInValConstraint.fsi.bsl | 13 +++--- ...alsTokenIsPresentInSynValSigMember.fsi.bsl | 2 +- ...ualsTokenIsPresentInSynValSigValue.fsi.bsl | 4 +- ...ldContainsTheRangeOfTheWithKeyword.fsi.bsl | 2 +- ...uldBeIncludedInSynValSpfnAndMember.fsi.bsl | 2 +- ...esShouldBeIncludedInRecursiveTypes.fsi.bsl | 2 +- ...ionSigAndSynModuleSigDeclException.fsi.bsl | 2 +- ...fnSigDelegateOfShouldStartFromName.fsi.bsl | 2 +- ...igObjectModelShouldEndAtLastMember.fsi.bsl | 2 +- ...DefnSigRecordShouldEndAtLastMember.fsi.bsl | 2 +- ...ldContainsTheRangeOfTheWithKeyword.fsi.bsl | 2 +- ...ateContainsTheRangeOfTheEqualsSign.fsi.bsl | 2 +- .../SynValSigContainsParameterNames.fsi.bsl | 11 ++--- .../TriviaIsPresentInSynTypeDefnSig.fsi.bsl | 4 +- .../ValKeywordIsPresentInSynValSig.fsi.bsl | 11 ++--- .../SyntaxTree/SignatureType/With 01.fsi.bsl | 2 +- .../SynType/Constraint intersection 03.fs.bsl | 2 +- ...stedSynTypeOrInsideSynExprTraitCall.fs.bsl | 2 +- ...SingleSynTypeInsideSynExprTraitCall.fs.bsl | 5 ++- .../SynTypeOrInsideSynExprTraitCall.fs.bsl | 2 +- ...eConstraintWhereTyparSupportsMember.fs.bsl | 2 +- ...TypeOrWithAppTypeOnTheRightHandSide.fs.bsl | 2 +- ...sIncludeLeadingParameterAttributes.fsi.bsl | 2 +- ...pleDoesIncludeLeadingParameterName.fsi.bsl | 2 +- ...butesInOptionalNamedMemberParameter.fs.bsl | 2 +- .../data/SyntaxTree/Type/Interface 03.fs.bsl | 2 +- .../data/SyntaxTree/Type/Interface 04.fs.bsl | 2 +- .../data/SyntaxTree/Type/Interface 07.fs.bsl | 2 +- .../Type/NamedParametersInDelegateType.fs.bsl | 2 +- ...gateContainsTheRangeOfTheEqualsSign.fs.bsl | 2 +- .../data/SyntaxTree/Val/InlineKeyword.fsi.bsl | 14 +++---- 92 files changed, 274 insertions(+), 239 deletions(-) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index 427d2f51103..ad7847de1d7 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -7739,6 +7739,8 @@ FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMem FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags memberFlagsForSet FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberKind get_propKind() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberKind propKind +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynValSigAccess accessibility +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynValSigAccess get_accessibility() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia get_trivia() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia trivia FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Text.Range get_range() @@ -7747,12 +7749,6 @@ FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Xml.PreXmlDoc FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Xml.PreXmlDoc xmlDoc FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] get_attributes() -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] accessibility -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_accessibility() -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_getterAccessibility() -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_setterAccessibility() -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] getterAccessibility -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] setterAccessibility FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType] get_typeOpt() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType] typeOpt FSharp.Compiler.Syntax.SynMemberDefn+GetSetMember: FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia get_trivia() @@ -7862,7 +7858,7 @@ FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsNestedType() FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsOpen() FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsValField() FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAbstractSlot(FSharp.Compiler.Syntax.SynValSig, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnAbstractSlotTrivia) -FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAutoProperty(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia) +FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAutoProperty(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Syntax.SynValSigAccess, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewGetSetMember(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitCtor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynPat, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitInherit(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range) @@ -9481,7 +9477,9 @@ FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.Syntax.SynValInfo SynInfo FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.Syntax.SynValInfo arity FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.Syntax.SynValInfo get_SynInfo() FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.Syntax.SynValInfo get_arity() -FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.Syntax.SynValSig NewSynValSig(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynIdent, FSharp.Compiler.Syntax.SynValTyparDecls, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynValInfo, Boolean, Boolean, FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynValSigTrivia) +FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.Syntax.SynValSig NewSynValSig(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynIdent, FSharp.Compiler.Syntax.SynValTyparDecls, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynValInfo, Boolean, Boolean, FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Syntax.SynValSigAccess, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynValSigTrivia) +FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.Syntax.SynValSigAccess accessibility +FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.Syntax.SynValSigAccess get_accessibility() FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.Syntax.SynValTyparDecls explicitTypeParams FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.Syntax.SynValTyparDecls get_explicitTypeParams() FSharp.Compiler.Syntax.SynValSig: FSharp.Compiler.SyntaxTrivia.SynValSigTrivia get_trivia() @@ -9496,11 +9494,33 @@ FSharp.Compiler.Syntax.SynValSig: Int32 Tag FSharp.Compiler.Syntax.SynValSig: Int32 get_Tag() FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] get_attributes() -FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] accessibility -FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_accessibility() FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] get_synExpr() FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] synExpr FSharp.Compiler.Syntax.SynValSig: System.String ToString() +FSharp.Compiler.Syntax.SynValSigAccess+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] accessibility +FSharp.Compiler.Syntax.SynValSigAccess+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_accessibility() +FSharp.Compiler.Syntax.SynValSigAccess+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_getterAccessibility() +FSharp.Compiler.Syntax.SynValSigAccess+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_setterAccessibility() +FSharp.Compiler.Syntax.SynValSigAccess+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] getterAccessibility +FSharp.Compiler.Syntax.SynValSigAccess+GetSet: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] setterAccessibility +FSharp.Compiler.Syntax.SynValSigAccess+Single: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] accessibility +FSharp.Compiler.Syntax.SynValSigAccess+Single: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_accessibility() +FSharp.Compiler.Syntax.SynValSigAccess+Tags: Int32 GetSet +FSharp.Compiler.Syntax.SynValSigAccess+Tags: Int32 Single +FSharp.Compiler.Syntax.SynValSigAccess: Boolean IsGetSet +FSharp.Compiler.Syntax.SynValSigAccess: Boolean IsSingle +FSharp.Compiler.Syntax.SynValSigAccess: Boolean get_IsGetSet() +FSharp.Compiler.Syntax.SynValSigAccess: Boolean get_IsSingle() +FSharp.Compiler.Syntax.SynValSigAccess: FSharp.Compiler.Syntax.SynValSigAccess NewGetSet(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess]) +FSharp.Compiler.Syntax.SynValSigAccess: FSharp.Compiler.Syntax.SynValSigAccess NewSingle(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess]) +FSharp.Compiler.Syntax.SynValSigAccess: FSharp.Compiler.Syntax.SynValSigAccess+GetSet +FSharp.Compiler.Syntax.SynValSigAccess: FSharp.Compiler.Syntax.SynValSigAccess+Single +FSharp.Compiler.Syntax.SynValSigAccess: FSharp.Compiler.Syntax.SynValSigAccess+Tags +FSharp.Compiler.Syntax.SynValSigAccess: Int32 Tag +FSharp.Compiler.Syntax.SynValSigAccess: Int32 get_Tag() +FSharp.Compiler.Syntax.SynValSigAccess: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] SingleAccess() +FSharp.Compiler.Syntax.SynValSigAccess: System.String ToString() +FSharp.Compiler.Syntax.SynValSigAccess: System.Tuple`2[Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess],Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess]] GetSetAccessNoCheck() FSharp.Compiler.Syntax.SynValTyparDecls: Boolean canInfer FSharp.Compiler.Syntax.SynValTyparDecls: Boolean get_canInfer() FSharp.Compiler.Syntax.SynValTyparDecls: FSharp.Compiler.Syntax.SynValTyparDecls NewSynValTyparDecls(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynTyparDecls], Boolean) diff --git a/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCodeSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCodeSignatureFile.fsi.bsl index 8c34100f9c3..977d7b388de 100644 --- a/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCodeSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCodeSignatureFile.fsi.bsl @@ -9,12 +9,12 @@ SigFile ([], SynIdent (a, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (4,0--4,19), { LeadingKeyword = Val (4,0--4,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (4,0--4,19))], - PreXmlDocEmpty, [], None, (2,0--4,19), - { LeadingKeyword = Namespace (2,0--2,9) })], + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (4,0--4,19), + { LeadingKeyword = Val (4,0--4,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (4,0--4,19))], PreXmlDocEmpty, [], + None, (2,0--4,19), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] CodeComments = [BlockComment (4,6--4,13)] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCodeSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCodeSignatureFile.fsi.bsl index f5113a692c9..7b8fc685e00 100644 --- a/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCodeSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCodeSignatureFile.fsi.bsl @@ -9,12 +9,12 @@ SigFile ([], SynIdent (foo, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (4,0--4,13), { LeadingKeyword = Val (4,0--4,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (4,0--4,13))], - PreXmlDocEmpty, [], None, (2,0--4,13), - { LeadingKeyword = Namespace (2,0--2,9) })], + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (4,0--4,13), + { LeadingKeyword = Val (4,0--4,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (4,0--4,13))], PreXmlDocEmpty, [], + None, (2,0--4,13), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] CodeComments = [LineComment (4,14--4,25)] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLineSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLineSignatureFile.fsi.bsl index c46b2288597..5dd445b4d00 100644 --- a/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLineSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLineSignatureFile.fsi.bsl @@ -9,12 +9,12 @@ SigFile ([], SynIdent (a, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (4,0--4,10), { LeadingKeyword = Val (4,0--4,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (4,0--4,10))], - PreXmlDocEmpty, [], None, (2,0--4,10), - { LeadingKeyword = Namespace (2,0--2,9) })], + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (4,0--4,10), + { LeadingKeyword = Val (4,0--4,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (4,0--4,10))], PreXmlDocEmpty, [], + None, (2,0--4,10), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] CodeComments = [LineComment (3,0--3,11)] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile.fsi.bsl index 1a134f725a6..bb8a2a87d75 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile.fsi.bsl @@ -10,8 +10,8 @@ SigFile ([], SynIdent (v, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - Some (Const (Int32 42, (10,4--10,6))), (4,0--10,6), + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, Some (Const (Int32 42, (10,4--10,6))), (4,0--10,6), { LeadingKeyword = Val (4,0--4,3) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile.fsi.bsl index bc7e09384dc..3a151928254 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile.fsi.bsl @@ -10,7 +10,8 @@ SigFile ([], SynIdent (v, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([string], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, Some (Const (String diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndifSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndifSignatureFile.fsi.bsl index 92a493fa495..c1293f6c9c9 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndifSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndifSignatureFile.fsi.bsl @@ -9,8 +9,8 @@ SigFile ([], SynIdent (v, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - Some (Const (Int32 3, (12,8--12,9))), (4,0--12,9), + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, Some (Const (Int32 3, (12,8--12,9))), (4,0--12,9), { LeadingKeyword = Val (4,0--4,3) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressionsSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressionsSignatureFile.fsi.bsl index f9d1bda1da0..9f0375afada 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressionsSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressionsSignatureFile.fsi.bsl @@ -10,8 +10,8 @@ SigFile ([], SynIdent (v, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - Some (Const (Int32 10, (12,4--12,6))), (4,0--12,6), + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, Some (Const (Int32 10, (12,4--12,6))), (4,0--12,6), { LeadingKeyword = Val (4,0--4,3) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndifSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndifSignatureFile.fsi.bsl index c2e8d309225..4164c59cd03 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndifSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndifSignatureFile.fsi.bsl @@ -9,8 +9,8 @@ SigFile ([], SynIdent (v, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - Some (Const (Int32 42, (8,4--8,6))), (4,0--8,6), + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, Some (Const (Int32 42, (8,4--8,6))), (4,0--8,6), { LeadingKeyword = Val (4,0--4,3) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndifSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndifSignatureFile.fsi.bsl index eeb1f369f16..ea0a6308762 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndifSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndifSignatureFile.fsi.bsl @@ -9,8 +9,8 @@ SigFile ([], SynIdent (v, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - Some (Const (Int32 42, (8,4--8,6))), (4,0--8,6), + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, Some (Const (Int32 42, (8,4--8,6))), (4,0--8,6), { LeadingKeyword = Val (4,0--4,3) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl index 8e4beda60ed..405f967b350 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl @@ -31,7 +31,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,54), + Single None, None, (4,4--4,54), { LeadingKeyword = Abstract (4,4--4,12) InlineKeyword = None WithKeyword = Some (4,46--4,50) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl index ddaab66cc68..9c4b593e133 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl @@ -20,7 +20,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,4--3,20), + Single None, None, (3,4--3,20), { LeadingKeyword = Abstract (3,4--3,12) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl index c1b55980388..0cbd9b3a434 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl @@ -20,7 +20,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,4--3,27), + Single None, None, (3,4--3,27), { LeadingKeyword = AbstractMember ((3,4--3,12), (3,13--3,19)) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl index ad55bf28350..ba9b7296835 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl @@ -20,7 +20,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,4--5,19), + Single None, None, (5,4--5,19), { LeadingKeyword = Default (5,4--5,11) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl index aae0b57cb0c..2c243f2ca9d 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl @@ -28,8 +28,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (3,26--3,27)), - (3,4--3,27), + GetSet (None, None, None), + Const (Int32 1, (3,26--3,27)), (3,4--3,27), { LeadingKeyword = DefaultVal ((3,4--3,11), (3,12--3,15)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl index a5a5c94bbf8..63618be45b7 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl @@ -28,8 +28,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (3,25--3,26)), - (3,4--3,26), + GetSet (None, None, None), + Const (Int32 1, (3,25--3,26)), (3,4--3,26), { LeadingKeyword = MemberVal ((3,4--3,10), (3,11--3,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl index de95a8f3bbb..3fff6cb5b0d 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl @@ -28,8 +28,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (3,27--3,28)), - (3,4--3,28), + GetSet (None, None, None), + Const (Int32 1, (3,27--3,28)), (3,4--3,28), { LeadingKeyword = OverrideVal ((3,4--3,12), (3,13--3,16)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl index 9c3c44b7405..92d3182daea 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl @@ -24,7 +24,7 @@ ImplFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,4--3,34), + Single None, None, (3,4--3,34), { LeadingKeyword = StaticAbstract ((3,4--3,10), (3,11--3,19)) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl index 956ce98bf64..8b2dc3b5c8f 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl @@ -24,7 +24,7 @@ ImplFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,4--3,41), + Single None, None, (3,4--3,41), { LeadingKeyword = StaticAbstractMember ((3,4--3,10), (3,11--3,19), (3,20--3,26)) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl index 2ac6f5d2c39..1ce7e21fea2 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl @@ -28,8 +28,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (3,32--3,33)), - (3,4--3,33), + GetSet (None, None, None), + Const (Int32 1, (3,32--3,33)), (3,4--3,33), { LeadingKeyword = StaticMemberVal ((3,4--3,10), (3,11--3,17), (3,18--3,21)) diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl index 31c0a27e211..9ec3b5452d7 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl @@ -20,7 +20,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,19), + Single None, None, (4,4--4,19), { LeadingKeyword = Abstract (4,4--4,12) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl index b136527eb6b..95ced08879b 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl @@ -20,7 +20,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,33), + Single None, None, (4,4--4,33), { LeadingKeyword = Abstract (4,4--4,12) InlineKeyword = None WithKeyword = Some (4,20--4,24) diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl index 436805d13e8..d9393dc8da0 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl @@ -20,7 +20,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,28), + Single None, None, (4,4--4,28), { LeadingKeyword = Abstract (4,4--4,12) InlineKeyword = None WithKeyword = Some (4,20--4,24) diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl index c735d8780e8..f315032ac6c 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl @@ -20,7 +20,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,19), + Single None, None, (4,4--4,19), { LeadingKeyword = Abstract (4,4--4,12) InlineKeyword = None WithKeyword = Some (4,20--4,24) diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl index ab66b9f2cff..e8092cae4f6 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl @@ -20,7 +20,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,20), + Single None, None, (4,4--4,20), { LeadingKeyword = Abstract (4,4--4,12) InlineKeyword = None WithKeyword = Some (4,21--4,25) @@ -40,7 +40,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,4--5,20), + Single None, None, (5,4--5,20), { LeadingKeyword = Abstract (5,4--5,12) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl index 4576c205a95..211a0fed943 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl @@ -27,8 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (4,20--4,21)), - (4,4--4,21), + GetSet (None, None, None), + Const (Int32 1, (4,20--4,21)), (4,4--4,21), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl index b8736fd23e2..31f825ba1af 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl @@ -27,7 +27,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, + GetSet (None, None, None), ArbitraryAfterError ("typedSequentialExprBlock1", (4,19--4,19)), (4,4--4,19), diff --git a/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl index c489efc4380..fced13abaa4 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl @@ -27,7 +27,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, + GetSet (None, None, None), ArbitraryAfterError ("typedSequentialExprBlock1", (4,19--4,19)), (4,4--4,19), @@ -51,8 +51,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 2, (5,20--5,21)), - (5,4--5,21), + GetSet (None, None, None), + Const (Int32 2, (5,20--5,21)), (5,4--5,21), { LeadingKeyword = MemberVal ((5,4--5,10), (5,11--5,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl index f9c511bfc5e..19e8d589688 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl @@ -27,7 +27,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, + GetSet (None, None, None), ArbitraryAfterError ("autoProp2", (4,17--4,17)), (4,4--4,17), { LeadingKeyword = @@ -50,8 +50,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 2, (5,20--5,21)), - (5,4--5,21), + GetSet (None, None, None), + Const (Int32 2, (5,20--5,21)), (5,4--5,21), { LeadingKeyword = MemberVal ((5,4--5,10), (5,11--5,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl index 541adf1f681..ca97d03b523 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl @@ -27,7 +27,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, + GetSet (None, None, None), ArbitraryAfterError ("autoProp3", (4,14--4,14)), (4,4--4,14), { LeadingKeyword = @@ -50,8 +50,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 2, (5,20--5,21)), - (5,4--5,21), + GetSet (None, None, None), + Const (Int32 2, (5,20--5,21)), (5,4--5,21), { LeadingKeyword = MemberVal ((5,4--5,10), (5,11--5,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl index 0a7d12909ea..6a60db20a73 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl @@ -27,8 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (4,20--4,21)), - (4,4--4,21), + GetSet (None, None, None), + Const (Int32 1, (4,20--4,21)), (4,4--4,21), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl index 84e7a69d193..8e6436d4eb4 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl @@ -32,8 +32,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 7, (4,24--4,25)), - (4,4--4,38), + GetSet (None, None, None), + Const (Int32 7, (4,24--4,25)), (4,4--4,38), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,26--4,30) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl index 982030b64d2..b4d9c9da2c4 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl @@ -27,8 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (4,19--4,20)), - (4,4--4,29), + GetSet (None, None, None), + Const (Int32 1, (4,19--4,20)), (4,4--4,29), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,21--4,25) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl index f4d9b9aa777..5599ff4faa3 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl @@ -27,8 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (4,20--4,21)), - (4,4--4,30), + GetSet (None, None, None), + Const (Int32 1, (4,20--4,21)), (4,4--4,30), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,22--4,26) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl index aeaf553b54c..0a94591f95a 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl @@ -27,8 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (4,19--4,20)), - (4,4--4,29), + GetSet (None, None, None), + Const (Int32 1, (4,19--4,20)), (4,4--4,29), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,21--4,25) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl index b0235cf362a..f6f1fb9e52b 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl @@ -27,8 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (4,19--4,20)), - (4,4--4,29), + GetSet (None, None, None), + Const (Int32 1, (4,19--4,20)), (4,4--4,29), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,21--4,25) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl index 79d41c4f5a0..da5a5eb7b72 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl @@ -27,8 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (4,19--4,20)), - (4,4--4,20), + GetSet (None, None, None), + Const (Int32 1, (4,19--4,20)), (4,4--4,20), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,21--4,25) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl index a4515894463..b28a6d273bb 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl @@ -27,8 +27,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (4,19--4,20)), - (4,4--4,20), + GetSet (None, None, None), + Const (Int32 1, (4,19--4,20)), (4,4--4,20), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = Some (4,21--4,25) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl index 2235a327002..d9725daa923 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl @@ -32,8 +32,9 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Some (Public (4,31--4,37)), - Some (Private (4,43--4,50)), + GetSet + (None, Some (Public (4,31--4,37)), + Some (Private (4,43--4,50))), Const (Int32 7, (4,24--4,25)), (4,4--4,54), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl index 457b112dc31..417da42ef8a 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl @@ -32,8 +32,10 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - Some (Internal (4,15--4,23)), - Some (Public (4,40--4,46)), Some (Private (4,52--4,59)), + GetSet + (Some (Internal (4,15--4,23)), + Some (Public (4,40--4,46)), + Some (Private (4,52--4,59))), Const (Int32 7, (4,33--4,34)), (4,4--4,63), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) diff --git a/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl b/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl index 434435dd0b8..7dc4657766f 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl @@ -20,7 +20,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (6,4--6,17), + Single None, None, (6,4--6,17), { LeadingKeyword = Member (6,4--6,10) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl index 83768766964..a516a7766cf 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl @@ -19,7 +19,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (6,4--8,35), + Single None, None, (6,4--8,35), { LeadingKeyword = Member (6,4--6,10) InlineKeyword = None WithKeyword = Some (7,20--7,24) diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl index f2a745b5f3d..038b502e256 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl @@ -19,7 +19,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (6,4--8,31), + Single None, None, (6,4--8,31), { LeadingKeyword = Member (6,4--6,10) InlineKeyword = None WithKeyword = Some (7,20--7,24) diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl index db84482f638..acb516b9113 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl @@ -20,7 +20,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (6,4--8,39), + Single None, None, (6,4--8,39), { LeadingKeyword = Member (6,4--6,10) InlineKeyword = None WithKeyword = Some (7,20--7,24) diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl index f3b24278efa..4158e55ca3f 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl @@ -27,7 +27,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,4--3,42), + Single None, None, (3,4--3,42), { LeadingKeyword = AbstractMember ((3,4--3,12), (3,13--3,19)) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl index 9ebebcbddf1..06e0765a03b 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl @@ -51,7 +51,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Ident name, (4,4--5,40), + GetSet (None, None, None), Ident name, (4,4--5,40), { LeadingKeyword = MemberVal ((5,4--5,10), (5,11--5,14)) WithKeyword = Some (5,27--5,31) diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl index c5a3db03d4d..95b26eac8a3 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl @@ -34,7 +34,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Ident autoProp, (3,4--3,52), + GetSet (None, None, None), Ident autoProp, (3,4--3,52), { LeadingKeyword = MemberVal ((3,4--3,10), (3,11--3,14)) WithKeyword = Some (3,39--3,43) @@ -56,7 +56,7 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Ident autoProp, (4,4--4,39), + GetSet (None, None, None), Ident autoProp, (4,4--4,39), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl index 378b47ad948..23d12756c3e 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl @@ -20,7 +20,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,4--3,20), + Single None, None, (3,4--3,20), { LeadingKeyword = Abstract (3,4--3,12) InlineKeyword = None WithKeyword = None @@ -40,7 +40,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,26), + Single None, None, (4,4--4,26), { LeadingKeyword = AbstractMember ((4,4--4,12), (4,13--4,19)) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl index 67858fd3916..76d6b9ac1b5 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl @@ -28,8 +28,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (3,32--3,33)), - (3,4--3,33), + GetSet (None, None, None), + Const (Int32 1, (3,32--3,33)), (3,4--3,33), { LeadingKeyword = StaticMemberVal ((3,4--3,10), (3,11--3,17), (3,18--3,21)) @@ -52,8 +52,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (4,25--4,26)), - (4,4--4,26), + GetSet (None, None, None), + Const (Int32 1, (4,25--4,26)), (4,4--4,26), { LeadingKeyword = MemberVal ((4,4--4,10), (4,11--4,14)) WithKeyword = None @@ -75,8 +75,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 2, (5,27--5,28)), - (5,4--5,28), + GetSet (None, None, None), + Const (Int32 2, (5,27--5,28)), (5,4--5,28), { LeadingKeyword = OverrideVal ((5,4--5,12), (5,13--5,16)) WithKeyword = None @@ -98,8 +98,8 @@ ImplFile GetterOrSetterIsCompilerGenerated = false MemberKind = PropertySet }, PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, None, Const (Int32 1, (6,26--6,27)), - (6,4--6,27), + GetSet (None, None, None), + Const (Int32 1, (6,26--6,27)), (6,4--6,27), { LeadingKeyword = DefaultVal ((6,4--6,11), (6,12--6,15)) WithKeyword = None diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl index 30cf09416b8..878187410bc 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl @@ -20,7 +20,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,4--5,20), + Single None, None, (5,4--5,20), { LeadingKeyword = Abstract (5,4--5,12) InlineKeyword = None WithKeyword = None @@ -40,7 +40,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (6,4--6,30), + Single None, None, (6,4--6,30), { LeadingKeyword = AbstractMember ((6,4--6,12), (6,13--6,19)) InlineKeyword = None @@ -61,7 +61,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (7,4--7,28), + Single None, None, (7,4--7,28), { LeadingKeyword = StaticMember ((7,4--7,10), (7,11--7,17)) InlineKeyword = None @@ -82,7 +82,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((8,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (8,4--8,18), + Single None, None, (8,4--8,18), { LeadingKeyword = Member (8,4--8,10) InlineKeyword = None WithKeyword = None @@ -102,7 +102,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((9,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (9,4--9,20), + Single None, None, (9,4--9,20), { LeadingKeyword = Override (9,4--9,12) InlineKeyword = None WithKeyword = None @@ -122,7 +122,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((10,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (10,4--10,19), + Single None, None, (10,4--10,19), { LeadingKeyword = Default (10,4--10,11) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/ModuleMember/Val 01.fsi.bsl b/tests/service/data/SyntaxTree/ModuleMember/Val 01.fsi.bsl index 1f89ce1c17a..33a28bec72c 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Val 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Val 01.fsi.bsl @@ -17,11 +17,12 @@ SigFile SynValInfo ([[SynArgInfo ([], false, None); SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (3,0--3,20), { LeadingKeyword = Val (3,0--3,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (3,0--3,20))], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (3,0--3,20), + { LeadingKeyword = Val (3,0--3,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (3,0--3,20))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,20), { LeadingKeyword = Module (1,0--1,6) })], { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleRangeShouldStartAtFirstAttribute.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleRangeShouldStartAtFirstAttribute.fsi.bsl index 892bcf3d4b5..833995c7304 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleRangeShouldStartAtFirstAttribute.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleRangeShouldStartAtFirstAttribute.fsi.bsl @@ -9,11 +9,12 @@ SigFile ([], SynIdent (s, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([string], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (5,0--5,14), { LeadingKeyword = Val (5,0--5,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (5,0--5,14))], + PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (5,0--5,14), + { LeadingKeyword = Val (5,0--5,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (5,0--5,14))], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [{ Attributes = [{ TypeName = SynLongIdent ([Foo], [], [None]) ArgExpr = Const (Unit, (2,4--2,7)) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleShouldContainModuleKeyword.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleShouldContainModuleKeyword.fsi.bsl index 6871016694a..9c4dbafc6cd 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleShouldContainModuleKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleShouldContainModuleKeyword.fsi.bsl @@ -9,11 +9,12 @@ SigFile ([], SynIdent (a, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (4,0--4,10), { LeadingKeyword = Val (4,0--4,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (4,0--4,10))], + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (4,0--4,10), + { LeadingKeyword = Val (4,0--4,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (4,0--4,10))], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--4,10), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl index 572fc320cb0..a2d8deea5fe 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl @@ -15,11 +15,11 @@ SigFile LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,14), { LeadingKeyword = Val (4,4--4,7) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), - (4,4--4,14))], (3,0--4,14), + Single None, None, (4,4--4,14), + { LeadingKeyword = Val (4,4--4,7) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (4,4--4,14))], (3,0--4,14), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,11--3,12) })], PreXmlDocEmpty, [], None, (1,0--4,14), { LeadingKeyword = Namespace (1,0--1,9) })], diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl index d9ab53d2628..2ca7d9b108a 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl @@ -15,22 +15,24 @@ SigFile LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,14), { LeadingKeyword = Val (4,4--4,7) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), - (4,4--4,14))], (3,0--4,14), { ModuleKeyword = Some (3,0--3,6) - EqualsRange = Some (3,9--3,10) }); + Single None, None, (4,4--4,14), + { LeadingKeyword = Val (4,4--4,7) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (4,4--4,14))], (3,0--4,14), + { ModuleKeyword = Some (3,0--3,6) + EqualsRange = Some (3,9--3,10) }); Val (SynValSig ([], SynIdent (b, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (6,0--6,10), { LeadingKeyword = Val (6,0--6,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (6,0--6,10))], + PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (6,0--6,10), + { LeadingKeyword = Val (6,0--6,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (6,0--6,10))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,10), { LeadingKeyword = Module (1,0--1,6) })], { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl index 9c697d753d9..d9d1e49ae74 100644 --- a/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl @@ -16,11 +16,12 @@ SigFile ([], SynIdent (a, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([unit], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (5,0--5,11), { LeadingKeyword = Val (5,0--5,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (5,0--5,11))], + PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (5,0--5,11), + { LeadingKeyword = Val (5,0--5,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (5,0--5,11))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,11), { LeadingKeyword = Module (1,0--1,6) })], { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl index 63876c52c8d..878125cde66 100644 --- a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl @@ -15,11 +15,11 @@ SigFile LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,8--5,18), { LeadingKeyword = Val (5,8--5,11) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), - (5,8--5,18)); + Single None, None, (5,8--5,18), + { LeadingKeyword = Val (5,8--5,11) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (5,8--5,18)); Types ([SynTypeDefnSig (SynComponentInfo diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl index 2fbd636ab28..2d2eb425be6 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl @@ -21,11 +21,11 @@ SigFile LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (6,4--6,15), { LeadingKeyword = Val (6,4--6,7) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), - (6,4--6,15))], (4,0--6,15), + Single None, None, (6,4--6,15), + { LeadingKeyword = Val (6,4--6,7) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (6,4--6,15))], (4,0--6,15), { ModuleKeyword = Some (5,0--5,6) EqualsRange = Some (5,14--5,15) })], PreXmlDocEmpty, [], None, (2,0--6,15), { LeadingKeyword = Namespace (2,0--2,9) })], diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl index 0343ec9ea71..d9575b21a86 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl @@ -15,13 +15,13 @@ SigFile LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,4--5,17), { LeadingKeyword = Val (5,4--5,7) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), - (5,4--5,17))], (4,0--5,17), { ModuleKeyword = Some (4,0--4,6) - EqualsRange = Some (4,9--4,10) })], - PreXmlDocEmpty, [], None, (2,0--5,17), - { LeadingKeyword = Namespace (2,0--2,9) })], + Single None, None, (5,4--5,17), + { LeadingKeyword = Val (5,4--5,7) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (5,4--5,17))], (4,0--5,17), + { ModuleKeyword = Some (4,0--4,6) + EqualsRange = Some (4,9--4,10) })], PreXmlDocEmpty, [], None, + (2,0--5,17), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl index b52c329f8c9..d1d8882f2a0 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl @@ -125,7 +125,7 @@ SigFile SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((17,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (17,8--17,61), + Single None, None, (17,8--17,61), { LeadingKeyword = New (17,8--17,11) InlineKeyword = None WithKeyword = None @@ -145,7 +145,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((18,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (18,8--18,35), + Single None, None, (18,8--18,35), { LeadingKeyword = Member (18,8--18,14) InlineKeyword = None WithKeyword = Some (18,27--18,31) @@ -165,7 +165,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((19,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (19,8--19,35), + Single None, None, (19,8--19,35), { LeadingKeyword = Member (19,8--19,14) InlineKeyword = None WithKeyword = Some (19,27--19,31) @@ -185,7 +185,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((20,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (20,8--20,35), + Single None, None, (20,8--20,35), { LeadingKeyword = Member (20,8--20,14) InlineKeyword = None WithKeyword = Some (20,27--20,31) @@ -205,7 +205,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((21,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (21,8--21,35), + Single None, None, (21,8--21,35), { LeadingKeyword = Member (21,8--21,14) InlineKeyword = None WithKeyword = Some (21,27--21,31) @@ -429,7 +429,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((51,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (50,8--52,28), + Single None, None, (50,8--52,28), { LeadingKeyword = Member (52,8--52,14) InlineKeyword = None WithKeyword = None @@ -463,7 +463,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((54,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (53,8--55,28), + Single None, None, (53,8--55,28), { LeadingKeyword = Member (55,8--55,14) InlineKeyword = None WithKeyword = None @@ -496,7 +496,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((57,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (56,8--58,26), + Single None, None, (56,8--58,26), { LeadingKeyword = Member (58,8--58,14) InlineKeyword = None WithKeyword = None @@ -529,7 +529,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((60,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (59,8--61,26), + Single None, None, (59,8--61,26), { LeadingKeyword = Member (61,8--61,14) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/OperatorName/OperatorNameInSynValSig.fsi.bsl b/tests/service/data/SyntaxTree/OperatorName/OperatorNameInSynValSig.fsi.bsl index 02c9a0c7194..b90adbf927e 100644 --- a/tests/service/data/SyntaxTree/OperatorName/OperatorNameInSynValSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/OperatorNameInSynValSig.fsi.bsl @@ -29,11 +29,12 @@ SigFile ([[SynArgInfo ([], false, Some e1)]; [SynArgInfo ([], false, Some e2)]], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (3,0--3,37), { LeadingKeyword = Val (3,0--3,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (3,0--3,37))], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (3,0--3,37), + { LeadingKeyword = Val (3,0--3,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (3,0--3,37))], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--3,37), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/OperatorName/OperatorNameInValConstraint.fsi.bsl b/tests/service/data/SyntaxTree/OperatorName/OperatorNameInValConstraint.fsi.bsl index 9fc5a83a0d6..d31043ea99c 100644 --- a/tests/service/data/SyntaxTree/OperatorName/OperatorNameInValConstraint.fsi.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/OperatorNameInValConstraint.fsi.bsl @@ -44,7 +44,7 @@ SigFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((12,43), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (12,43--12,73), + Single None, None, (12,43--12,73), { LeadingKeyword = StaticMember ((12,43--12,49), (12,50--12,56)) InlineKeyword = None @@ -64,11 +64,12 @@ SigFile SynValInfo ([[SynArgInfo ([], false, Some n)]], SynArgInfo ([], false, None)), true, false, - PreXmlDoc ((12,4), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (4,4--12,94), { LeadingKeyword = Val (12,4--12,7) - InlineKeyword = Some (12,8--12,14) - WithKeyword = None - EqualsRange = None }), (4,4--12,94))], + PreXmlDoc ((12,4), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (4,4--12,94), + { LeadingKeyword = Val (12,4--12,7) + InlineKeyword = Some (12,8--12,14) + WithKeyword = None + EqualsRange = None }), (4,4--12,94))], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [{ Attributes = [{ TypeName = SynLongIdent ([AutoOpen], [], [None]) ArgExpr = Const (Unit, (2,2--2,10)) diff --git a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl index 8cc11fd0aa8..ab9078c270c 100644 --- a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl @@ -20,7 +20,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Some (Const (Int32 10, (5,21--5,23))), + Single None, Some (Const (Int32 10, (5,21--5,23))), (5,4--5,23), { LeadingKeyword = Member (5,4--5,10) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigValue.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigValue.fsi.bsl index 59a3941fcf8..c63121096fa 100644 --- a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigValue.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigValue.fsi.bsl @@ -9,8 +9,8 @@ SigFile ([], SynIdent (a, None), SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - Some (Const (Int32 9, (4,14--4,15))), (4,0--4,15), + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, Some (Const (Int32 9, (4,14--4,15))), (4,0--4,15), { LeadingKeyword = Val (4,0--4,3) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl index 32b9b945708..493d3b104ad 100644 --- a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl @@ -22,7 +22,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,4--5,42), + Single None, None, (5,4--5,42), { LeadingKeyword = AbstractMember ((5,4--5,12), (5,13--5,19)) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl index f33e7aff10b..920c9e5a472 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl @@ -27,7 +27,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,4--6,20), + Single None, None, (5,4--6,20), { LeadingKeyword = Abstract (6,4--6,12) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl index bf3950ebf3c..9788067cd7c 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl @@ -56,7 +56,7 @@ SigFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((12,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (12,8--12,42), + Single None, None, (12,8--12,42), { LeadingKeyword = Override (12,8--12,16) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfMembersShouldBeIncludedInSynExceptionSigAndSynModuleSigDeclException.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfMembersShouldBeIncludedInSynExceptionSigAndSynModuleSigDeclException.fsi.bsl index 8a7477a0400..7025f3aadc2 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfMembersShouldBeIncludedInSynExceptionSigAndSynModuleSigDeclException.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfMembersShouldBeIncludedInSynExceptionSigAndSynModuleSigDeclException.fsi.bsl @@ -38,7 +38,7 @@ SigFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,4--5,30), + Single None, None, (5,4--5,30), { LeadingKeyword = Member (5,4--5,10) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl index c108329122d..0dcb3eb2e73 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl @@ -31,7 +31,7 @@ SigFile SynValInfo ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, - PreXmlDocEmpty, None, None, (4,4--4,29), + PreXmlDocEmpty, Single None, None, (4,4--4,29), { LeadingKeyword = Synthetic InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl index 606ac16584e..4ed17f26304 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl @@ -24,7 +24,7 @@ SigFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (6,4--6,30), + Single None, None, (6,4--6,30), { LeadingKeyword = Member (6,4--6,10) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl index d0fe920321f..553c900522d 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl @@ -33,7 +33,7 @@ SigFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,4--5,30), + Single None, None, (5,4--5,30), { LeadingKeyword = Member (5,4--5,10) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/SynExceptionSigShouldContainsTheRangeOfTheWithKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynExceptionSigShouldContainsTheRangeOfTheWithKeyword.fsi.bsl index cca175bb158..ef541678686 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynExceptionSigShouldContainsTheRangeOfTheWithKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynExceptionSigShouldContainsTheRangeOfTheWithKeyword.fsi.bsl @@ -25,7 +25,7 @@ SigFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,4--5,29), + Single None, None, (5,4--5,29), { LeadingKeyword = Member (5,4--5,10) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl index f14e2162303..25b5feb9ae6 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -32,7 +32,7 @@ SigFile SynValInfo ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, - PreXmlDocEmpty, None, None, (4,9--4,37), + PreXmlDocEmpty, Single None, None, (4,9--4,37), { LeadingKeyword = Synthetic InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/SynValSigContainsParameterNames.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynValSigContainsParameterNames.fsi.bsl index f9188e9c481..edb06fea795 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynValSigContainsParameterNames.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynValSigContainsParameterNames.fsi.bsl @@ -58,11 +58,12 @@ SigFile SynArgInfo ([], false, Some origRhsExpr)]; [SynArgInfo ([], false, Some x)]], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (3,0--6,23), { LeadingKeyword = Val (3,0--3,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (3,0--6,23))], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (3,0--6,23), + { LeadingKeyword = Val (3,0--3,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (3,0--6,23))], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--6,23), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl index 7d966890f27..53962cae2b9 100644 --- a/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl @@ -20,7 +20,7 @@ SigFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, Some (Const (Int32 10, (5,21--5,23))), + Single None, Some (Const (Int32 10, (5,21--5,23))), (5,4--5,23), { LeadingKeyword = Member (5,4--5,10) InlineKeyword = None WithKeyword = None @@ -66,7 +66,7 @@ SigFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((15,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (15,4--15,32), + Single None, None, (15,4--15,32), { LeadingKeyword = StaticMember ((15,4--15,10), (15,11--15,17)) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/SignatureType/ValKeywordIsPresentInSynValSig.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/ValKeywordIsPresentInSynValSig.fsi.bsl index fb5865e0b04..599315bef28 100644 --- a/tests/service/data/SyntaxTree/SignatureType/ValKeywordIsPresentInSynValSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/ValKeywordIsPresentInSynValSig.fsi.bsl @@ -15,11 +15,12 @@ SigFile SynValTyparDecls (None, true), LongIdent (SynLongIdent ([int], [], [None])), SynValInfo ([], SynArgInfo ([], false, None)), false, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (4,0--6,11), { LeadingKeyword = Val (6,0--6,3) - InlineKeyword = None - WithKeyword = None - EqualsRange = None }), (4,0--6,11))], + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (4,0--6,11), + { LeadingKeyword = Val (6,0--6,3) + InlineKeyword = None + WithKeyword = None + EqualsRange = None }), (4,0--6,11))], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--6,11), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl index 07be5d42776..f6ef4571fd9 100644 --- a/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl @@ -21,7 +21,7 @@ SigFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,28), + Single None, None, (4,4--4,28), { LeadingKeyword = Member (4,4--4,10) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl index ada151dacf1..f28ed328e25 100644 --- a/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl @@ -44,7 +44,7 @@ ImplFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,53), + Single None, None, (4,4--4,53), { LeadingKeyword = Abstract (4,4--4,12) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SynType/NestedSynTypeOrInsideSynExprTraitCall.fs.bsl b/tests/service/data/SyntaxTree/SynType/NestedSynTypeOrInsideSynExprTraitCall.fs.bsl index 7782c254288..1c58087b0d8 100644 --- a/tests/service/data/SyntaxTree/SynType/NestedSynTypeOrInsideSynExprTraitCall.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/NestedSynTypeOrInsideSynExprTraitCall.fs.bsl @@ -81,7 +81,7 @@ ImplFile SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((2,56), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (2,56--2,96), + Single None, None, (2,56--2,96), { LeadingKeyword = StaticMember ((2,56--2,62), (2,63--2,69)) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl b/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl index 9ed3e51aa43..5c1cd55a5bf 100644 --- a/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl @@ -85,7 +85,8 @@ ImplFile ([], false, None)), false, false, PreXmlDoc ((3,55), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,55--3,91), + Single None, None, + (3,55--3,91), { LeadingKeyword = StaticMember ((3,55--3,61), @@ -158,7 +159,7 @@ ImplFile SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,15), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,15--4,51), + Single None, None, (4,15--4,51), { LeadingKeyword = StaticMember ((4,15--4,21), (4,22--4,28)) diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynExprTraitCall.fs.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynExprTraitCall.fs.bsl index 370e07d5746..24fb731523f 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynExprTraitCall.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynExprTraitCall.fs.bsl @@ -58,7 +58,7 @@ ImplFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((2,45), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (2,45--2,80), + Single None, None, (2,45--2,80), { LeadingKeyword = StaticMember ((2,45--2,51), (2,52--2,58)) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember.fs.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember.fs.bsl index 5b687420cb8..c2de9ccff5c 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember.fs.bsl @@ -55,7 +55,7 @@ ImplFile SynArgInfo ([], false, None)), false, false, PreXmlDoc ((2,56), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (2,56--2,94), + Single None, None, (2,56--2,94), { LeadingKeyword = StaticMember ((2,56--2,62), (2,63--2,69)) diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeOrWithAppTypeOnTheRightHandSide.fs.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeOrWithAppTypeOnTheRightHandSide.fs.bsl index 0ee54488a53..f509494f211 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeOrWithAppTypeOnTheRightHandSide.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeOrWithAppTypeOnTheRightHandSide.fs.bsl @@ -40,7 +40,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((2,39), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (2,39--2,59), + Single None, None, (2,39--2,59), { LeadingKeyword = StaticMember ((2,39--2,45), (2,46--2,52)) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl index f3d59669f94..6d0202252ea 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl @@ -75,7 +75,7 @@ SigFile Range = (3,36--3,54) }], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,4--3,63), + Single None, None, (3,4--3,63), { LeadingKeyword = Member (3,4--3,10) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl index 2b3ede584bc..662002f0c87 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl @@ -38,7 +38,7 @@ SigFile SynArgInfo ([], false, Some p2)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,4--3,34), + Single None, None, (3,4--3,34), { LeadingKeyword = Member (3,4--3,10) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl b/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl index 1905684969e..6ed7fe97af5 100644 --- a/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl @@ -54,7 +54,7 @@ ImplFile Range = (3,23--3,35) }], true, Some a)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,4--3,46), + Single None, None, (3,4--3,46), { LeadingKeyword = AbstractMember ((3,4--3,12), (3,13--3,19)) InlineKeyword = None diff --git a/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl index b93004493d6..beaa9fae234 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl @@ -19,7 +19,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,8), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,8--5,23), + Single None, None, (5,8--5,23), { LeadingKeyword = Abstract (5,8--5,16) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl index 1a6d2a60721..3c5776cc025 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl @@ -19,7 +19,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (4,4--4,19), + Single None, None, (4,4--4,19), { LeadingKeyword = Abstract (4,4--4,12) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl index 2030a97bf39..7776c39507b 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl @@ -21,7 +21,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (5,4--5,19), + Single None, None, (5,4--5,19), { LeadingKeyword = Abstract (5,4--5,12) InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl b/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl index 2ea13523d2b..daea0ab5026 100644 --- a/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl @@ -70,7 +70,7 @@ ImplFile SynArgInfo ([], false, Some b)]; [SynArgInfo ([], false, Some c)]], SynArgInfo ([], false, None)), false, false, - PreXmlDocEmpty, None, None, (2,11--2,46), + PreXmlDocEmpty, Single None, None, (2,11--2,46), { LeadingKeyword = Synthetic InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl index ba653244455..3809962658a 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl @@ -34,7 +34,7 @@ ImplFile SynValInfo ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, - PreXmlDocEmpty, None, None, (2,9--2,37), + PreXmlDocEmpty, Single None, None, (2,9--2,37), { LeadingKeyword = Synthetic InlineKeyword = None WithKeyword = None diff --git a/tests/service/data/SyntaxTree/Val/InlineKeyword.fsi.bsl b/tests/service/data/SyntaxTree/Val/InlineKeyword.fsi.bsl index 62ae58c5ad0..8c04d7ba275 100644 --- a/tests/service/data/SyntaxTree/Val/InlineKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/Val/InlineKeyword.fsi.bsl @@ -13,12 +13,12 @@ SigFile SynValInfo ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), true, false, - PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), None, - None, (4,0--4,26), { LeadingKeyword = Val (4,0--4,3) - InlineKeyword = Some (4,4--4,10) - WithKeyword = None - EqualsRange = None }), (4,0--4,26))], - PreXmlDocEmpty, [], None, (2,0--4,26), - { LeadingKeyword = Namespace (2,0--2,9) })], + PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), + Single None, None, (4,0--4,26), + { LeadingKeyword = Val (4,0--4,3) + InlineKeyword = Some (4,4--4,10) + WithKeyword = None + EqualsRange = None }), (4,0--4,26))], PreXmlDocEmpty, [], + None, (2,0--4,26), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] CodeComments = [] }, set [])) From 9102feeb311fe1a02e6d01337e111300a2aef506 Mon Sep 17 00:00:00 2001 From: ijklam <43789618+Tangent-90@users.noreply.github.com> Date: Mon, 29 Apr 2024 21:16:20 +0800 Subject: [PATCH 34/43] add error tcAccessModifiersNotAllowedInSRTPConstraint update release note --- .../.FSharp.Compiler.Service/8.0.300.md | 1 - .../.FSharp.Compiler.Service/8.0.400.md | 1 + src/Compiler/Checking/CheckExpressions.fs | 11 ++++++++- src/Compiler/FSComp.txt | 3 ++- src/Compiler/xlf/FSComp.txt.cs.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.de.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.es.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.fr.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.it.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.ja.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.ko.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.pl.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.ru.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.tr.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 ++++ .../IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs | 23 +++++++++++++++++++ 18 files changed, 101 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md index 2d6c0efc8d9..d218d87856e 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -47,7 +47,6 @@ * Add extended data for `DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer` (FS0318). ([PR #16811](https://github.com/dotnet/fsharp/pull/16811))) * Checker/patterns: recover on unresolved long identifiers ([PR #16842](https://github.com/dotnet/fsharp/pull/16842)) * SynExprSequentialTrivia ([Issue #16914](https://github.com/dotnet/fsharp/issues/16914), [PR #16981](https://github.com/dotnet/fsharp/pull/16981)) -* Allow access modifies to auto properties getters and setters ([PR 16687](https://github.com/dotnet/fsharp/pull/16687), [PR 16861](https://github.com/dotnet/fsharp/pull/16861), [Language suggestion #430](https://github.com/fsharp/fslang-suggestions/issues/430)) ### Changed diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md index 674a2ec7d47..4fd3a38dfef 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md @@ -13,3 +13,4 @@ ### Added * Generate new `Equals` overload to avoid boxing for structural comparison ([PR #16857](https://github.com/dotnet/fsharp/pull/16857)) +* Allow access modifies to auto properties getters and setters ([PR 16687](https://github.com/dotnet/fsharp/pull/16687), [PR 16861](https://github.com/dotnet/fsharp/pull/16861), [Language suggestion #430](https://github.com/fsharp/fslang-suggestions/issues/430)) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 622f1f0a6af..9ec477ac2d6 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -4171,7 +4171,16 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv synMemberSig m = /// Check a value specification, e.g. in a signature, interface declaration or a constraint and TcValSpec (cenv: cenv) env declKind newOk containerInfo memFlagsOpt thisTyOpt tpenv synValSig attrs = let g = cenv.g - let (SynValSig(ident=SynIdent(id,_); explicitTypeParams=ValTyparDecls (synTypars, synTyparConstraints, _); synType=ty; arity=valSynInfo; range=m)) = synValSig + let (SynValSig(ident=SynIdent(id,_); explicitTypeParams=ValTyparDecls (synTypars, synTyparConstraints, _); synType=ty; arity=valSynInfo; range=m; accessibility = access)) = synValSig + + match access with + | SynValSigAccess.Single(Some access) + | SynValSigAccess.GetSet(Some access, _, _) + | SynValSigAccess.GetSet(_, Some access, _) + | SynValSigAccess.GetSet(_, _, Some access) -> + error(Error(FSComp.SR.tcAccessModifiersNotAllowedInSRTPConstraint(), access.Range)) + | _ -> () + let declaredTypars = TcTyparDecls cenv env synTypars let (ContainerInfo(altActualParent, tcrefContainerInfo)) = containerInfo diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 5eee191b2b8..fd62fc0df14 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1748,4 +1748,5 @@ featureReuseSameFieldsInStructUnions,"Share underlying fields in a [] di 3865,parsOnlySimplePatternsAreAllowedInConstructors,"Only simple patterns are allowed in primary constructors" 3866,chkStaticAbstractInterfaceMembers,"A static abstract non-virtual interface member should only be called via type parameter (for example: 'T.%s)." 3867,chkStaticAbstractMembersOnClasses,"Classes cannot contain static abstract members." -featureAllowAccessModifiersToAutoPropertiesGettersAndSetters,"Allow access modifiers to auto properties getters and setters" \ No newline at end of file +featureAllowAccessModifiersToAutoPropertiesGettersAndSetters,"Allow access modifiers to auto properties getters and setters" +3868,tcAccessModifiersNotAllowedInSRTPConstraint,"Access modifiers cannot be applied to an SRTP constraint." \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 79dd4291d08..6be4d84e5a6 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -1127,6 +1127,11 @@ (Navržený název) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. Význam _ je tady nejednoznačný. Nelze ho použít pro proměnnou typu discard a zkratku funkce ve stejném oboru. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 0ce9f3282a7..559a14eac91 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -1127,6 +1127,11 @@ (Empfohlener Name) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. Die Bedeutung von "_" ist hier mehrdeutig. Dieses Zeichen kann nicht in demselben Bereich für eine verworfene Variable und ein Funktionskürzel verwendet werden. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 0c80d7e1074..5f115c02510 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -1127,6 +1127,11 @@ (Nombre sugerido) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. El significado de _ es ambiguo aquí. No se puede usar para una variable descartada y una función abreviada en el mismo ámbito. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index b95e26daa9e..8277c7d2d26 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -1127,6 +1127,11 @@ (Nom suggéré) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. La signification de _ est ici ambiguë. Il ne peut pas être utilisé pour une variable ignorée et un raccourci de fonction dans la même portée. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 10f8ec7890d..fb404bed231 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -1127,6 +1127,11 @@ (Nome consigliato) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. Il significato di _ è ambiguo in questo contesto. Non può essere utilizzato per una variabile eliminata e una sintassi abbreviata di funzione nello stesso ambito. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index d6c70e77e79..0ff843478ec 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -1127,6 +1127,11 @@ (推奨される名前) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. ここでは _ の意味はあいまいです。破棄された変数と、同じスコープ内の関数の短縮形には使用できません。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 890218db5df..b2a45fcaf9e 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -1127,6 +1127,11 @@ (제안된 이름) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. 여기서 _의 의미가 모호합니다. 삭제된 변수와 동일한 범위의 함수 줄임에는 사용할 수 없습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 6bc6ee1b0a8..bbdf1ab9d42 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -1127,6 +1127,11 @@ (Sugerowana nazwa) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. Znaczenie elementu _ jest tutaj niejednoznaczne. Nie można go użyć dla odrzuconej zmiennej i skrótu funkcji w tym samym zakresie. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index ea4a9cd375e..d2245698ebc 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -1127,6 +1127,11 @@ (Nome sugerido) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. O significado de _ é ambíguo aqui. Ele não pode ser usado para uma variável descartada e uma abreviação de função no mesmo escopo. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 643bc20f972..bd60863095b 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -1127,6 +1127,11 @@ (предложенное имя) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. Неоднозначное значение символа _ здесь. Его нельзя использовать для пустой переменной и сокращенной функции в одной области. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 658fdfceb18..c61cd2c0f4f 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -1127,6 +1127,11 @@ (Önerilen ad) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. _ öğesinin anlamı burada belirsiz. Aynı kapsamda, atılan bir değişken ve işlev kısaltması için kullanılamaz. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index feed3462095..7f430f06ed7 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -1127,6 +1127,11 @@ (建议名称) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. 此处的 _ 含义不明确。它不能用于同一范围内的已放弃变量和函数速记。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 32b3f696165..93a7c8399ae 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -1127,6 +1127,11 @@ (建議的名稱) + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope. 此處的 _ 意義不明確。它不能在同一個範圍中既作為已捨棄的變數又作為函式速記。 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs index 3e971a054b0..87403ab9ce4 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -1269,3 +1269,26 @@ type A () = |> withDiagnostics [ (Error 3867, Line 3, Col 21, Line 3, Col 22, "Classes cannot contain static abstract members.") ] + + + [] + let ``Access modifiers cannot be applied to an SRTP constraint`` () = + FSharp """ +let inline length (x: ^a when ^a: (member public Length: int)) = x.Length +let inline length (x: ^a when ^a: (member Length: int with public get)) = x.Length +let inline length (x: ^a when ^a: (member Length: int with public set)) = x.set_Length(1) +let inline length (x: ^a when ^a: (member public get_Length: unit -> int)) = x.get_Length() + """ + |> withLangVersionPreview + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 3868, Line 2, Col 43, Line 2, Col 49, "Access modifiers cannot be applied to an SRTP constraint.") + (Error 0072, Line 2, Col 66, Line 2, Col 74, "Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.") + (Error 3868, Line 3, Col 60, Line 3, Col 66, "Access modifiers cannot be applied to an SRTP constraint.") + (Error 0072, Line 3, Col 75, Line 3, Col 83, "Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.") + (Error 3868, Line 4, Col 60, Line 4, Col 66, "Access modifiers cannot be applied to an SRTP constraint.") + (Error 0072, Line 4, Col 75, Line 4, Col 87, "Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.") + (Error 3868, Line 5, Col 43, Line 5, Col 49, "Access modifiers cannot be applied to an SRTP constraint.") + (Error 0072, Line 5, Col 78, Line 5, Col 90, "Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.") + ] From 97a6c5950232f0f0dc6308ce5d4b036928b1256f Mon Sep 17 00:00:00 2001 From: ijklam <43789618+Tangent-90@users.noreply.github.com> Date: Mon, 29 Apr 2024 23:38:25 +0800 Subject: [PATCH 35/43] fix build; check new feature and error under preview --- src/Compiler/Checking/CheckExpressions.fs | 25 ++++---- src/Compiler/SyntaxTree/SyntaxTree.fs | 4 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 60 +++++++++---------- .../AutoPropsWithModifierBeforeGetSet.fs | 28 +++++++++ .../IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs | 38 ++++++++---- 5 files changed, 100 insertions(+), 55 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 9ec477ac2d6..2423ed47dba 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -4142,6 +4142,20 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv synMemberSig m = let members, tpenv = TcValSpec cenv env ModuleOrMemberBinding newOk ExprContainerInfo (Some memberFlags) (Some (List.head tys)) tpenv synValSig [] match members with | [ValSpecResult(_, _, id, _, _, memberConstraintTy, prelimValReprInfo, _)] -> + + match synValSig with + | SynValSig(accessibility = access) -> + match access with + | SynValSigAccess.Single(Some access) + | SynValSigAccess.GetSet(Some access, _, _) + | SynValSigAccess.GetSet(_, Some access, _) + | SynValSigAccess.GetSet(_, _, Some access) -> + if g.langVersion.SupportsFeature(LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters) then + errorR(Error(FSComp.SR.tcAccessModifiersNotAllowedInSRTPConstraint(), access.Range)) + else + warning(Error(FSComp.SR.tcAccessModifiersNotAllowedInSRTPConstraint(), access.Range)) + | _ -> () + let memberConstraintTypars, _ = tryDestForallTy g memberConstraintTy let valReprInfo = TranslatePartialValReprInfo memberConstraintTypars prelimValReprInfo let _, _, curriedArgInfos, returnTy, _ = GetValReprTypeInCompiledForm g valReprInfo 0 memberConstraintTy m @@ -4171,16 +4185,7 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv synMemberSig m = /// Check a value specification, e.g. in a signature, interface declaration or a constraint and TcValSpec (cenv: cenv) env declKind newOk containerInfo memFlagsOpt thisTyOpt tpenv synValSig attrs = let g = cenv.g - let (SynValSig(ident=SynIdent(id,_); explicitTypeParams=ValTyparDecls (synTypars, synTyparConstraints, _); synType=ty; arity=valSynInfo; range=m; accessibility = access)) = synValSig - - match access with - | SynValSigAccess.Single(Some access) - | SynValSigAccess.GetSet(Some access, _, _) - | SynValSigAccess.GetSet(_, Some access, _) - | SynValSigAccess.GetSet(_, _, Some access) -> - error(Error(FSComp.SR.tcAccessModifiersNotAllowedInSRTPConstraint(), access.Range)) - | _ -> () - + let (SynValSig(ident=SynIdent(id,_); explicitTypeParams=ValTyparDecls (synTypars, synTyparConstraints, _); synType=ty; arity=valSynInfo; range=m)) = synValSig let declaredTypars = TcTyparDecls cenv env synTypars let (ContainerInfo(altActualParent, tcrefContainerInfo)) = containerInfo diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 487477d15e5..b349fd25dfc 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1338,8 +1338,8 @@ type SynValSigAccess = member this.GetSetAccessNoCheck() = match this with - | SynValSigAccess.Single(access) -> access, access - | SynValSigAccess.GetSet(access, getterAccess, setterAccess) -> + | Single(access) -> access, access + | GetSet(access, getterAccess, setterAccess) -> let getterAccess = getterAccess |> Option.orElse access let setterAccess = setterAccess |> Option.orElse access getterAccess, setterAccess diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 82c9f81fa6b..9cb7703a190 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -1075,40 +1075,38 @@ let getGetterSetterAccess synValSigAccess memberKind (langVersion: Features.Lang match synValSigAccess with | SynValSigAccess.Single(access) -> access, access | SynValSigAccess.GetSet(access, getterAccess, setterAccess) -> + let checkAccess (access: SynAccess option) (accessBeforeGetSet: SynAccess option) = + match accessBeforeGetSet, access with + | None, _ -> access + | Some x, Some _ -> + errorR (Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet (), x.Range)) + None + | Some x, None -> + checkLanguageFeatureAndRecover + langVersion + Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters + x.Range + + accessBeforeGetSet + match memberKind with | SynMemberKind.PropertyGetSet -> - match access with - | Some _ -> - match getterAccess, setterAccess with - | None, None -> access, access - | Some x, _ - | _, Some x -> - errorR (Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet (), x.Range)) - None, None - | None -> - match getterAccess, setterAccess with - | Some x, _ - | _, Some x -> - checkLanguageFeatureAndRecover - langVersion - Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters - x.Range - - getterAccess, setterAccess - | _, _ -> None, None - | SynMemberKind.PropertySet -> - match access, setterAccess with - | Some _, Some x -> + match access, (getterAccess, setterAccess) with + | _, (None, None) -> access, access + | None, (Some x, _) + | None, (_, Some x) -> + checkLanguageFeatureAndRecover + langVersion + Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters + x.Range + + getterAccess, setterAccess + | _, (Some x, _) + | _, (_, Some x) -> errorR (Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet (), x.Range)) None, None - | _, None -> None, access - | None, _ -> None, setterAccess + + | SynMemberKind.PropertySet -> None, checkAccess access setterAccess | SynMemberKind.Member | SynMemberKind.PropertyGet - | _ -> - match access, getterAccess with - | Some _, Some x -> - errorR (Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet (), x.Range)) - None, None - | _, None -> access, None - | None, _ -> getterAccess, None + | _ -> checkAccess access getterAccess, None diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs index b687139a1c5..676746d96f5 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/AutoPropsWithModifierBeforeGetSet.fs @@ -169,3 +169,31 @@ but its signature specifies member A.E: int with get The accessibility specified in the signature is more than that specified in the implementation") ] + +[] +let ``Cannot use in F# 8.0`` () = + let encodeFs = + FsSource """module Program + +type A() = + member val B: int = 0 with internal get + member _.C with internal set (v: int) = () + member val D: int = 0 with internal get, private set""" + Fsi """module Program + +type A = + new: unit -> A + member B: int with internal get + member C: int with internal set + member D: int with internal get, private set""" + |> withAdditionalSourceFile encodeFs + |> withLangVersion80 + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 5, Col 24, Line 5, Col 32, "Feature 'Allow access modifiers to auto properties getters and setters' is not available in F# 8.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 24, Line 6, Col 32, "Feature 'Allow access modifiers to auto properties getters and setters' is not available in F# 8.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 7, Col 24, Line 7, Col 32, "Feature 'Allow access modifiers to auto properties getters and setters' is not available in F# 8.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 4, Col 32, Line 4, Col 40, "Feature 'Allow access modifiers to auto properties getters and setters' is not available in F# 8.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 32, Line 6, Col 40, "Feature 'Allow access modifiers to auto properties getters and setters' is not available in F# 8.0. Please use language version 'PREVIEW' or greater.") + ] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs index 87403ab9ce4..998c23699c9 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -1271,24 +1271,38 @@ type A () = ] - [] - let ``Access modifiers cannot be applied to an SRTP constraint`` () = + [] + let ``Access modifiers cannot be applied to an SRTP constraint in preview`` () = FSharp """ let inline length (x: ^a when ^a: (member public Length: int)) = x.Length -let inline length (x: ^a when ^a: (member Length: int with public get)) = x.Length -let inline length (x: ^a when ^a: (member Length: int with public set)) = x.set_Length(1) -let inline length (x: ^a when ^a: (member public get_Length: unit -> int)) = x.get_Length() +let inline length2 (x: ^a when ^a: (member Length: int with public get)) = x.Length +let inline length3 (x: ^a when ^a: (member Length: int with public set)) = x.set_Length(1) +let inline length4 (x: ^a when ^a: (member public get_Length: unit -> int)) = x.get_Length() """ |> withLangVersionPreview |> typecheck |> shouldFail |> withDiagnostics [ (Error 3868, Line 2, Col 43, Line 2, Col 49, "Access modifiers cannot be applied to an SRTP constraint.") - (Error 0072, Line 2, Col 66, Line 2, Col 74, "Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.") - (Error 3868, Line 3, Col 60, Line 3, Col 66, "Access modifiers cannot be applied to an SRTP constraint.") - (Error 0072, Line 3, Col 75, Line 3, Col 83, "Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.") - (Error 3868, Line 4, Col 60, Line 4, Col 66, "Access modifiers cannot be applied to an SRTP constraint.") - (Error 0072, Line 4, Col 75, Line 4, Col 87, "Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.") - (Error 3868, Line 5, Col 43, Line 5, Col 49, "Access modifiers cannot be applied to an SRTP constraint.") - (Error 0072, Line 5, Col 78, Line 5, Col 90, "Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.") + (Error 3868, Line 3, Col 61, Line 3, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") + (Error 3868, Line 4, Col 61, Line 4, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") + (Error 3868, Line 5, Col 44, Line 5, Col 50, "Access modifiers cannot be applied to an SRTP constraint.") + ] + + [] + let ``Access modifiers in an SRTP constraint generate warning in F# 8.0`` () = + FSharp """ +let inline length (x: ^a when ^a: (member public Length: int)) = x.Length +let inline length2 (x: ^a when ^a: (member Length: int with public get)) = x.Length +let inline length3 (x: ^a when ^a: (member Length: int with public set)) = x.set_Length(1) +let inline length4 (x: ^a when ^a: (member public get_Length: unit -> int)) = x.get_Length() + """ + |> withLangVersion80 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 3868, Line 2, Col 43, Line 2, Col 49, "Access modifiers cannot be applied to an SRTP constraint.") + (Warning 3868, Line 3, Col 61, Line 3, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") + (Warning 3868, Line 4, Col 61, Line 4, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") + (Warning 3868, Line 5, Col 44, Line 5, Col 50, "Access modifiers cannot be applied to an SRTP constraint.") ] From d064e3c821f8daa7d6b1325b34f31dbd71b8a172 Mon Sep 17 00:00:00 2001 From: ijklam <43789618+Tangent-90@users.noreply.github.com> Date: Mon, 29 Apr 2024 23:44:45 +0800 Subject: [PATCH 36/43] format --- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 9cb7703a190..66b2bcb2c98 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -1081,7 +1081,7 @@ let getGetterSetterAccess synValSigAccess memberKind (langVersion: Features.Lang | Some x, Some _ -> errorR (Error(FSComp.SR.parsMultipleAccessibilitiesForGetSet (), x.Range)) None - | Some x, None -> + | Some x, None -> checkLanguageFeatureAndRecover langVersion Features.LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters From a0e2b556b39d8cc517527ebdd193b66a33e20ca1 Mon Sep 17 00:00:00 2001 From: ijklam <43789618+Tangent-90@users.noreply.github.com> Date: Thu, 9 May 2024 18:31:13 +0800 Subject: [PATCH 37/43] fix xlf --- src/Compiler/xlf/FSComp.txt.cs.xlf | 7 +++++++ src/Compiler/xlf/FSComp.txt.de.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.es.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.fr.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.it.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.ja.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.ko.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.pl.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.ru.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.tr.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 2 ++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 2 ++ 13 files changed, 31 insertions(+) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 9d50f6a3385..416ed1f937a 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -1130,6 +1130,13 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + + + Access modifiers cannot be applied to an SRTP constraint. + Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 57c537c0ea5..802848b8de8 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 1f0dd7cd63f..9516b6726bf 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index b6e47dc197e..501530269fa 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 6f40d7a0052..c3f87029ac9 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 879a105422d..86c90e92ab4 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index de9bd04268f..5a606d21903 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 7415727b601..9a9d7086b8c 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 508bc6b65ac..364e56adc74 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 5eadece21f7..4fdb7140d31 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index b9ce50c1577..eb47eb46576 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index af67ef68a78..916016b7150 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 9de4f69d4f6..9c8b6ff4116 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -1130,6 +1130,8 @@ Access modifiers cannot be applied to an SRTP constraint. Access modifiers cannot be applied to an SRTP constraint. + + This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. From 86728d19288a47c4f99a64cb1f72cc78faa4f9d3 Mon Sep 17 00:00:00 2001 From: ijklam <43789618+Tangent-90@users.noreply.github.com> Date: Thu, 9 May 2024 22:52:05 +0800 Subject: [PATCH 38/43] update test --- .../IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs index 998c23699c9..eeecbba750b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -1283,10 +1283,10 @@ let inline length4 (x: ^a when ^a: (member public get_Length: unit -> int)) = x. |> typecheck |> shouldFail |> withDiagnostics [ - (Error 3868, Line 2, Col 43, Line 2, Col 49, "Access modifiers cannot be applied to an SRTP constraint.") - (Error 3868, Line 3, Col 61, Line 3, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") - (Error 3868, Line 4, Col 61, Line 4, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") - (Error 3868, Line 5, Col 44, Line 5, Col 50, "Access modifiers cannot be applied to an SRTP constraint.") + (Error 3869, Line 2, Col 43, Line 2, Col 49, "Access modifiers cannot be applied to an SRTP constraint.") + (Error 3869, Line 3, Col 61, Line 3, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") + (Error 3869, Line 4, Col 61, Line 4, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") + (Error 3869, Line 5, Col 44, Line 5, Col 50, "Access modifiers cannot be applied to an SRTP constraint.") ] [] @@ -1301,8 +1301,8 @@ let inline length4 (x: ^a when ^a: (member public get_Length: unit -> int)) = x. |> typecheck |> shouldFail |> withDiagnostics [ - (Warning 3868, Line 2, Col 43, Line 2, Col 49, "Access modifiers cannot be applied to an SRTP constraint.") - (Warning 3868, Line 3, Col 61, Line 3, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") - (Warning 3868, Line 4, Col 61, Line 4, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") - (Warning 3868, Line 5, Col 44, Line 5, Col 50, "Access modifiers cannot be applied to an SRTP constraint.") + (Warning 3869, Line 2, Col 43, Line 2, Col 49, "Access modifiers cannot be applied to an SRTP constraint.") + (Warning 3869, Line 3, Col 61, Line 3, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") + (Warning 3869, Line 4, Col 61, Line 4, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") + (Warning 3869, Line 5, Col 44, Line 5, Col 50, "Access modifiers cannot be applied to an SRTP constraint.") ] From f6d775cde3138d351921f9b7fbfd6ef6bcc5199b Mon Sep 17 00:00:00 2001 From: ijklam <43789618+Tangent-90@users.noreply.github.com> Date: Thu, 9 May 2024 23:28:41 +0800 Subject: [PATCH 39/43] update xlf --- src/Compiler/xlf/FSComp.txt.cs.xlf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 416ed1f937a..a318e0f113c 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -1132,11 +1132,6 @@ Access modifiers cannot be applied to an SRTP constraint. - - Access modifiers cannot be applied to an SRTP constraint. - Access modifiers cannot be applied to an SRTP constraint. - - This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. This active pattern expects {0} expression argument(s), e.g., '{1}{2}'. From ecc647cff9b899233f48163cb4133a21acb04c6a Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 16 Jul 2024 18:35:27 +0200 Subject: [PATCH 40/43] Fix tests --- .../ErrorMessages/Directives.fs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/Directives.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/Directives.fs index 2f1dda5d400..f3435888462 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/Directives.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/Directives.fs @@ -278,8 +278,7 @@ printfn "Hello, World" |> withDiagnostics[ (Warning 3353, Line 2, Col 9, Line 2, Col 11, "Invalid directive '#r '") (Warning 213, Line 3, Col 9, Line 3, Col 14, "'' is not a valid assembly name") - (Error 3869, Line 4, Col 12, Line 4, Col 17, "Unexpected identifier 'Ident'.") - (Error 3869, Line 5, Col 12, Line 5, Col 22, "Unexpected identifier 'Long.Ident'.") - (Error 3869, Line 6, Col 12, Line 6, Col 15, "Unexpected integer literal '123'.") + (Error 3870, Line 4, Col 12, Line 4, Col 17, "Unexpected identifier 'Ident'.") + (Error 3870, Line 5, Col 12, Line 5, Col 22, "Unexpected identifier 'Long.Ident'.") + (Error 3870, Line 6, Col 12, Line 6, Col 15, "Unexpected integer literal '123'.") ] - From 70ba9180f6ed550c58e948395bbe36f3585614a5 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 16 Jul 2024 19:50:21 +0200 Subject: [PATCH 41/43] Updated release notes --- docs/release-notes/.FSharp.Compiler.Service/8.0.400.md | 1 - docs/release-notes/.FSharp.Compiler.Service/9.0.100.md | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md index f8d11adfc61..60394d22e23 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md @@ -23,7 +23,6 @@ ### Added * Generate new `Equals` overload to avoid boxing for structural comparison ([PR #16857](https://github.com/dotnet/fsharp/pull/16857)) -* Allow access modifies to auto properties getters and setters ([PR 16687](https://github.com/dotnet/fsharp/pull/16687), [PR 16861](https://github.com/dotnet/fsharp/pull/16861), [Language suggestion #430](https://github.com/fsharp/fslang-suggestions/issues/430)) * Allow #nowarn to support the FS prefix on error codes to disable warnings ([Issue #17206](https://github.com/dotnet/fsharp/issues/16447), [PR #17209](https://github.com/dotnet/fsharp/pull/17209)) * Allow ParsedHashDirectives to have argument types other than strings ([Issue #17240](https://github.com/dotnet/fsharp/issues/16447), [PR #17209](https://github.com/dotnet/fsharp/pull/17209)) * Parser: better recovery for unfinished patterns ([PR #17231](https://github.com/dotnet/fsharp/pull/17231)) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md index 7282b2d0b50..1a6d0d31ed4 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md @@ -1,9 +1,14 @@ ### Fixed + * Compiler hangs when compiling inline recursive invocation ([Issue #17376](https://github.com/dotnet/fsharp/issues/17376), [PR #17394](https://github.com/dotnet/fsharp/pull/17394)) ### Added +* Allow access modifies to auto properties getters and setters ([PR 16687](https://github.com/dotnet/fsharp/pull/16687), [PR 16861](https://github.com/dotnet/fsharp/pull/16861), [Language suggestion #430](https://github.com/fsharp/fslang-suggestions/issues/430)) + + ### Changed + * Change compiler default setting realsig+ when building assemblies ([Issue #17384](https://github.com/dotnet/fsharp/issues/17384), [PR #17378](https://github.com/dotnet/fsharp/pull/17385)) * Change compiler default setting for compressedMetadata ([Issue #17379](https://github.com/dotnet/fsharp/issues/17379), [PR #17383](https://github.com/dotnet/fsharp/pull/17383)) From 6838437ca2ab251fd3d2e99c81155e0b7e898f66 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 24 Jul 2024 16:57:20 +0200 Subject: [PATCH 42/43] Update bsl --- .../data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl b/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl index f6aca925483..93923eb78f5 100644 --- a/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl @@ -34,7 +34,7 @@ ImplFile ([[SynArgInfo ([], false, None)]], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((2,3), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (2,3--2,61), + Single None, None, (2,3--2,61), { LeadingKeyword = AbstractMember ((2,3--2,11), (2,12--2,18)) InlineKeyword = None From b344aeaa30da18d0e9330568522e918ed0f8a795 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 29 Jul 2024 22:02:37 +0200 Subject: [PATCH 43/43] Fix baseline --- .../data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl b/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl index a319c237e5d..11735a1d0c3 100644 --- a/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl @@ -33,7 +33,7 @@ ImplFile SynValInfo ([], SynArgInfo ([], false, None)), false, false, PreXmlDoc ((3,3), FSharp.Compiler.Xml.XmlDocCollector), - None, None, (3,3--3,51), + Single None, None, (3,3--3,51), { LeadingKeyword = Abstract (3,3--3,11) InlineKeyword = None WithKeyword = Some (3,38--3,42)