Merge pull request #15454 from dotnet/merges/main-to-release/dev17.7

Merge main to release/dev17.7
This commit is contained in:
Kevin Ransom (msft) 2023-06-21 09:34:26 -07:00 коммит произвёл GitHub
Родитель c7664d457b 1e84b1f836
Коммит ea7038bf90
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
18 изменённых файлов: 243 добавлений и 30 удалений

Просмотреть файл

@ -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."

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Zadali jste víc dostupností pro metodu getter nebo setter vlastnosti.</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Zadali jste víc dostupností pro metodu getter nebo setter vlastnosti.</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Für den Getter oder Setter der Eigenschaft wurden mehrere Zugriffsebenen angegeben.</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Für den Getter oder Setter der Eigenschaft wurden mehrere Zugriffsebenen angegeben.</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Se proporcionaron varias accesibilidades para un captador o establecedor de propiedad.</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Se proporcionaron varias accesibilidades para un captador o establecedor de propiedad.</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Plusieurs accessibilités fournies pour la méthode getter ou setter de la propriété</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Plusieurs accessibilités fournies pour la méthode getter ou setter de la propriété</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Sono state assegnate più accessibilità per il getter o il setter della proprietà</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Sono state assegnate più accessibilità per il getter o il setter della proprietà</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">プロパティのゲッターまたはセッターに指定されたアクセシビリティが複数あります</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">プロパティのゲッターまたはセッターに指定されたアクセシビリティが複数あります</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">속성 getter 또는 setter에 대해 여러 액세스 가능성이 지정되었습니다.</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">속성 getter 또는 setter에 대해 여러 액세스 가능성이 지정되었습니다.</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Podano wiele dostępności dla metody ustawiającej lub metody pobierającej właściwość</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Podano wiele dostępności dla metody ustawiającej lub metody pobierającej właściwość</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Acessibilidades múltiplas fornecidas para getter ou setter de propriedade</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Acessibilidades múltiplas fornecidas para getter ou setter de propriedade</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Задано несколько модификаторов доступности для метода получения или задания свойства</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Задано несколько модификаторов доступности для метода получения или задания свойства</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Özellik alıcı veya ayarlayıcı için birden çok erişilebilirlik verildi</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Özellik alıcı veya ayarlayıcı için birden çok erişilebilirlik verildi</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">为属性 Getter 或 Setter 给定了多个可访问性</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">为属性 Getter 或 Setter 给定了多个可访问性</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">為屬性 getter 或 setter 指定了多個存取範圍</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">為屬性 getter 或 setter 指定了多個存取範圍</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">

Просмотреть файл

@ -10,7 +10,7 @@
<NoWarn>$(NoWarn);75</NoWarn> <!-- InternalCommandLineOption -->
<AllowCrossTargeting>true</AllowCrossTargeting>
<DefineConstants>$(DefineConstants);LOCALIZATION_FSBUILD</DefineConstants>
<NoWarn>NU1701;FS0075</NoWarn>
<NoWarn>$(NoWarn);NU1701;FS0075</NoWarn>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<LangVersion>7.0</LangVersion> <!-- FSharp.Build may run in Visual Studio with older FSharp.Cores so don't use unshipped features -->
<Configurations>Debug;Release;Proto;ReleaseCompressed</Configurations> <!-- FSharp.Build may run in Visual Studio with older FSharp.Cores so don't use unshipped features -->

Просмотреть файл

@ -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")

Просмотреть файл

@ -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 = ()

208
tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl поставляемый Normal file
Просмотреть файл

@ -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.