Skip to content

Commit c229830

Browse files
Revert
1 parent 5137735 commit c229830

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Compilers/CSharp/Portable/Parser/LanguageParser.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8286,10 +8286,11 @@ private bool IsPossibleDeclarationStatementFollowingNullableType()
82868286
}
82878287

82888288
// looks like a property:
8289+
// T? Goo {
82898290
//
8290-
// T? Goo {
8291-
// T? Goo =>
8292-
if (this.CurrentToken.Kind is SyntaxKind.OpenBraceToken or SyntaxKind.EqualsGreaterThanToken)
8291+
// Importantly, we don't consider `T? Goo =>` to be the start of a property. This is because it's legal to write:
8292+
// T ? Goo => Goo : Bar => Bar
8293+
if (this.CurrentToken.Kind is SyntaxKind.OpenBraceToken)
82938294
{
82948295
return true;
82958296
}

0 commit comments

Comments
 (0)