diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index ea9dd8db5f..6bcea07ddc 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -421,7 +421,7 @@ parsAttributesMustComeBeforeVal,"Attributes should be placed before 'val'" 555,parsGetAndOrSetRequired,"'get' and/or 'set' required" 556,parsTypeAnnotationsOnGetSet,"Type annotations on property getters and setters must be given after the 'get()' or 'set(v)', e.g. 'with get() : string = ...'" 557,parsGetterMustHaveAtLeastOneArgument,"A getter property is expected to be a function, e.g. 'get() = ...' or 'get(index) = ...'" -558,parsMultipleAccessibilitiesForGetSet,"Multiple accessibilities given for property getter or setter" +558,parsMultipleAccessibilitiesForGetSet,"When the visibility for a property is specified, setting the visibility of the set or get method is not allowed." 559,parsSetSyntax,"Property setters must be defined using 'set value = ', 'set idx value = ' or 'set (idx1,...,idxN) value = ... '" 560,parsInterfacesHaveSameVisibilityAsEnclosingType,"Interfaces always have the same visibility as the enclosing type" 561,parsAccessibilityModsIllegalForAbstract,"Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type." diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 2d85fe436a..1032f6bfbe 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - Zadali jste víc dostupností pro metodu getter nebo setter vlastnosti. + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + Zadali jste víc dostupností pro metodu getter nebo setter vlastnosti. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 61b81a68ce..f3d9c45321 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - Für den Getter oder Setter der Eigenschaft wurden mehrere Zugriffsebenen angegeben. + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + Für den Getter oder Setter der Eigenschaft wurden mehrere Zugriffsebenen angegeben. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 8e9f50f0ec..63da026d98 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - Se proporcionaron varias accesibilidades para un captador o establecedor de propiedad. + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + Se proporcionaron varias accesibilidades para un captador o establecedor de propiedad. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 6ba1368d2f..6d16462513 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - Plusieurs accessibilités fournies pour la méthode getter ou setter de la propriété + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + Plusieurs accessibilités fournies pour la méthode getter ou setter de la propriété diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 9be90d06c3..f0ddeb1b1b 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - Sono state assegnate più accessibilità per il getter o il setter della proprietà + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + Sono state assegnate più accessibilità per il getter o il setter della proprietà diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 55faf012fb..aa43d1df94 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - プロパティのゲッターまたはセッターに指定されたアクセシビリティが複数あります + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + プロパティのゲッターまたはセッターに指定されたアクセシビリティが複数あります diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 396c990390..78eab1b954 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - 속성 getter 또는 setter에 대해 여러 액세스 가능성이 지정되었습니다. + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + 속성 getter 또는 setter에 대해 여러 액세스 가능성이 지정되었습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index aec30d2687..df59b7f8bd 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - Podano wiele dostępności dla metody ustawiającej lub metody pobierającej właściwość + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + Podano wiele dostępności dla metody ustawiającej lub metody pobierającej właściwość diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 0400f40c55..bc1c5625c8 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - Acessibilidades múltiplas fornecidas para getter ou setter de propriedade + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + Acessibilidades múltiplas fornecidas para getter ou setter de propriedade diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index eafcec08eb..2c5158b45e 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - Задано несколько модификаторов доступности для метода получения или задания свойства + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + Задано несколько модификаторов доступности для метода получения или задания свойства diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 08301bd135..bbb75604b8 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - Özellik alıcı veya ayarlayıcı için birden çok erişilebilirlik verildi + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + Özellik alıcı veya ayarlayıcı için birden çok erişilebilirlik verildi diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 72abb92d9b..16f9c44ede 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - 为属性 Getter 或 Setter 给定了多个可访问性 + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + 为属性 Getter 或 Setter 给定了多个可访问性 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 8b8dd5ef81..0f5f8615a0 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -3283,8 +3283,8 @@ - Multiple accessibilities given for property getter or setter - 為屬性 getter 或 setter 指定了多個存取範圍 + When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. + 為屬性 getter 或 setter 指定了多個存取範圍 diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index 0b477a0c38..f8fbc7138e 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -10,7 +10,7 @@ $(NoWarn);75 true $(DefineConstants);LOCALIZATION_FSBUILD - NU1701;FS0075 + $(NoWarn);NU1701;FS0075 true 7.0 Debug;Release;Proto;ReleaseCompressed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/OnTypeMembers/OnTypeMembers.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/OnTypeMembers/OnTypeMembers.fs index b59132ae14..0fbbe44a90 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/OnTypeMembers/OnTypeMembers.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/OnTypeMembers/OnTypeMembers.fs @@ -85,8 +85,8 @@ module AccessibilityAnnotations_OnTypeMembers = |> withDiagnostics [ (Error 10, Line 15, Col 49, Line 15, Col 50, "Unexpected symbol ')' in pattern") (Error 1244, Line 15, Col 48, Line 15, Col 50, "Attempted to parse this as an operator name, but failed") - (Error 558, Line 16, Col 36, Line 16, Col 50, "Multiple accessibilities given for property getter or setter") - (Error 558, Line 19, Col 35, Line 19, Col 56, "Multiple accessibilities given for property getter or setter") + (Error 558, Line 16, Col 36, Line 16, Col 50, "When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.") + (Error 558, Line 19, Col 35, Line 19, Col 56, "When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.") (Error 10, Line 20, Col 49, Line 20, Col 50, "Unexpected identifier in pattern") (Error 1244, Line 20, Col 48, Line 20, Col 57, "Attempted to parse this as an operator name, but failed") (Error 10, Line 23, Col 36, Line 23, Col 42, "Unexpected keyword 'public' in member definition") diff --git a/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs b/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs new file mode 100644 index 0000000000..9e8c571bc4 --- /dev/null +++ b/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs @@ -0,0 +1,5 @@ +module Foo + +type Foo() = + member f.X with internal get (key1, key2) = true and private set (key1, key2) value = () + member internal f.Y with get (key1, key2) = true and private set (key1, key2) value = () diff --git a/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl b/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl new file mode 100644 index 0000000000..3d88c0ff50 --- /dev/null +++ b/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl @@ -0,0 +1,208 @@ +ImplFile + (ParsedImplFileInput + ("/root/Member/GetSetMember 01.fs", false, QualifiedNameOfFile Foo, [], [], + [SynModuleOrNamespace + ([Foo], false, NamedModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], [Foo], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (3,5--3,8)), + ObjectModel + (Unspecified, + [ImplicitCtor + (None, [], SimplePats ([], [], (3,8--3,10)), None, + PreXmlDoc ((3,8), FSharp.Compiler.Xml.XmlDocCollector), + (3,5--3,8), { AsKeyword = None }); + GetSetMember + (Some + (SynBinding + (None, Normal, false, false, [], + PreXmlMerge + (PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), PreXmlDocEmpty), + SynValData + (Some + { IsInstance = true + IsDispatchSlot = false + IsOverrideOrExplicitImpl = false + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + MemberKind = PropertyGet }, + SynValInfo + ([[SynArgInfo ([], false, None)]; + [SynArgInfo ([], false, Some key1); + SynArgInfo ([], false, Some key2)]], + SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent + ([f; X], [(4,12--4,13)], [None; None]), + Some get, None, + Pats + [Paren + (Tuple + (false, + [Named + (SynIdent (key1, None), false, + None, (4,34--4,38)); + Named + (SynIdent (key2, None), false, + None, (4,40--4,44))], + [(4,38--4,39)], (4,34--4,44)), + (4,33--4,45))], + Some (Internal (4,20--4,28)), (4,20--4,45)), + None, Const (Bool true, (4,48--4,52)), + (4,20--4,45), NoneAtInvisible, + { LeadingKeyword = Member (4,4--4,10) + InlineKeyword = None + EqualsRange = Some (4,46--4,47) })), + Some + (SynBinding + (None, Normal, false, false, [], + PreXmlMerge + (PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), PreXmlDocEmpty), + SynValData + (Some + { IsInstance = true + IsDispatchSlot = false + IsOverrideOrExplicitImpl = false + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + MemberKind = PropertySet }, + SynValInfo + ([[SynArgInfo ([], false, None)]; + [SynArgInfo ([], false, Some key1); + SynArgInfo ([], false, Some key2); + SynArgInfo ([], false, Some value)]], + SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent + ([f; X], [(4,12--4,13)], [None; None]), + Some set, None, + Pats + [Tuple + (false, + [Named + (SynIdent (key1, None), false, None, + (4,70--4,74)); + Named + (SynIdent (key2, None), false, None, + (4,76--4,80)); + Named + (SynIdent (value, None), false, None, + (4,82--4,87))], [(4,74--4,75)], + (4,69--4,87))], + Some (Private (4,57--4,64)), (4,57--4,87)), + None, Const (Unit, (4,90--4,92)), (4,57--4,87), + NoneAtInvisible, + { LeadingKeyword = Member (4,4--4,10) + InlineKeyword = None + EqualsRange = Some (4,88--4,89) })), + (4,4--4,92), { InlineKeyword = None + WithKeyword = (4,15--4,19) + GetKeyword = Some (4,29--4,32) + AndKeyword = Some (4,53--4,56) + SetKeyword = Some (4,65--4,68) }); + GetSetMember + (Some + (SynBinding + (None, Normal, false, false, [], + PreXmlMerge + (PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), PreXmlDocEmpty), + SynValData + (Some + { IsInstance = true + IsDispatchSlot = false + IsOverrideOrExplicitImpl = false + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + MemberKind = PropertyGet }, + SynValInfo + ([[SynArgInfo ([], false, None)]; + [SynArgInfo ([], false, Some key1); + SynArgInfo ([], false, Some key2)]], + SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent + ([f; Y], [(5,21--5,22)], [None; None]), + Some get, None, + Pats + [Paren + (Tuple + (false, + [Named + (SynIdent (key1, None), false, + None, (5,34--5,38)); + Named + (SynIdent (key2, None), false, + None, (5,40--5,44))], + [(5,38--5,39)], (5,34--5,44)), + (5,33--5,45))], + Some (Internal (5,11--5,19)), (5,29--5,45)), + None, Const (Bool true, (5,48--5,52)), + (5,29--5,45), NoneAtInvisible, + { LeadingKeyword = Member (5,4--5,10) + InlineKeyword = None + EqualsRange = Some (5,46--5,47) })), + Some + (SynBinding + (None, Normal, false, false, [], + PreXmlMerge + (PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), PreXmlDocEmpty), + SynValData + (Some + { IsInstance = true + IsDispatchSlot = false + IsOverrideOrExplicitImpl = false + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + MemberKind = PropertySet }, + SynValInfo + ([[SynArgInfo ([], false, None)]; + [SynArgInfo ([], false, Some key1); + SynArgInfo ([], false, Some key2); + SynArgInfo ([], false, Some value)]], + SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent + ([f; Y], [(5,21--5,22)], [None; None]), + Some set, None, + Pats + [Tuple + (false, + [Named + (SynIdent (key1, None), false, None, + (5,70--5,74)); + Named + (SynIdent (key2, None), false, None, + (5,76--5,80)); + Named + (SynIdent (value, None), false, None, + (5,82--5,87))], [(5,74--5,75)], + (5,69--5,87))], + Some (Private (5,57--5,64)), (5,57--5,87)), + None, Const (Unit, (5,90--5,92)), (5,57--5,87), + NoneAtInvisible, + { LeadingKeyword = Member (5,4--5,10) + InlineKeyword = None + EqualsRange = Some (5,88--5,89) })), + (5,4--5,92), { InlineKeyword = None + WithKeyword = (5,24--5,28) + GetKeyword = Some (5,29--5,32) + AndKeyword = Some (5,53--5,56) + SetKeyword = Some (5,65--5,68) })], + (4,4--5,92)), [], + Some + (ImplicitCtor + (None, [], SimplePats ([], [], (3,8--3,10)), None, + PreXmlDoc ((3,8), FSharp.Compiler.Xml.XmlDocCollector), + (3,5--3,8), { AsKeyword = None })), (3,5--5,92), + { LeadingKeyword = Type (3,0--3,4) + EqualsRange = Some (3,11--3,12) + WithKeyword = None })], (3,0--5,92))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,92), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) + +(5,57)-(5,87) parse error When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.