We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5137735 commit c229830Copy full SHA for c229830
src/Compilers/CSharp/Portable/Parser/LanguageParser.cs
@@ -8286,10 +8286,11 @@ private bool IsPossibleDeclarationStatementFollowingNullableType()
8286
}
8287
8288
// looks like a property:
8289
+ // T? Goo {
8290
//
- // T? Goo {
8291
- // T? Goo =>
8292
- if (this.CurrentToken.Kind is SyntaxKind.OpenBraceToken or SyntaxKind.EqualsGreaterThanToken)
+ // Importantly, we don't consider `T? Goo =>` to be the start of a property. This is because it's legal to write:
+ // T ? Goo => Goo : Bar => Bar
8293
+ if (this.CurrentToken.Kind is SyntaxKind.OpenBraceToken)
8294
{
8295
return true;
8296
0 commit comments