提交 556d0971 编写于 作者: N Neal Gafter

Adjust some VB diagnostics to recognize the existence of 'Private Protected'.

上级 26d5fda1
......@@ -3027,7 +3027,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Property
'''<summary>
''' Looks up a localized string similar to Only one of &apos;Public&apos;, &apos;Private&apos;, &apos;Protected&apos;, &apos;Friend&apos;, or &apos;Protected Friend&apos; can be specified..
''' Looks up a localized string similar to Only one of &apos;Public&apos;, &apos;Private&apos;, &apos;Protected&apos;, &apos;Friend&apos;, &apos;Protected Friend&apos;, or &apos;Private Protected&apos; can be specified..
'''</summary>
Friend ReadOnly Property ERR_DuplicateAccessCategoryUsed() As String
Get
......@@ -10262,7 +10262,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Property
'''<summary>
''' Looks up a localized string similar to Method in a structure cannot be declared &apos;Protected&apos; or &apos;Protected Friend&apos;..
''' Looks up a localized string similar to Method in a structure cannot be declared &apos;Protected&apos;, &apos;Protected Friend&apos;, or &apos;Private Protected&apos;..
'''</summary>
Friend ReadOnly Property ERR_StructureCantUseProtected() As String
Get
......
......@@ -574,7 +574,7 @@
<value>Leading '.' or '!' can only appear inside a 'With' statement.</value>
</data>
<data name="ERR_DuplicateAccessCategoryUsed" xml:space="preserve">
<value>Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.</value>
<value>Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.</value>
</data>
<data name="ERR_DuplicateModifierCategoryUsed" xml:space="preserve">
<value>Only one of 'NotOverridable', 'MustOverride', or 'Overridable' can be specified.</value>
......@@ -1963,7 +1963,7 @@
<value>'Set' parameter cannot be declared '{0}'.</value>
</data>
<data name="ERR_StructureCantUseProtected" xml:space="preserve">
<value>Method in a structure cannot be declared 'Protected' or 'Protected Friend'.</value>
<value>Method in a structure cannot be declared 'Protected', 'Protected Friend', or 'Private Protected'.</value>
</data>
<data name="ERR_BadInterfaceDelegateSpecifier1" xml:space="preserve">
<value>Delegate in an interface cannot be declared '{0}'.</value>
......
......@@ -32,16 +32,16 @@ End Class
parseOptions:=TestOptions.Regular.WithLanguageVersion(LanguageVersion.VisualBasic15_5))
CompilationUtils.AssertTheseDiagnostics(compilation,
<errors>
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Friend Field1 As Integer
~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Friend Private Field2 As Integer
~~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Friend Protected Field3 As Integer
~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Friend Protected Private Field4 As Integer
~~~~~~~
</errors>)
......@@ -471,34 +471,34 @@ End Class
parseOptions:=TestOptions.Regular.WithLanguageVersion(LanguageVersion.VisualBasic15_5))
CompilationUtils.AssertTheseDiagnostics(compilation,
<errors>
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Public Field As Integer ' 1
~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Public Property Prop As Integer ' 2
~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Public Function M() As Integer : Return 1 : End Function ' 3
~~~~~~
BC30040: First statement of a method body cannot be on the same line as the method declaration.
Private Public Function M() As Integer : Return 1 : End Function ' 3
~~~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Public Class C : End Class ' 4
~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Public Structure S : End Structure ' 5
~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Public Enum E : End Enum ' 6
~~~~~~
BC30280: Enum 'E' must contain at least one member.
Private Public Enum E : End Enum ' 6
~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Public Event V As System.Action ' 7
~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Public Interface I : End Interface ' 8
~~~~~~
</errors>)
......
......@@ -367,7 +367,7 @@ BC30396: 'MustInherit' is not valid on an Enum declaration.
BC30178: Specifier is duplicated.
Private Private Enum Figure4
~~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Private Public Enum Figure5
~~~~~~
BC30280: Enum 'Figure5' must contain at least one member.
......
......@@ -1568,7 +1568,7 @@ End Structure
CompilationUtils.AssertTheseDiagnostics(compilation,
<errors>
BC31067: Method in a structure cannot be declared 'Protected' or 'Protected Friend'.
BC31067: Method in a structure cannot be declared 'Protected', 'Protected Friend', or 'Private Protected'.
Protected Sub OtherMethod()
~~~~~~~~~
</errors>)
......@@ -1864,10 +1864,10 @@ BC30435: Members in a Structure cannot be declared 'Protected'.
BC30435: Members in a Structure cannot be declared 'Protected Friend'.
Protected Friend F4 As Integer
~~~~~~~~~~~~~~~~
BC31067: Method in a structure cannot be declared 'Protected' or 'Protected Friend'.
BC31067: Method in a structure cannot be declared 'Protected', 'Protected Friend', or 'Private Protected'.
Protected Sub Sub3()
~~~~~~~~~
BC31067: Method in a structure cannot be declared 'Protected' or 'Protected Friend'.
BC31067: Method in a structure cannot be declared 'Protected', 'Protected Friend', or 'Private Protected'.
Protected Friend Sub Sub4()
~~~~~~~~~~~~~~~~
BC30735: Type in a Module cannot be declared 'Protected'.
......
......@@ -10254,16 +10254,16 @@ BC31065: 'Set' parameter cannot be declared 'Optional'.
]]></file>
</compilation>)
Dim expectedErrors1 = <errors><![CDATA[
BC31067: Method in a structure cannot be declared 'Protected' or 'Protected Friend'.
BC31067: Method in a structure cannot be declared 'Protected', 'Protected Friend', or 'Private Protected'.
Protected Sub New(o)
~~~~~~~~~
BC31067: Method in a structure cannot be declared 'Protected' or 'Protected Friend'.
BC31067: Method in a structure cannot be declared 'Protected', 'Protected Friend', or 'Private Protected'.
Protected Friend Sub New(x, y)
~~~~~~~~~~~~~~~~
BC31067: Method in a structure cannot be declared 'Protected' or 'Protected Friend'.
BC31067: Method in a structure cannot be declared 'Protected', 'Protected Friend', or 'Private Protected'.
Protected Sub M()
~~~~~~~~~
BC31067: Method in a structure cannot be declared 'Protected' or 'Protected Friend'.
BC31067: Method in a structure cannot be declared 'Protected', 'Protected Friend', or 'Private Protected'.
Protected Friend Function F()
~~~~~~~~~~~~~~~~
]]></errors>
......@@ -21952,7 +21952,7 @@ End Class
BC30178: Specifier is duplicated.
Public Public p as Integer
~~~~~~
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', or 'Protected Friend' can be specified.
BC30176: Only one of 'Public', 'Private', 'Protected', 'Friend', 'Protected Friend', or 'Private Protected' can be specified.
Public Private q as Integer
~~~~~~~
BC30235: 'MustOverride' is not valid on a member variable declaration.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册