diff --git a/src/Compilers/VisualBasic/Portable/Parser/Parser.vb b/src/Compilers/VisualBasic/Portable/Parser/Parser.vb index b03c4fedb24d2f6165c151bd713941ea9a572ce1..ef4a80b475ccf673cc3d6be472ec42c5015f60c6 100644 --- a/src/Compilers/VisualBasic/Portable/Parser/Parser.vb +++ b/src/Compilers/VisualBasic/Portable/Parser/Parser.vb @@ -2992,7 +2992,7 @@ checkNullable: ' There is a syntax error of some kind. Dim skipped = ResyncAt({SyntaxKind.CommaToken, SyntaxKind.CloseParenToken}).Node - If skipped IsNot Nothing Then + If skipped IsNot Nothing AndAlso Not element.ContainsDiagnostics Then skipped = ReportSyntaxError(skipped, ERRID.ERR_ArgumentSyntax) End If diff --git a/src/Compilers/VisualBasic/Test/Emit/CodeGen/CodeGenTuples.vb b/src/Compilers/VisualBasic/Test/Emit/CodeGen/CodeGenTuples.vb index f301acdb9cb82957e32c495d149b740a37c945e0..036fa19ffdd0e03d49fd73cbf4449c8febefc080 100644 --- a/src/Compilers/VisualBasic/Test/Emit/CodeGen/CodeGenTuples.vb +++ b/src/Compilers/VisualBasic/Test/Emit/CodeGen/CodeGenTuples.vb @@ -246,6 +246,10 @@ Module C console.writeline(t4.Integer.Length) console.writeline(t4.Await.Length) console.writeline(t4.Function.Length) + + Dim t5 as (Function As String, Sub, Junk1 As Junk2 Recovery, Junk4 Junk5) = nothing + console.writeline(t4.Function.Length) + End Sub class V2 @@ -290,6 +294,24 @@ BC30302: Type character '%' cannot be used in a declaration with an explicit typ BC30183: Keyword is not valid as an identifier. Dim t4 as (Integer% As String, Await As String, Function$) = nothing ~~~~~ +BC30180: Keyword does not name a type. + Dim t5 as (Function As String, Sub, Junk1 As Junk2 Recovery, Junk4 Junk5) = nothing + ~ +BC30180: Keyword does not name a type. + Dim t5 as (Function As String, Sub, Junk1 As Junk2 Recovery, Junk4 Junk5) = nothing + ~ +BC30002: Type 'Junk2' is not defined. + Dim t5 as (Function As String, Sub, Junk1 As Junk2 Recovery, Junk4 Junk5) = nothing + ~~~~~ +BC32017: Comma, ')', or a valid expression continuation expected. + Dim t5 as (Function As String, Sub, Junk1 As Junk2 Recovery, Junk4 Junk5) = nothing + ~~~~~~~~ +BC30002: Type 'Junk4' is not defined. + Dim t5 as (Function As String, Sub, Junk1 As Junk2 Recovery, Junk4 Junk5) = nothing + ~~~~~ +BC32017: Comma, ')', or a valid expression continuation expected. + Dim t5 as (Function As String, Sub, Junk1 As Junk2 Recovery, Junk4 Junk5) = nothing + ~~~~~ ) End Sub